FileDocCategorySizeDatePackage
ProfileServerBean.javaAPI DocExample2775Wed Apr 05 11:25:42 BST 2000stateless

ProfileServerBean

public class ProfileServerBean extends Object implements SessionBean
A ProfileServerBean, which provides enterprise profile information for a named person.

Fields Summary
private SessionContext
mContext
Constructors Summary
Methods Summary
public voidejbActivate()
No need for us to activate anything in this bean, but we need to provide an implementation.

  
  // Session bean methods

                      
     
    System.out.println("ProfileServerBean activated.");
  
public voidejbCreate()
Create method(s) (corresponds to each create() method on the home interface, ProfileServerHome. Nothing to initialize in this case.

    System.out.println("ProfileServerBean created.");
  
public voidejbPassivate()
No state to store on passivation.

    System.out.println("ProfileServerBean passivated.");
  
public voidejbRemove()
Nothing to do on a remove.

    System.out.println("ProfileServerBean removed.");
  
public ProfilegetProfile(java.lang.String name)
Get a profile for a named person. Throws NoSuchPersonException if the named person cannot be found in the database(s) used to retrieve profile information.

    // Here, we just create a ProfileImpl and return it.  The EJB/RMI
    // internals will return a remote stub for the object to the remote client,
    // and the profile object will live on this end.
    ProfileImpl profile = null;
    try {
      profile = new ProfileImpl(name);
    }
    catch (RemoteException re) {
      System.out.println("Failed creating profile for " + name);
      re.printStackTrace();
      throw new NoSuchPersonException();
    }

    return profile;
  
public voidsetSessionContext(SessionContext context)
Get context from container.

    System.out.println("ProfileServerBean context set.");
    mContext = context;