All Examples All EJB Examples This Package
Class examples.ejb.subclass.child.ChildBean
java.lang.Object
|
+----examples.ejb.subclass.parent.ParentBean
|
+----examples.ejb.subclass.child.ChildBean
- public class ChildBean
- extends ParentBean
- implements SessionBean
ChildBean is a stateless SessionBean. This bean illustrates:
- Child class to the ParentBean class
- Using subclassing to simplify related bean classes
- Contains only methods that are either unique to the Child class
or overload methods in the Parent Bean
- Using JNDI to look up and call another bean from
within a bean (callParentBean)
- Author:
- Copyright (c) 1998 by WebLogic, Inc. All Rights Reserved.
- Copyright (c) 1998-1999 by BEA WebXpress. All Rights Reserved.
-
ChildBean()
-
-
callParentBean()
- Looks up a ParentBean and calls its
parentMethodOnly().
-
childSaysHello()
- Returns a message identifying the method.
-
parentSaysHello()
- Returns a message identifying the method.
ChildBean
public ChildBean()
childSaysHello
public String childSaysHello()
- Returns a message identifying the method.
This method is unique to the Child bean.
- Returns:
- String Message
parentSaysHello
public String parentSaysHello()
- Returns a message identifying the method.
This method is inherited and overloaded by the Child bean.
- Returns:
- String Message
- Overrides:
- parentSaysHello in class ParentBean
callParentBean
public String callParentBean() throws RemoteException
- Looks up a ParentBean and calls its
parentMethodOnly(). Returns a message identifying the method.
- Demonstrates calling one bean from another bean
- Uses SessionContext ctx to generate a new Context
- Uses that Context to find the ParentHome
- Returns:
- String Message
- Throws: RemoteException
- if there is
a communications or systems failure
All Examples All EJB Examples This Package