KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > PortableActivationIDL > _ActivatorImplBase


1 package com.sun.corba.se.PortableActivationIDL;
2
3
4 /**
5 * com/sun/corba/se/PortableActivationIDL/_ActivatorImplBase.java .
6 * Generated by the IDL-to-Java compiler (portable), version "3.2"
7 * from ../../../../src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
8 * Saturday, February 9, 2008 2:04:41 AM PST
9 */

10
11 public abstract class _ActivatorImplBase extends org.omg.CORBA.portable.ObjectImpl JavaDoc
12                 implements com.sun.corba.se.PortableActivationIDL.Activator, org.omg.CORBA.portable.InvokeHandler JavaDoc
13 {
14
15   // Constructors
16
public _ActivatorImplBase ()
17   {
18   }
19
20   private static java.util.Hashtable JavaDoc _methods = new java.util.Hashtable JavaDoc ();
21   static
22   {
23     _methods.put ("registerServer", new java.lang.Integer JavaDoc (0));
24     _methods.put ("serverGoingDown", new java.lang.Integer JavaDoc (1));
25     _methods.put ("registerORB", new java.lang.Integer JavaDoc (2));
26     _methods.put ("registerPOA", new java.lang.Integer JavaDoc (3));
27     _methods.put ("poaDestroyed", new java.lang.Integer JavaDoc (4));
28     _methods.put ("activate", new java.lang.Integer JavaDoc (5));
29     _methods.put ("shutdown", new java.lang.Integer JavaDoc (6));
30     _methods.put ("install", new java.lang.Integer JavaDoc (7));
31     _methods.put ("uninstall", new java.lang.Integer JavaDoc (8));
32     _methods.put ("getActiveServers", new java.lang.Integer JavaDoc (9));
33     _methods.put ("getORBNames", new java.lang.Integer JavaDoc (10));
34     _methods.put ("lookupPOATemplate", new java.lang.Integer JavaDoc (11));
35   }
36
37   public org.omg.CORBA.portable.OutputStream JavaDoc _invoke (String JavaDoc $method,
38                                 org.omg.CORBA.portable.InputStream JavaDoc in,
39                                 org.omg.CORBA.portable.ResponseHandler JavaDoc $rh)
40   {
41     org.omg.CORBA.portable.OutputStream JavaDoc out = null;
42     java.lang.Integer JavaDoc __method = (java.lang.Integer JavaDoc)_methods.get ($method);
43     if (__method == null)
44       throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
45
46     switch (__method.intValue ())
47     {
48
49   /** A new ORB started server registers itself with the Activator
50     */

51        case 0: // PortableActivationIDL/Activator/registerServer
52
{
53          try {
54            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
55            com.sun.corba.se.PortableActivationIDL.ServerProxy serverObj = com.sun.corba.se.PortableActivationIDL.ServerProxyHelper.read (in);
56            this.registerServer (serverId, serverObj);
57            out = $rh.createReply();
58          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
59            out = $rh.createExceptionReply ();
60            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
61          }
62          break;
63        }
64
65
66   /** A server is shutting down that was started by this activator.
67     * Complete termination of the server is detected by the death of the
68     * process implementing the server.
69     */

70        case 1: // PortableActivationIDL/Activator/serverGoingDown
71
{
72          String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
73          this.serverGoingDown (serverId);
74          out = $rh.createReply();
75          break;
76        }
77
78
79   /** Called whenever an ORB instance is created. This registers
80     * the transport endpoints and the ORB proxy callback object.
81     * Note that we cannot detect when an ORB shuts down, although
82     * all of the POA shutdowns should still be reported.
83     */

84        case 2: // PortableActivationIDL/Activator/registerORB
85
{
86          try {
87            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
88            String JavaDoc orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
89            com.sun.corba.se.PortableActivationIDL.ORBProxy orb = com.sun.corba.se.PortableActivationIDL.ORBProxyHelper.read (in);
90            com.sun.corba.se.PortableActivationIDL.EndPointInfo endPointInfo[] = com.sun.corba.se.PortableActivationIDL.EndpointInfoListHelper.read (in);
91            this.registerORB (serverId, orbId, orb, endPointInfo);
92            out = $rh.createReply();
93          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
94            out = $rh.createExceptionReply ();
95            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
96          } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
97            out = $rh.createExceptionReply ();
98            com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
99          } catch (com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegistered $ex) {
100            out = $rh.createExceptionReply ();
101            com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegisteredHelper.write (out, $ex);
102          }
103          break;
104        }
105
106
107   /** Construct or find an ORBD object template corresponding to the
108     * server's object template and return it. Called whenever a
109     * persistent POA is created.
110     */

111        case 3: // PortableActivationIDL/Activator/registerPOA
112
{
113          String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
114          String JavaDoc orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
115          org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc poaTemplate = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read (in);
116          org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc $result = null;
117          $result = this.registerPOA (serverId, orbId, poaTemplate);
118          out = $rh.createReply();
119          org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write (out, $result);
120          break;
121        }
122
123
124   /** Called whenever a POA is destroyed.
125     */

126        case 4: // PortableActivationIDL/Activator/poaDestroyed
127
{
128          String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
129          String JavaDoc orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
130          org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc poaTemplate = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read (in);
131          this.poaDestroyed (serverId, orbId, poaTemplate);
132          out = $rh.createReply();
133          break;
134        }
135
136
137   /** If the server is not running, start it up. This is allowed
138     * whether or not the server has been installed.
139     */

140        case 5: // PortableActivationIDL/Activator/activate
141
{
142          try {
143            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
144            this.activate (serverId);
145            out = $rh.createReply();
146          } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyActive $ex) {
147            out = $rh.createExceptionReply ();
148            com.sun.corba.se.PortableActivationIDL.ServerAlreadyActiveHelper.write (out, $ex);
149          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
150            out = $rh.createExceptionReply ();
151            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
152          } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
153            out = $rh.createExceptionReply ();
154            com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
155          }
156          break;
157        }
158
159
160   /** If the server is running, shut it down
161     */

162        case 6: // PortableActivationIDL/Activator/shutdown
163
{
164          try {
165            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
166            this.shutdown (serverId);
167            out = $rh.createReply();
168          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotActive $ex) {
169            out = $rh.createExceptionReply ();
170            com.sun.corba.se.PortableActivationIDL.ServerNotActiveHelper.write (out, $ex);
171          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
172            out = $rh.createExceptionReply ();
173            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
174          }
175          break;
176        }
177
178
179   /** Invoke the server install hook. If the server is not
180     * currently running, this method will activate it.
181     */

182        case 7: // PortableActivationIDL/Activator/install
183
{
184          try {
185            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
186            this.install (serverId);
187            out = $rh.createReply();
188          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
189            out = $rh.createExceptionReply ();
190            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
191          } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
192            out = $rh.createExceptionReply ();
193            com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
194          } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalled $ex) {
195            out = $rh.createExceptionReply ();
196            com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalledHelper.write (out, $ex);
197          }
198          break;
199        }
200
201
202   /** Invoke the server uninstall hook. If the server is not
203     * currently running, this method will activate it.
204     * After this hook completes, the server may still be running.
205     */

206        case 8: // PortableActivationIDL/Activator/uninstall
207
{
208          try {
209            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
210            this.uninstall (serverId);
211            out = $rh.createReply();
212          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
213            out = $rh.createExceptionReply ();
214            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
215          } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
216            out = $rh.createExceptionReply ();
217            com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
218          } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalled $ex) {
219            out = $rh.createExceptionReply ();
220            com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalledHelper.write (out, $ex);
221          }
222          break;
223        }
224
225
226   /** list active servers
227     */

228        case 9: // PortableActivationIDL/Activator/getActiveServers
229
{
230          String JavaDoc $result[] = null;
231          $result = this.getActiveServers ();
232          out = $rh.createReply();
233          com.sun.corba.se.PortableActivationIDL.ServerIdsHelper.write (out, $result);
234          break;
235        }
236
237
238   /** list all registered ORBs for a server
239     */

240        case 10: // PortableActivationIDL/Activator/getORBNames
241
{
242          try {
243            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
244            String JavaDoc $result[] = null;
245            $result = this.getORBNames (serverId);
246            out = $rh.createReply();
247            com.sun.corba.se.PortableActivationIDL.ORBidListHelper.write (out, $result);
248          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
249            out = $rh.createExceptionReply ();
250            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
251          }
252          break;
253        }
254
255
256   /** Find the server template that corresponds to the ORBD's
257     * adapter id.
258     */

259        case 11: // PortableActivationIDL/Activator/lookupPOATemplate
260
{
261          String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
262          String JavaDoc orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
263          String JavaDoc orbAdapterName[] = org.omg.PortableInterceptor.AdapterNameHelper.read (in);
264          org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc $result = null;
265          $result = this.lookupPOATemplate (serverId, orbId, orbAdapterName);
266          out = $rh.createReply();
267          org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write (out, $result);
268          break;
269        }
270
271        default:
272          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
273     }
274
275     return out;
276   } // _invoke
277

278   // Type-specific CORBA::Object operations
279
private static String JavaDoc[] __ids = {
280     "IDL:PortableActivationIDL/Activator:1.0"};
281
282   public String JavaDoc[] _ids ()
283   {
284     return (String JavaDoc[])__ids.clone ();
285   }
286
287
288 } // class _ActivatorImplBase
289
Popular Tags