KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > activation > _ActivatorImplBase


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

10
11 public abstract class _ActivatorImplBase extends org.omg.CORBA.portable.ObjectImpl JavaDoc
12                 implements com.sun.corba.se.spi.activation.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 ("active", new java.lang.Integer JavaDoc (0));
24     _methods.put ("registerEndpoints", new java.lang.Integer JavaDoc (1));
25     _methods.put ("getActiveServers", new java.lang.Integer JavaDoc (2));
26     _methods.put ("activate", new java.lang.Integer JavaDoc (3));
27     _methods.put ("shutdown", new java.lang.Integer JavaDoc (4));
28     _methods.put ("install", new java.lang.Integer JavaDoc (5));
29     _methods.put ("getORBNames", new java.lang.Integer JavaDoc (6));
30     _methods.put ("uninstall", new java.lang.Integer JavaDoc (7));
31   }
32
33   public org.omg.CORBA.portable.OutputStream JavaDoc _invoke (String JavaDoc $method,
34                                 org.omg.CORBA.portable.InputStream JavaDoc in,
35                                 org.omg.CORBA.portable.ResponseHandler JavaDoc $rh)
36   {
37     org.omg.CORBA.portable.OutputStream JavaDoc out = null;
38     java.lang.Integer JavaDoc __method = (java.lang.Integer JavaDoc)_methods.get ($method);
39     if (__method == null)
40       throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
41
42     switch (__method.intValue ())
43     {
44
45   // A new ORB started server registers itself with the Activator
46
case 0: // activation/Activator/active
47
{
48          try {
49            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
50            com.sun.corba.se.spi.activation.Server serverObj = com.sun.corba.se.spi.activation.ServerHelper.read (in);
51            this.active (serverId, serverObj);
52            out = $rh.createReply();
53          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
54            out = $rh.createExceptionReply ();
55            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
56          }
57          break;
58        }
59
60
61   // Install a particular kind of endpoint
62
case 1: // activation/Activator/registerEndpoints
63
{
64          try {
65            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
66            String JavaDoc orbId = com.sun.corba.se.spi.activation.ORBidHelper.read (in);
67            com.sun.corba.se.spi.activation.EndPointInfo endPointInfo[] = com.sun.corba.se.spi.activation.EndpointInfoListHelper.read (in);
68            this.registerEndpoints (serverId, orbId, endPointInfo);
69            out = $rh.createReply();
70          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
71            out = $rh.createExceptionReply ();
72            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
73          } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
74            out = $rh.createExceptionReply ();
75            com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
76          } catch (com.sun.corba.se.spi.activation.ORBAlreadyRegistered $ex) {
77            out = $rh.createExceptionReply ();
78            com.sun.corba.se.spi.activation.ORBAlreadyRegisteredHelper.write (out, $ex);
79          }
80          break;
81        }
82
83
84   // list active servers
85
case 2: // activation/Activator/getActiveServers
86
{
87          int $result[] = null;
88          $result = this.getActiveServers ();
89          out = $rh.createReply();
90          com.sun.corba.se.spi.activation.ServerIdsHelper.write (out, $result);
91          break;
92        }
93
94
95   // If the server is not running, start it up.
96
case 3: // activation/Activator/activate
97
{
98          try {
99            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
100            this.activate (serverId);
101            out = $rh.createReply();
102          } catch (com.sun.corba.se.spi.activation.ServerAlreadyActive $ex) {
103            out = $rh.createExceptionReply ();
104            com.sun.corba.se.spi.activation.ServerAlreadyActiveHelper.write (out, $ex);
105          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
106            out = $rh.createExceptionReply ();
107            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
108          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
109            out = $rh.createExceptionReply ();
110            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
111          }
112          break;
113        }
114
115
116   // If the server is running, shut it down
117
case 4: // activation/Activator/shutdown
118
{
119          try {
120            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
121            this.shutdown (serverId);
122            out = $rh.createReply();
123          } catch (com.sun.corba.se.spi.activation.ServerNotActive $ex) {
124            out = $rh.createExceptionReply ();
125            com.sun.corba.se.spi.activation.ServerNotActiveHelper.write (out, $ex);
126          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
127            out = $rh.createExceptionReply ();
128            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
129          }
130          break;
131        }
132
133
134   // currently running, this method will activate it.
135
case 5: // activation/Activator/install
136
{
137          try {
138            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
139            this.install (serverId);
140            out = $rh.createReply();
141          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
142            out = $rh.createExceptionReply ();
143            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
144          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
145            out = $rh.createExceptionReply ();
146            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
147          } catch (com.sun.corba.se.spi.activation.ServerAlreadyInstalled $ex) {
148            out = $rh.createExceptionReply ();
149            com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.write (out, $ex);
150          }
151          break;
152        }
153
154
155   // list all registered ORBs for a server
156
case 6: // activation/Activator/getORBNames
157
{
158          try {
159            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
160            String JavaDoc $result[] = null;
161            $result = this.getORBNames (serverId);
162            out = $rh.createReply();
163            com.sun.corba.se.spi.activation.ORBidListHelper.write (out, $result);
164          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
165            out = $rh.createExceptionReply ();
166            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
167          }
168          break;
169        }
170
171
172   // After this hook completes, the server may still be running.
173
case 7: // activation/Activator/uninstall
174
{
175          try {
176            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
177            this.uninstall (serverId);
178            out = $rh.createReply();
179          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
180            out = $rh.createExceptionReply ();
181            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
182          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
183            out = $rh.createExceptionReply ();
184            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
185          } catch (com.sun.corba.se.spi.activation.ServerAlreadyUninstalled $ex) {
186            out = $rh.createExceptionReply ();
187            com.sun.corba.se.spi.activation.ServerAlreadyUninstalledHelper.write (out, $ex);
188          }
189          break;
190        }
191
192        default:
193          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
194     }
195
196     return out;
197   } // _invoke
198

199   // Type-specific CORBA::Object operations
200
private static String JavaDoc[] __ids = {
201     "IDL:activation/Activator:1.0"};
202
203   public String JavaDoc[] _ids ()
204   {
205     return (String JavaDoc[])__ids.clone ();
206   }
207
208
209 } // class _ActivatorImplBase
210
Popular Tags