KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.spi.activation;
2
3
4 /**
5 * com/sun/corba/se/spi/activation/_ServerManagerImplBase.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 _ServerManagerImplBase extends org.omg.CORBA.portable.ObjectImpl JavaDoc
12                 implements com.sun.corba.se.spi.activation.ServerManager, org.omg.CORBA.portable.InvokeHandler JavaDoc
13 {
14
15   // Constructors
16
public _ServerManagerImplBase ()
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     _methods.put ("locateServer", new java.lang.Integer JavaDoc (8));
32     _methods.put ("locateServerForORB", new java.lang.Integer JavaDoc (9));
33     _methods.put ("getEndpoint", new java.lang.Integer JavaDoc (10));
34     _methods.put ("getServerPortForType", 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
case 0: // activation/Activator/active
51
{
52          try {
53            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
54            com.sun.corba.se.spi.activation.Server serverObj = com.sun.corba.se.spi.activation.ServerHelper.read (in);
55            this.active (serverId, serverObj);
56            out = $rh.createReply();
57          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
58            out = $rh.createExceptionReply ();
59            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
60          }
61          break;
62        }
63
64
65   // Install a particular kind of endpoint
66
case 1: // activation/Activator/registerEndpoints
67
{
68          try {
69            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
70            String JavaDoc orbId = com.sun.corba.se.spi.activation.ORBidHelper.read (in);
71            com.sun.corba.se.spi.activation.EndPointInfo endPointInfo[] = com.sun.corba.se.spi.activation.EndpointInfoListHelper.read (in);
72            this.registerEndpoints (serverId, orbId, endPointInfo);
73            out = $rh.createReply();
74          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
75            out = $rh.createExceptionReply ();
76            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
77          } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
78            out = $rh.createExceptionReply ();
79            com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
80          } catch (com.sun.corba.se.spi.activation.ORBAlreadyRegistered $ex) {
81            out = $rh.createExceptionReply ();
82            com.sun.corba.se.spi.activation.ORBAlreadyRegisteredHelper.write (out, $ex);
83          }
84          break;
85        }
86
87
88   // list active servers
89
case 2: // activation/Activator/getActiveServers
90
{
91          int $result[] = null;
92          $result = this.getActiveServers ();
93          out = $rh.createReply();
94          com.sun.corba.se.spi.activation.ServerIdsHelper.write (out, $result);
95          break;
96        }
97
98
99   // If the server is not running, start it up.
100
case 3: // activation/Activator/activate
101
{
102          try {
103            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
104            this.activate (serverId);
105            out = $rh.createReply();
106          } catch (com.sun.corba.se.spi.activation.ServerAlreadyActive $ex) {
107            out = $rh.createExceptionReply ();
108            com.sun.corba.se.spi.activation.ServerAlreadyActiveHelper.write (out, $ex);
109          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
110            out = $rh.createExceptionReply ();
111            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
112          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
113            out = $rh.createExceptionReply ();
114            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
115          }
116          break;
117        }
118
119
120   // If the server is running, shut it down
121
case 4: // activation/Activator/shutdown
122
{
123          try {
124            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
125            this.shutdown (serverId);
126            out = $rh.createReply();
127          } catch (com.sun.corba.se.spi.activation.ServerNotActive $ex) {
128            out = $rh.createExceptionReply ();
129            com.sun.corba.se.spi.activation.ServerNotActiveHelper.write (out, $ex);
130          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
131            out = $rh.createExceptionReply ();
132            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
133          }
134          break;
135        }
136
137
138   // currently running, this method will activate it.
139
case 5: // activation/Activator/install
140
{
141          try {
142            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
143            this.install (serverId);
144            out = $rh.createReply();
145          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
146            out = $rh.createExceptionReply ();
147            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
148          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
149            out = $rh.createExceptionReply ();
150            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
151          } catch (com.sun.corba.se.spi.activation.ServerAlreadyInstalled $ex) {
152            out = $rh.createExceptionReply ();
153            com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.write (out, $ex);
154          }
155          break;
156        }
157
158
159   // list all registered ORBs for a server
160
case 6: // activation/Activator/getORBNames
161
{
162          try {
163            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
164            String JavaDoc $result[] = null;
165            $result = this.getORBNames (serverId);
166            out = $rh.createReply();
167            com.sun.corba.se.spi.activation.ORBidListHelper.write (out, $result);
168          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
169            out = $rh.createExceptionReply ();
170            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
171          }
172          break;
173        }
174
175
176   // After this hook completes, the server may still be running.
177
case 7: // activation/Activator/uninstall
178
{
179          try {
180            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
181            this.uninstall (serverId);
182            out = $rh.createReply();
183          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
184            out = $rh.createExceptionReply ();
185            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
186          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
187            out = $rh.createExceptionReply ();
188            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
189          } catch (com.sun.corba.se.spi.activation.ServerAlreadyUninstalled $ex) {
190            out = $rh.createExceptionReply ();
191            com.sun.corba.se.spi.activation.ServerAlreadyUninstalledHelper.write (out, $ex);
192          }
193          break;
194        }
195
196
197   // Starts the server if it is not already running.
198
case 8: // activation/Locator/locateServer
199
{
200          try {
201            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
202            String JavaDoc endPoint = in.read_string ();
203            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocation $result = null;
204            $result = this.locateServer (serverId, endPoint);
205            out = $rh.createReply();
206            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationHelper.write (out, $result);
207          } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
208            out = $rh.createExceptionReply ();
209            com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
210          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
211            out = $rh.createExceptionReply ();
212            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
213          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
214            out = $rh.createExceptionReply ();
215            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
216          }
217          break;
218        }
219
220
221   // Starts the server if it is not already running.
222
case 9: // activation/Locator/locateServerForORB
223
{
224          try {
225            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
226            String JavaDoc orbId = com.sun.corba.se.spi.activation.ORBidHelper.read (in);
227            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORB $result = null;
228            $result = this.locateServerForORB (serverId, orbId);
229            out = $rh.createReply();
230            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORBHelper.write (out, $result);
231          } catch (com.sun.corba.se.spi.activation.InvalidORBid $ex) {
232            out = $rh.createExceptionReply ();
233            com.sun.corba.se.spi.activation.InvalidORBidHelper.write (out, $ex);
234          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
235            out = $rh.createExceptionReply ();
236            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
237          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
238            out = $rh.createExceptionReply ();
239            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
240          }
241          break;
242        }
243
244
245   // get the port for the endpoint of the locator
246
case 10: // activation/Locator/getEndpoint
247
{
248          try {
249            String JavaDoc endPointType = in.read_string ();
250            int $result = (int)0;
251            $result = this.getEndpoint (endPointType);
252            out = $rh.createReply();
253            out.write_long ($result);
254          } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
255            out = $rh.createExceptionReply ();
256            com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
257          }
258          break;
259        }
260
261
262   // to pick a particular port type.
263
case 11: // activation/Locator/getServerPortForType
264
{
265          try {
266            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORB location = com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORBHelper.read (in);
267            String JavaDoc endPointType = in.read_string ();
268            int $result = (int)0;
269            $result = this.getServerPortForType (location, endPointType);
270            out = $rh.createReply();
271            out.write_long ($result);
272          } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
273            out = $rh.createExceptionReply ();
274            com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
275          }
276          break;
277        }
278
279        default:
280          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
281     }
282
283     return out;
284   } // _invoke
285

286   // Type-specific CORBA::Object operations
287
private static String JavaDoc[] __ids = {
288     "IDL:activation/ServerManager:1.0",
289     "IDL:activation/Activator:1.0",
290     "IDL:activation/Locator:1.0"};
291
292   public String JavaDoc[] _ids ()
293   {
294     return (String JavaDoc[])__ids.clone ();
295   }
296
297
298 } // class _ServerManagerImplBase
299
Popular Tags