KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > ejb > SessionBean

javax.ejb
Interface SessionBean

All Superinterfaces:
EnterpriseBean, Serializable
See Also:
Top Examples, Source Code

public void ejbActivate()
                 throws EJBException,
                        RemoteException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void ejbPassivate()
                  throws EJBException,
                         RemoteException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void ejbRemove()
               throws EJBException,
                      RemoteException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setSessionContext(SessionContext ctx)
                       throws EJBException,
                              RemoteException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[54]Implement a business method using session bean
By Anonymous on 2002/10/08 10:48:16  Rate
/** 
   * the following sample session bean class provides a method, getLastName ( int ) ,  
   * to look up and return a person's last name as a java.lang.String based on a  
   * numeric  ( int )  social security number:  
   */
 
  
  
 import javax.ejb.*; 
 import java.rmi.*; 
 public class PeopleFinderBean implements SessionBean 
  {  
  
  
 SessionContext sessionContext; 
  
  
 public void ejbCreate (  )  throws CreateException, RemoteException  {  }  
  
  
 public void setSessionContext ( SessionContext sc )  
       throws RemoteException 
  {  
    sessionContext = sc; 
  }  
  
  
 // Business methods 
 public String getLastName ( int ssn )  
  {  
    String lastName = null; 
    // Get name from some data source. 
    return lastName; 
  }  
  
  
  } 

Popular Tags