| Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g Release 3 (10.1.3) B14428-01 |
|
![]() Previous |
![]() Next |
You can specify an EJB 3.0 message-driven bean class method as a callback method for any of the following lifecycle events (see "Using Annotations"):
Post-construct: a method called before the first message listener method invocation on the bean. This is at a point after which any dependency injection has been performed by the container.
Pre-destroy: a method called at the time the bean is removed from the pool or destroyed.
The message-driven bean class method must have the following signature:
public void <MethodName>()
For more information, see "Callback Methods".
You can specify an EJB 3.0 message-driven bean class method as a lifecycle callback method using any of the following annotations:
Example 10-4 shows how to use the @PostConstruct annotation to specify EJB 3.0 message-driven bean class method initialize as a lifecycle callback method.