summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountCallbacks.java
blob: f2ed8b0363e4cc4d7b631a427dc03442580a223f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package examples.session.stateful_dd;

import javax.ejb.InvocationContext;

/**
 * This class is a lifecycle callback interceptor for the Count bean. 
 * The callback methods simply print a message when invoked by 
 * the container.
 */
public class CountCallbacks {
    
    public CountCallbacks() {}
    
    /**
     * Called by the container after construction
     */
    public void construct(InvocationContext ctx) {
        System.out.println("cb:construct()");
    }
    
    /**
     * Called by the container after activation
     */
    public void activate(InvocationContext ctx) {
        System.out.println("cb:activate()");
    }
    
    /**
     * Called by the container before passivation
     */
    public void passivate(InvocationContext ctx) {
        System.out.println("cb:passivate()");
    }
    
    /**
     * Called by the container before destruction
     */

    public void destroy(InvocationContext ctx) {
        System.out.println("cb:destroy()");
    }
    
}