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 --- .../examples/session/stateful_dd/CountBean.java | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountBean.java (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountBean.java') diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountBean.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountBean.java new file mode 100644 index 0000000..0a2ab2c --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/session/stateful_dd/CountBean.java @@ -0,0 +1,47 @@ +package examples.session.stateful_dd; + +import java.io.Serializable; + +/** + * A Stateful Session Bean Class that shows the basics of + * how to write a stateful session bean. + * + * This Bean is initialized to some integer value. It has a + * business method which increments the value. + * + * The annotations below declare that: + * + */ + +public class CountBean implements Count { + + /** The current counter is our conversational state. */ + private int val; + + /** + * The count() business method. + */ + public int count() { + System.out.println("count()"); + return ++val; + } + + /** + * The set() business method. + */ + public void set(int val) { + this.val = val; + System.out.println("set()"); + } + + /** + */ + public void remove() { + System.out.println("remove()"); + } + +} -- cgit v1.2.3