KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > testbean > bean > EntityPKBean


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.testbean.bean;
23
24 import java.rmi.*;
25 import javax.ejb.*;
26 import org.jboss.test.testbean.interfaces.AComplexPK;
27
28 public class EntityPKBean implements EntityBean {
29    org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(getClass());
30     public boolean aBoolean;
31     public int anInt;
32     public long aLong;
33     public double aDouble;
34     public String JavaDoc aString;
35
36    public int otherField;
37
38    private EntityContext entityContext;
39
40
41     public AComplexPK ejbCreate(boolean aBoolean, int anInt, long aLong, double aDouble, String JavaDoc aString) throws RemoteException, CreateException {
42
43         log.debug("EntityPK.ejbCreate() called");
44
45         this.aBoolean = aBoolean;
46         this.anInt = anInt;
47         this.aLong = aLong;
48         this.aDouble = aDouble;
49         this.aString = aString;
50
51         return new AComplexPK(aBoolean, anInt, aLong, aDouble, aString);
52     }
53
54     public AComplexPK ejbCreateMETHOD(boolean aBoolean, int anInt, long aLong, double aDouble, String JavaDoc aString) throws RemoteException, CreateException {
55
56         log.debug("EntityPK.ejbCreateMETHOD() called");
57
58         this.aBoolean = aBoolean;
59         this.anInt = anInt;
60         this.aLong = aLong;
61         this.aDouble = aDouble;
62         this.aString = aString;
63
64         return new AComplexPK(aBoolean, anInt, aLong, aDouble, aString);
65     }
66
67     public void ejbPostCreate(boolean aBoolean, int anInt, long aLong, double aDouble, String JavaDoc aString) throws RemoteException, CreateException {
68
69         log.debug("EntityPK.ejbPostCreate(pk) called");
70     }
71
72     public void ejbPostCreateMETHOD(boolean aBoolean, int anInt, long aLong, double aDouble, String JavaDoc aString) throws RemoteException, CreateException {
73
74         log.debug("EntityPK.ejbPostCreateMETHOD(pk) called");
75     }
76
77     public void ejbActivate() throws RemoteException {
78
79         log.debug("EntityPK.ejbActivate() called");
80     }
81
82     public void ejbLoad() throws RemoteException {
83
84         log.debug("EntityPK.ejbLoad() called");
85     }
86
87     public void ejbPassivate() throws RemoteException {
88
89         log.debug("EntityPK.ejbPassivate() called");
90     }
91
92     public void ejbRemove() throws RemoteException, RemoveException {
93
94         log.debug("EntityPK.ejbRemove() called");
95     }
96
97     public void ejbStore() throws RemoteException {
98
99         log.debug("EntityPK.ejbStore() called");
100     }
101
102
103     public void setEntityContext(EntityContext context) throws RemoteException {
104
105         log.debug("EntityPK.setSessionContext() called");
106         entityContext = context;
107     }
108
109     public void unsetEntityContext() throws RemoteException {
110
111         log.debug("EntityBMP.unsetSessionContext() called");
112         entityContext = null;
113     }
114
115     public void updateAllValues(AComplexPK aComplexPK) throws RemoteException {
116
117         this.aBoolean = aComplexPK.aBoolean;
118         this.aDouble = aComplexPK.aDouble;
119         this.aLong = aComplexPK.aLong;
120         this.anInt = aComplexPK.anInt;
121         this.aString = aComplexPK.aString;
122
123     };
124
125     public AComplexPK readAllValues() throws RemoteException {
126
127         return new AComplexPK(aBoolean, anInt, aLong, aDouble, aString);
128
129
130     };
131
132    public int getOtherField() throws RemoteException {
133       return otherField;
134    }
135
136    public void setOtherField(int newValue) throws RemoteException {
137       otherField = newValue;
138    }
139
140 }
141
Popular Tags