KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > stests > appli > ItemEC2R


1 // ItemEC2R.java
2
package org.objectweb.jonas.stests.appli;
3
4 import org.objectweb.jonas.common.Log;
5 import org.objectweb.util.monolog.api.Logger;
6 import org.objectweb.util.monolog.api.BasicLevel;
7
8 /**
9  *
10  */

11 public abstract class ItemEC2R implements javax.ejb.EntityBean JavaDoc {
12
13     static private Logger logger = null;
14     javax.ejb.EntityContext JavaDoc ejbContext;
15
16      /**
17      * Creates an item bean
18      *
19      * @throws RemoteException if an RMI exception occurs
20      *
21      * @throws CreateException if the item cannot be created
22      *
23      * @param id an int which represents the item id
24      *
25      * @param name a String which represents the item name
26      *
27      * @param price a float which represents the item's price
28      *
29      * @param data a String which contains additional information about the item
30      */

31     public String JavaDoc ejbCreate(Integer JavaDoc id, String JavaDoc name, float price, String JavaDoc data) throws javax.ejb.CreateException JavaDoc{
32         logger.log(BasicLevel.DEBUG, "");
33
34         // Init here the bean fields
35
setItemID(id);
36         setItemName(name);
37         setItemPrice(price);
38         setItemInfo(data);
39         return null;
40     }
41
42     public void ejbPostCreate(Integer JavaDoc id, String JavaDoc name, float price, String JavaDoc data) {
43         logger.log(BasicLevel.DEBUG, "");
44     }
45
46     // ------------------------------------------------------------------
47
// Persistent fields
48
//
49
// ------------------------------------------------------------------
50
public abstract Integer JavaDoc getItemID();
51     public abstract void setItemID(Integer JavaDoc f1);
52
53     public abstract String JavaDoc getItemName();
54     public abstract void setItemName(String JavaDoc f2);
55
56     public abstract float getItemPrice();
57     public abstract void setItemPrice(float f2);
58
59     public abstract String JavaDoc getItemInfo();
60     public abstract void setItemInfo(String JavaDoc f3);
61
62     // ------------------------------------------------------------------
63
// Standard call back methods
64
// ------------------------------------------------------------------
65

66  
67     public void setEntityContext(javax.ejb.EntityContext JavaDoc ctx) {
68         if (logger == null) {
69             logger = Log.getLogger("org.objectweb.jonas_tests");
70         }
71         logger.log(BasicLevel.DEBUG, "");
72         ejbContext = ctx;
73     }
74
75
76     public void unsetEntityContext() {
77         logger.log(BasicLevel.DEBUG, "");
78         ejbContext = null;
79     }
80
81     public void ejbRemove() throws javax.ejb.RemoveException JavaDoc {
82         logger.log(BasicLevel.DEBUG, "");
83     }
84
85  
86     public void ejbLoad() {
87         logger.log(BasicLevel.DEBUG, "");
88     }
89
90
91     public void ejbStore() {
92         logger.log(BasicLevel.DEBUG, "");
93     }
94         
95
96     public void ejbPassivate() {
97         logger.log(BasicLevel.DEBUG, "");
98     }
99
100
101     public void ejbActivate() {
102         logger.log(BasicLevel.DEBUG, "");
103     }
104
105 }
106
107
108
109
Popular Tags