| Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g Release 3 (10.1.3) B14428-01 |
|
![]() Previous |
![]() Next |
Table 12-5 lists the EJB 2.1 session bean callback methods you can specify (see "Using Java").
Table 12-5 EJB 2.1 Session Bean Lifecycle Callback Methods
| Method | Description |
|---|---|
|
The container invokes this method to create an instance of the bean. |
|
|
The container invokes this method right after it reactivates the bean. |
|
|
The container invokes this method right before it passivates the bean. You can turn off passivation for stateful session beans (see "Configuring Passivation"). |
|
|
A container invokes this method before it ends the life of the session object. This method performs any required clean-up—for example, closing external resources such as file handles. |
|
|
|
This method associates a bean instance with its context information. The container calls this method after the bean creation. The enterprise bean can store the reference to the context object in an instance variable, for use in transaction management. Beans that manage their own transactions can use the session context to get the transaction context. |
Session bean callback method signatures are defined in the javax.ejb.SessionBean interface.
|
Note: Using EJB 2.1, you must implement all session bean callback methods. If you do not need to take any action, implement an empty method. |
For more information, see "Callback Methods".
Example 12-1 shows how to implement an EBJ 2.1 session bean callback method.