\x3C/script>')
All Examples All EJB Examples This Package
Class examples.ejb.subclass.ParentBean
examples.ejb.subclass.ParentBean
- public class ParentBean
ParentBean is a stateless SessionBean. This bean:
- Is the parent class to the ChildBean subclass
- Contains methods that are inherited by the Child bean
- Contains a method that is overloaded by the Child bean
- Illustrates the use of protected instead of private variables
so that the Child bean can inherit them
ctx-
ParentBean()
-
ejbActivate()
- This method is required by the EJB Specification,
but is not used by this example.
ejbCreate()
- This method corresponds to the create method in the home interface
"ParentHome".
ejbPassivate()
- This method is required by the EJB Specification,
but is not used by this example.
ejbRemove()
- This method is required by the EJB Specification,
but is not used by this example.
log(String)
-
nonOverloadedMethod()
- Sends back a pre-defined message identifying the method.
sayHello()
- Sends back a pre-defined message identifying the method.
setSessionContext(SessionContext)
- Sets the session context.
ctx
protected javax.ejb.SessionContext ctx
ParentBean
public ParentBean()
setSessionContext
public void setSessionContext(javax.ejb.SessionContext ctx)
Sets the session context.
- Parameters:
ctx
- SessionContext Context for session
ejbActivate
public void ejbActivate()
This method is required by the EJB Specification,
but is not used by this example.
ejbPassivate
public void ejbPassivate()
This method is required by the EJB Specification,
but is not used by this example.
ejbRemove
public void ejbRemove()
This method is required by the EJB Specification,
but is not used by this example.
ejbCreate
public void ejbCreate() throws javax.ejb.CreateException
This method corresponds to the create method in the home interface
"ParentHome".
The parameter sets of the two methods are identical. When the client calls
ParentHome.create()
, the container allocates an instance of
the EJBean and calls ejbCreate()
.
- Throws:
- javax.ejb.CreateException - if there is
a problem creating the bean
- See Also:
- examples.ejb.subclass.parent.Parent
sayHello
public java.lang.String sayHello()
Sends back a pre-defined message identifying the method.
This method is inherited and overloaded by the Child bean.
- Returns:
- String Message
nonOverloadedMethod
public java.lang.String nonOverloadedMethod()
Sends back a pre-defined message identifying the method.
This method is inherited but not overloaded by the Child bean.
- Returns:
- String Message
log
protected void log(java.lang.String s)
All Examples All EJB Examples This Package