KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > PortableServer > Servant


1 /***** Copyright (c) 1999 Object Management Group. Unlimited rights to
2
3        duplicate and use this code are hereby granted provided that this
4
5        copyright notice is included.
6
7 *****/

8
9
10
11 package org.omg.PortableServer;
12
13
14
15 abstract public class Servant {
16
17
18
19     final public org.omg.CORBA.Object JavaDoc _this_object() {
20
21         return _get_delegate().this_object(this);
22
23     }
24
25
26
27     final public org.omg.CORBA.Object JavaDoc _this_object(org.omg.CORBA.ORB JavaDoc orb) {
28
29         try {
30
31             ((org.omg.CORBA_2_3.ORB JavaDoc)orb).set_delegate(this);
32
33         }
34
35         catch (ClassCastException JavaDoc e) {
36
37             throw new org.omg.CORBA.BAD_PARAM JavaDoc(
38
39     "POA Servant requires an instanceof org.omg.CORBA_2_3.ORB");
40
41         }
42
43         return _this_object();
44
45     }
46
47
48
49     final public org.omg.CORBA.ORB JavaDoc _orb() {
50
51         return _get_delegate().orb(this);
52
53     }
54
55
56
57     final public POA JavaDoc _poa() {
58
59         return _get_delegate().poa(this);
60
61     }
62
63
64
65     final public byte[] _object_id() {
66
67         return _get_delegate().object_id(this);
68
69     }
70
71
72
73     /**
74
75      * Note: the written spec. says the following four
76
77      * methods may be overridden in subclasses, so the
78
79      * "final" modifier seems wrong here...
80
81      */

82
83
84
85     /* final */ public POA JavaDoc _default_POA() {
86
87         return _get_delegate().default_POA(this);
88
89     }
90
91
92
93     /* final */ public boolean _is_a(String JavaDoc repository_id) {
94
95         return _get_delegate().is_a(this, repository_id);
96
97     }
98
99
100
101     /* final */ public boolean _non_existent() {
102
103         return _get_delegate().non_existent(this);
104
105     }
106
107
108
109     /* final */ public org.omg.CORBA.InterfaceDef JavaDoc _get_interface() {
110
111         return _get_delegate().get_interface(this);
112
113     }
114
115
116
117     abstract public String JavaDoc[] _all_interfaces(POA JavaDoc poa, byte[] objectID);
118
119
120
121     private transient org.omg.PortableServer.portable.Delegate JavaDoc _delegate =null;
122
123
124
125     final public org.omg.PortableServer.portable.Delegate JavaDoc _get_delegate() {
126
127         if (_delegate == null) {
128
129             throw new org.omg.CORBA.BAD_INV_ORDER JavaDoc(
130
131                 "The Servant has not been associated with an ORBinstance");
132
133         }
134
135         return _delegate;
136
137     }
138
139
140
141     final public void _set_delegate(
142
143             org.omg.PortableServer.portable.Delegate JavaDoc delegate) {
144
145         _delegate = delegate;
146
147     }
148
149 }
150
151
Popular Tags