01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999-2004 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: JWrapper.java 8098 2006-03-09 14:15:42Z durieuxp $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas_ejb.container;
25:
26: import java.io.Serializable;
27:
28: /**
29: * This class is just a wrapper to encapsulate some fields of a Stateful
30: * Session bean when it is serialized.
31: * @author durieuxp
32: */
33: public class JWrapper implements Serializable {
34:
35: private static final long serialVersionUID = 18L;
36:
37: int type;
38:
39: public static final int USER_TX = 1;
40:
41: public static final int SESSION_CTX = 2;
42:
43: public static final int HANDLE = 3;
44:
45: public static final int LOCAL_HOME = 4;
46:
47: public static final int LOCAL_ENTITY = 5;
48:
49: public static final int NAMING_CONTEXT = 6;
50:
51: //public static final int DATASOURCE = 7; // Needed by HA service
52:
53: Object obj;
54: Object pk;
55:
56: public JWrapper(int type, Object arg) {
57: this .type = type;
58: this .obj = arg;
59: }
60:
61: public JWrapper(int type, String jndi, Object pk) {
62: this .type = type;
63: this .obj = jndi;
64: this .pk = pk;
65: }
66:
67: public int getType() {
68: return type;
69: }
70:
71: public Object getObject() {
72: return obj;
73: }
74:
75: public Object getPK() {
76: return pk;
77: }
78:
79: }
|