examples.ejb.subclass
Class ParentBean
java.lang.Object
|
+--examples.ejb.subclass.ParentBean
- All Implemented Interfaces:
- javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean
- Direct Known Subclasses:
- ChildBean
- public class ParentBean
- extends java.lang.Object
- implements javax.ejb.SessionBean
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
- Author:
- Copyright (c) 1998 by WebLogic, Inc. All Rights Reserved., Copyright (c) 1998-2000 by BEA Systems, Inc. All Rights Reserved.
Field Summary |
protected javax.ejb.SessionContext |
ctx
|
(package private) static boolean |
VERBOSE
|
Method Summary |
void |
ejbActivate()
This method is required by the EJB Specification,
but is not used by this example. |
void |
ejbCreate()
This method corresponds to the create method in the home interface
"ParentHome". |
void |
ejbPassivate()
This method is required by the EJB Specification,
but is not used by this example. |
void |
ejbRemove()
This method is required by the EJB Specification,
but is not used by this example. |
protected void |
log(java.lang.String s)
|
java.lang.String |
nonOverloadedMethod()
Sends back a pre-defined message identifying the method. |
java.lang.String |
sayHello()
Sends back a pre-defined message identifying the method. |
void |
setSessionContext(javax.ejb.SessionContext ctx)
Sets the session context. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ctx
protected javax.ejb.SessionContext ctx
VERBOSE
static final boolean VERBOSE
ParentBean
public ParentBean()
ejbActivate
public void ejbActivate()
- This method is required by the EJB Specification,
but is not used by this example.
- Specified by:
ejbActivate
in interface javax.ejb.SessionBean
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
ejbPassivate
public void ejbPassivate()
- This method is required by the EJB Specification,
but is not used by this example.
- Specified by:
ejbPassivate
in interface javax.ejb.SessionBean
ejbRemove
public void ejbRemove()
- This method is required by the EJB Specification,
but is not used by this example.
- Specified by:
ejbRemove
in interface javax.ejb.SessionBean
log
protected void log(java.lang.String s)
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
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
setSessionContext
public void setSessionContext(javax.ejb.SessionContext ctx)
- Sets the session context.
- Specified by:
setSessionContext
in interface javax.ejb.SessionBean
- Parameters:
ctx
- SessionContext Context for session
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.