01: package applis.ejb.perfs;
02:
03: import java.rmi.RemoteException;
04: import javax.ejb.EntityBean;
05: import javax.ejb.EntityContext;
06: import javax.ejb.RemoveException;
07: import javax.ejb.CreateException;
08:
09: import org.objectweb.jonas.common.Log;
10: import org.objectweb.util.monolog.api.Logger;
11: import org.objectweb.util.monolog.api.BasicLevel;
12:
13: public class PerfsBean implements EntityBean {
14:
15: static protected Logger logger = null;
16:
17: protected EntityContext entityContext;
18:
19: public int code = 0;
20: public String value = null;
21:
22: public PerfsBeanPK ejbCreate(int i, String s)
23: throws CreateException, RemoteException {
24: code = i;
25: value = s;
26: // In CMP, should return null.
27: return null;
28: }
29:
30: public void ejbPostCreate(int i, String s) throws CreateException,
31: RemoteException {
32: }
33:
34: public void ejbActivate() throws RemoteException {
35: }
36:
37: public void ejbPassivate() throws RemoteException {
38: }
39:
40: public void ejbLoad() throws RemoteException {
41: }
42:
43: public void ejbStore() throws RemoteException {
44: }
45:
46: public void ejbRemove() throws RemoveException {
47: }
48:
49: public void setEntityContext(EntityContext ctx) {
50: if (logger == null)
51: logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
52: logger.log(BasicLevel.DEBUG, "");
53: entityContext = ctx;
54: }
55:
56: public void unsetEntityContext() {
57: }
58:
59: public String read() throws RemoteException {
60: logger.log(BasicLevel.DEBUG, "value = " + value);
61: return value;
62: }
63:
64: public void write(String v) throws RemoteException {
65: logger.log(BasicLevel.DEBUG, "value = " + v);
66: value = new String(v);
67: }
68:
69: public String txread() throws RemoteException {
70: logger.log(BasicLevel.DEBUG, "value = " + value);
71: return value;
72: }
73:
74: public void txwrite(String v) throws RemoteException {
75: logger.log(BasicLevel.DEBUG, "value = " + v);
76: value = new String(v);
77: }
78:
79: }
|