01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: JEntityLocalHome.java 9280 2006-08-01 10:15:24Z japaz $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas_ejb.container;
25:
26: import org.objectweb.jonas_ejb.deployment.api.EntityDesc;
27: import org.objectweb.util.monolog.api.BasicLevel;
28:
29: /**
30: * This class is the Standard LocalHome for Entity objects It exists only for
31: * beans that have declared a Local Interface. It implements
32: * javax.ejb.EJBLocalHome interface
33: * @author Philippe Durieux
34: */
35: public abstract class JEntityLocalHome extends JLocalHome {
36:
37: /**
38: * constructor
39: * @param dd The Entity Deployment Decriptor
40: * @param bf The Entity Factory
41: */
42: public JEntityLocalHome(EntityDesc dd, JEntityFactory bf) {
43: super (dd, bf);
44: if (TraceEjb.isDebugIc()) {
45: TraceEjb.interp.log(BasicLevel.DEBUG, "");
46: }
47: }
48:
49: // ---------------------------------------------------------------
50: // EJBLocalHome implementation
51: // The only method is remove(pk) and is in the generated part.
52: // ---------------------------------------------------------------
53:
54: // ---------------------------------------------------------------
55: // other public methods, for internal use.
56: // ---------------------------------------------------------------
57:
58: /**
59: * Find the EJBLocalObject for this PK
60: * @param pk the primary key
61: * @return EntityLocal matching this PK
62: */
63: public JEntityLocal findLocalByPK(Object pk) {
64: TraceEjb.interp.log(BasicLevel.DEBUG, "");
65: JEntityFactory ef = (JEntityFactory) bf;
66: JEntitySwitch es = ef.getEJB(pk);
67: return es.getLocal();
68: }
69:
70: /**
71: * Creates a new Local Object for that bean. This is in the generated class
72: * because it is mainly "new objectClass()"
73: * @return The Local Object
74: */
75: public abstract JEntityLocal createLocalObject();
76:
77: }
|