KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > containers > EJBLocalRemoteObject


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.ejb.containers;
25
26
27 import javax.ejb.*;
28
29 import com.sun.ejb.*;
30
31 /**
32  * Implementation common to EJBObjects and EJBLocalObjects.
33  * It is extended by EJBObjectImpl and EJBLocalObjectImpl.
34  *
35  */

36 public abstract class EJBLocalRemoteObject
37 {
38     protected static final boolean debug = false;
39
40     transient protected BaseContainer container;
41     transient protected Object JavaDoc primaryKey;
42     transient private boolean removed=false;
43
44     // Only used for stateful SessionBeans
45
transient private SessionContextImpl context;
46
47
48     final void setContainer(Container container)
49     {
50         this.container = (BaseContainer)container;
51     }
52
53     /**
54      * Container needs to be accessed from generated code as well
55      * as from other classes in this package. Rather than having one
56      * public method, we have a protected one that is used from generated
57      * code and a package-private one used within other container classes.
58      *
59      */

60
61     protected final Container getContainer()
62     {
63         return container;
64     }
65
66     final Container _getContainerInternal()
67     {
68         return container;
69     }
70     
71     final void setRemoved(boolean r)
72     {
73         removed = r;
74     }
75
76     final boolean isRemoved()
77     {
78         return removed;
79     }
80
81     final void setKey(Object JavaDoc key)
82     {
83         primaryKey = key;
84     }
85
86     final Object JavaDoc getKey()
87     {
88         return primaryKey;
89     }
90
91     // Only used for stateful SessionBeans
92
final SessionContextImpl getContext()
93     {
94         return context;
95     }
96
97     // Only used for stateful SessionBeans
98
final void setContext(SessionContextImpl ctx)
99     {
100         context = ctx;
101     }
102
103     // Only used for stateful SessionBeans
104
final void clearContext()
105     {
106         context = null;
107     }
108 }
109
Popular Tags