From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../session/stateful_dd/CountCallbacks.java | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountCallbacks.java (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountCallbacks.java') diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountCallbacks.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountCallbacks.java new file mode 100644 index 0000000..f2ed8b0 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountCallbacks.java @@ -0,0 +1,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()"); + } + +} -- cgit v1.2.3