Methods Summary |
---|
public void | ejbActivate()
System.out.println("ProfileBean activated.");
|
public java.lang.String | ejbCreate()
System.out.println("Nameless PersonBean created.");
setName(" ");
setFirstName(" ");
setLastName(" ");
return null;
|
public java.lang.String | ejbCreate(java.lang.String name, java.lang.String fname, java.lang.String lname)
setName(name);
setFirstName(fname);
setLastName(lname);
return null;
|
public void | ejbLoad()
|
public void | ejbPassivate()
|
public void | ejbPostCreate()
System.out.println("PersonBean post-create called.");
|
public void | ejbPostCreate(java.lang.String name, java.lang.String fname, java.lang.String lname)
|
public void | ejbRemove()
|
public void | ejbStore()
|
public java.lang.String | getFirstName() return getFirstNameLocal();
|
public abstract java.lang.String | getFirstNameLocal()
|
public java.lang.String | getLastName() return getLastNameLocal();
|
public abstract java.lang.String | getLastNameLocal()
|
public abstract java.lang.String | getName()
|
public com.oreilly.jent.ejb.Profile | getProfile()
Profile myProfile = null;
try {
// Get profile home interface
Context ctx = new InitialContext();
ProfileHome pHome = (ProfileHome)ctx.lookup("ejb/CMP20-ProfileHome");
// Do a find based on our name (first name concatenated with last name)
try {
myProfile = pHome.findByPrimaryKey(getFirstName() + " " + getLastName());
}
catch (FinderException fe) {
System.out.println("Error occurred looking up profile for " +
getFirstName() + " " + getLastName());
// Try creating a new profile
myProfile = pHome.create(getFirstName() + " " + getLastName());
}
}
catch (NamingException ne) {
System.out.println("Error occurred looking up profile home.");
throw new RemoteException("Error looking up profile home", ne);
}
catch (CreateException ce) {
System.out.println("Could neither find nor create a profile for "
+ getFirstName() + getLastName());
throw new RemoteException("Error accessing profile", ce);
}
catch (NoSuchPersonException nspe) {
System.out.println("Could neither find nor create a profile for "
+ getFirstName() + getLastName());
throw new RemoteException("Error accessing profile", nspe);
}
return myProfile;
|
public abstract ProfileLocal | getProfileLocal()
|
public void | setEntityContext(javax.ejb.EntityContext context)
mContext = context;
|
public void | setFirstName(java.lang.String fname) setFirstNameLocal(fname);
|
public abstract void | setFirstNameLocal(java.lang.String fname)
|
public void | setLastName(java.lang.String lname) setLastNameLocal(lname);
|
public abstract void | setLastNameLocal(java.lang.String lname)
|
public abstract void | setName(java.lang.String name)
|
public abstract void | setProfileLocal(ProfileLocal profile)
|
public void | unsetEntityContext()
mContext = null;
|