KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > testbeancluster > 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.testbeancluster.bean;
23
24
25 import javax.ejb.EntityBean JavaDoc;
26 import javax.ejb.EntityContext JavaDoc;
27 import javax.ejb.CreateException JavaDoc;
28 import javax.ejb.RemoveException JavaDoc;
29
30 import org.jboss.test.testbean.interfaces.AComplexPK;
31 import org.jboss.logging.Logger;
32
33 /** Tests of the cluster cache invalidation framework.
34  * @author Scott.Stark@jboss.org
35  * @version $Revision: 58115 $
36  */

37 public abstract class EntityPKBean implements EntityBean JavaDoc
38 {
39    private static Logger log = Logger.getLogger(EntityPKBean.class);
40
41    private EntityContext JavaDoc entityContext;
42
43    public AComplexPK ejbCreate(boolean aBoolean, int anInt, long aLong,
44       double aDouble, String JavaDoc aString)
45       throws CreateException JavaDoc
46    {
47       log.debug("ejbCreate() called");
48       updateAllValues(new AComplexPK(aBoolean, anInt, aLong, aDouble, aString));
49       return null;
50    }
51
52    public AComplexPK ejbCreateMETHOD(boolean aBoolean, int anInt, long aLong,
53       double aDouble, String JavaDoc aString)
54       throws CreateException JavaDoc
55    {
56       log.debug("ejbCreateMETHOD() called");
57       updateAllValues(new AComplexPK(aBoolean, anInt, aLong, aDouble, aString));
58       return null;
59    }
60
61    public void ejbPostCreate(boolean aBoolean, int anInt, long aLong,
62       double aDouble, String JavaDoc aString)
63       throws CreateException JavaDoc
64    {
65       log.debug("ejbPostCreate(pk) called");
66    }
67
68    public void ejbPostCreateMETHOD(boolean aBoolean, int anInt, long aLong,
69       double aDouble, String JavaDoc aString)
70       throws CreateException JavaDoc
71    {
72       log.debug("ejbPostCreateMETHOD(pk) called");
73    }
74
75    public void ejbActivate()
76    {
77       log.debug("ejbActivate() called");
78    }
79
80    public void ejbLoad()
81    {
82       log.debug("ejbLoad() called");
83    }
84
85    public void ejbPassivate()
86    {
87       log.debug("ejbPassivate() called");
88    }
89
90    public void ejbRemove() throws RemoveException JavaDoc
91    {
92
93       log.debug("EntityPK.ejbRemove() called");
94    }
95    public void ejbStore()
96    {
97       log.debug("ejbStore() called");
98    }
99
100    public void setEntityContext(EntityContext JavaDoc context)
101    {
102       log.debug("setSessionContext() called");
103       entityContext = context;
104    }
105
106    public void unsetEntityContext()
107    {
108       log.debug("unsetSessionContext() called");
109       entityContext = null;
110    }
111
112    public void updateAllValues(AComplexPK aComplexPK)
113    {
114       setABoolean(aComplexPK.aBoolean);
115       setADouble(aComplexPK.aDouble);
116       setALong(aComplexPK.aLong);
117       setAnInt(aComplexPK.anInt);
118       setAString(aComplexPK.aString);
119    }
120
121    public AComplexPK readAllValues()
122    {
123       return new AComplexPK(getABoolean(), getAnInt(), getALong(), getADouble(),
124          getAString());
125    }
126
127    public abstract boolean getABoolean();
128    public abstract void setABoolean(boolean value);
129
130    public abstract double getADouble();
131    public abstract void setADouble(double value);
132
133    public abstract long getALong();
134    public abstract void setALong(long value);
135
136    public abstract int getAnInt();
137    public abstract void setAnInt(int value);
138
139    public abstract String JavaDoc getAString();
140    public abstract void setAString(String JavaDoc value);
141
142    public abstract int getOtherField();
143    public abstract void setOtherField(int newValue);
144
145 }
146
Popular Tags