All Examples All EJB Examples
Enterprise JavaBean subclass example
packages and classes
about this example
This example consists of two packages that demonstrate subclassing an
Enterprise JavaBean. Please run this example before attempting to
create your own Enterprise JavaBeans, as it will show you the
different steps involved.
The example is a stateless session EJBean
called ParentBean that is the parent
class for another EJBean,
ChildBean.
The example demonstrates:
- Usage of a session EJBean
- Using subclassing to simplify related bean classes
- A bean (ChildBean)
calling another bean (ParentBean)
- ParentBean contains methods that are either unique to the Parent class
or that are overloaded by methods in the Child Bean
- Client
- Client applications for both
Parent
and
Child beans
The
Parent client
application performs these steps:
- Contacts the Parent home ("Parent") through JNDI to find the EJBean
- Creates a Parent
- Calls a method of the Parent bean that is overloaded in the Child bean
- Calls a method that's unique to the Parent bean
The
Child client
application performs these steps:
- Contacts the Child home ("Child") through JNDI to find the EJBean
- Creates a Child
- Calls a method that's unique to the Child bean
- Calls a method of the Parent bean that is overloaded
- Calls a method of the Parent bean that is not overloaded
- Calls a method of the Child bean that calls a Parent bean
The package demonstrates how you can use inheritance to simplfy the
design of beans where there is common code shared by related beans.
See the Child bean example for how this is used.
how to use this example
See the individual examples
(parent
and
child) for instructions on building and running the example.
You'll need to build both the parent and child packages before running the child client.
there's more
Read more about EJB in the Developers Guide,
Using
WebLogic Enterprise JavaBeans.
Copyright © 1997-1999 BEA Systems, Inc.
All rights reserved.
Last updated
07/23/1999