KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.PortableActivationIDL;
2
3
4 /**
5 * com/sun/corba/se/PortableActivationIDL/_ServerManagerStub.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
12 /** Interface used to combine the Activator and Locator when both are
13     * implemented together in the same process, as is currently the case
14     * for our implementation.
15     */

16 public class _ServerManagerStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements com.sun.corba.se.PortableActivationIDL.ServerManager
17 {
18
19
20   /** A new ORB started server registers itself with the Activator
21     */

22   public void registerServer (String JavaDoc serverId, com.sun.corba.se.PortableActivationIDL.ServerProxy serverObj) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered
23   {
24             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
25             try {
26                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("registerServer", true);
27                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
28                 com.sun.corba.se.PortableActivationIDL.ServerProxyHelper.write ($out, serverObj);
29                 $in = _invoke ($out);
30                 return;
31             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
32                 $in = $ex.getInputStream ();
33                 String JavaDoc _id = $ex.getId ();
34                 if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
35                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
36                 else
37                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
38             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
39                 registerServer (serverId, serverObj );
40             } finally {
41                 _releaseReply ($in);
42             }
43   } // registerServer
44

45
46   /** A server is shutting down that was started by this activator.
47     * Complete termination of the server is detected by the death of the
48     * process implementing the server.
49     */

50   public void serverGoingDown (String JavaDoc serverId)
51   {
52             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
53             try {
54                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("serverGoingDown", true);
55                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
56                 $in = _invoke ($out);
57                 return;
58             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
59                 $in = $ex.getInputStream ();
60                 String JavaDoc _id = $ex.getId ();
61                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
62             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
63                 serverGoingDown (serverId );
64             } finally {
65                 _releaseReply ($in);
66             }
67   } // serverGoingDown
68

69
70   /** Called whenever an ORB instance is created. This registers
71     * the transport endpoints and the ORB proxy callback object.
72     * Note that we cannot detect when an ORB shuts down, although
73     * all of the POA shutdowns should still be reported.
74     */

75   public void registerORB (String JavaDoc serverId, String JavaDoc orbId, com.sun.corba.se.PortableActivationIDL.ORBProxy orb, com.sun.corba.se.PortableActivationIDL.EndPointInfo[] endPointInfo) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint, com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegistered
76   {
77             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
78             try {
79                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("registerORB", true);
80                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
81                 org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
82                 com.sun.corba.se.PortableActivationIDL.ORBProxyHelper.write ($out, orb);
83                 com.sun.corba.se.PortableActivationIDL.EndpointInfoListHelper.write ($out, endPointInfo);
84                 $in = _invoke ($out);
85                 return;
86             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
87                 $in = $ex.getInputStream ();
88                 String JavaDoc _id = $ex.getId ();
89                 if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
90                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
91                 else if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
92                     throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
93                 else if (_id.equals ("IDL:PortableActivationIDL/ORBAlreadyRegistered:1.0"))
94                     throw com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegisteredHelper.read ($in);
95                 else
96                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
97             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
98                 registerORB (serverId, orbId, orb, endPointInfo );
99             } finally {
100                 _releaseReply ($in);
101             }
102   } // registerORB
103

104
105   /** Construct or find an ORBD object template corresponding to the
106     * server's object template and return it. Called whenever a
107     * persistent POA is created.
108     */

109   public org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc registerPOA (String JavaDoc serverId, String JavaDoc orbId, org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc poaTemplate)
110   {
111             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
112             try {
113                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("registerPOA", true);
114                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
115                 org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
116                 org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write ($out, poaTemplate);
117                 $in = _invoke ($out);
118                 org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc $result = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read ($in);
119                 return $result;
120             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
121                 $in = $ex.getInputStream ();
122                 String JavaDoc _id = $ex.getId ();
123                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
124             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
125                 return registerPOA (serverId, orbId, poaTemplate );
126             } finally {
127                 _releaseReply ($in);
128             }
129   } // registerPOA
130

131
132   /** Called whenever a POA is destroyed.
133     */

134   public void poaDestroyed (String JavaDoc serverId, String JavaDoc orbId, org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc poaTemplate)
135   {
136             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
137             try {
138                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("poaDestroyed", true);
139                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
140                 org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
141                 org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write ($out, poaTemplate);
142                 $in = _invoke ($out);
143                 return;
144             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
145                 $in = $ex.getInputStream ();
146                 String JavaDoc _id = $ex.getId ();
147                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
148             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
149                 poaDestroyed (serverId, orbId, poaTemplate );
150             } finally {
151                 _releaseReply ($in);
152             }
153   } // poaDestroyed
154

155
156   /** If the server is not running, start it up. This is allowed
157     * whether or not the server has been installed.
158     */

159   public void activate (String JavaDoc serverId) throws com.sun.corba.se.PortableActivationIDL.ServerAlreadyActive, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown
160   {
161             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
162             try {
163                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("activate", true);
164                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
165                 $in = _invoke ($out);
166                 return;
167             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
168                 $in = $ex.getInputStream ();
169                 String JavaDoc _id = $ex.getId ();
170                 if (_id.equals ("IDL:PortableActivationIDL/ServerAlreadyActive:1.0"))
171                     throw com.sun.corba.se.PortableActivationIDL.ServerAlreadyActiveHelper.read ($in);
172                 else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
173                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
174                 else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
175                     throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
176                 else
177                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
178             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
179                 activate (serverId );
180             } finally {
181                 _releaseReply ($in);
182             }
183   } // activate
184

185
186   /** If the server is running, shut it down
187     */

188   public void shutdown (String JavaDoc serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotActive, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered
189   {
190             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
191             try {
192                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("shutdown", true);
193                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
194                 $in = _invoke ($out);
195                 return;
196             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
197                 $in = $ex.getInputStream ();
198                 String JavaDoc _id = $ex.getId ();
199                 if (_id.equals ("IDL:PortableActivationIDL/ServerNotActive:1.0"))
200                     throw com.sun.corba.se.PortableActivationIDL.ServerNotActiveHelper.read ($in);
201                 else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
202                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
203                 else
204                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
205             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
206                 shutdown (serverId );
207             } finally {
208                 _releaseReply ($in);
209             }
210   } // shutdown
211

212
213   /** Invoke the server install hook. If the server is not
214     * currently running, this method will activate it.
215     */

216   public void install (String JavaDoc serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown, com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalled
217   {
218             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
219             try {
220                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("install", true);
221                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
222                 $in = _invoke ($out);
223                 return;
224             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
225                 $in = $ex.getInputStream ();
226                 String JavaDoc _id = $ex.getId ();
227                 if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
228                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
229                 else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
230                     throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
231                 else if (_id.equals ("IDL:PortableActivationIDL/ServerAlreadyInstalled:1.0"))
232                     throw com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalledHelper.read ($in);
233                 else
234                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
235             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
236                 install (serverId );
237             } finally {
238                 _releaseReply ($in);
239             }
240   } // install
241

242
243   /** Invoke the server uninstall hook. If the server is not
244     * currently running, this method will activate it.
245     * After this hook completes, the server may still be running.
246     */

247   public void uninstall (String JavaDoc serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown, com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalled
248   {
249             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
250             try {
251                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("uninstall", true);
252                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
253                 $in = _invoke ($out);
254                 return;
255             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
256                 $in = $ex.getInputStream ();
257                 String JavaDoc _id = $ex.getId ();
258                 if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
259                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
260                 else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
261                     throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
262                 else if (_id.equals ("IDL:PortableActivationIDL/ServerAlreadyUninstalled:1.0"))
263                     throw com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalledHelper.read ($in);
264                 else
265                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
266             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
267                 uninstall (serverId );
268             } finally {
269                 _releaseReply ($in);
270             }
271   } // uninstall
272

273
274   /** list active servers
275     */

276   public String JavaDoc[] getActiveServers ()
277   {
278             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
279             try {
280                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getActiveServers", true);
281                 $in = _invoke ($out);
282                 String JavaDoc $result[] = com.sun.corba.se.PortableActivationIDL.ServerIdsHelper.read ($in);
283                 return $result;
284             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
285                 $in = $ex.getInputStream ();
286                 String JavaDoc _id = $ex.getId ();
287                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
288             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
289                 return getActiveServers ( );
290             } finally {
291                 _releaseReply ($in);
292             }
293   } // getActiveServers
294

295
296   /** list all registered ORBs for a server
297     */

298   public String JavaDoc[] getORBNames (String JavaDoc serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered
299   {
300             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
301             try {
302                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getORBNames", true);
303                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
304                 $in = _invoke ($out);
305                 String JavaDoc $result[] = com.sun.corba.se.PortableActivationIDL.ORBidListHelper.read ($in);
306                 return $result;
307             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
308                 $in = $ex.getInputStream ();
309                 String JavaDoc _id = $ex.getId ();
310                 if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
311                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
312                 else
313                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
314             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
315                 return getORBNames (serverId );
316             } finally {
317                 _releaseReply ($in);
318             }
319   } // getORBNames
320

321
322   /** Find the server template that corresponds to the ORBD's
323     * adapter id.
324     */

325   public org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc lookupPOATemplate (String JavaDoc serverId, String JavaDoc orbId, String JavaDoc[] orbAdapterName)
326   {
327             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
328             try {
329                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("lookupPOATemplate", true);
330                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
331                 org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
332                 org.omg.PortableInterceptor.AdapterNameHelper.write ($out, orbAdapterName);
333                 $in = _invoke ($out);
334                 org.omg.PortableInterceptor.ObjectReferenceTemplate JavaDoc $result = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read ($in);
335                 return $result;
336             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
337                 $in = $ex.getInputStream ();
338                 String JavaDoc _id = $ex.getId ();
339                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
340             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
341                 return lookupPOATemplate (serverId, orbId, orbAdapterName );
342             } finally {
343                 _releaseReply ($in);
344             }
345   } // lookupPOATemplate
346

347
348   /** locate server - returns the port with a specific type for all registered
349     * ORBs of an active server.
350     * Starts the server if it is not already running.
351     */

352   public com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType locateServer (String JavaDoc serverId, String JavaDoc endPoint) throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown
353   {
354             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
355             try {
356                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("locateServer", true);
357                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
358                 $out.write_string (endPoint);
359                 $in = _invoke ($out);
360                 com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType $result = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerTypeHelper.read ($in);
361                 return $result;
362             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
363                 $in = $ex.getInputStream ();
364                 String JavaDoc _id = $ex.getId ();
365                 if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
366                     throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
367                 else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
368                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
369                 else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
370                     throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
371                 else
372                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
373             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
374                 return locateServer (serverId, endPoint );
375             } finally {
376                 _releaseReply ($in);
377             }
378   } // locateServer
379

380
381   /** locate server - returns all ports registered with a specified ORB for
382     * an active server
383     * Starts the server if it is not already running.
384     */

385   public com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB locateServerForORB (String JavaDoc serverId, String JavaDoc orbId) throws com.sun.corba.se.PortableActivationIDL.InvalidORBid, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown
386   {
387             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
388             try {
389                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("locateServerForORB", true);
390                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
391                 org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
392                 $in = _invoke ($out);
393                 com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB $result = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read ($in);
394                 return $result;
395             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
396                 $in = $ex.getInputStream ();
397                 String JavaDoc _id = $ex.getId ();
398                 if (_id.equals ("IDL:PortableActivationIDL/InvalidORBid:1.0"))
399                     throw com.sun.corba.se.PortableActivationIDL.InvalidORBidHelper.read ($in);
400                 else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
401                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
402                 else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
403                     throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
404                 else
405                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
406             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
407                 return locateServerForORB (serverId, orbId );
408             } finally {
409                 _releaseReply ($in);
410             }
411   } // locateServerForORB
412

413
414   /** get the port for the endpoint of the locator
415     */

416   public int getEndpoint (String JavaDoc endPointType) throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint
417   {
418             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
419             try {
420                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getEndpoint", true);
421                 $out.write_string (endPointType);
422                 $in = _invoke ($out);
423                 int $result = com.sun.corba.se.PortableActivationIDL.TCPPortHelper.read ($in);
424                 return $result;
425             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
426                 $in = $ex.getInputStream ();
427                 String JavaDoc _id = $ex.getId ();
428                 if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
429                     throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
430                 else
431                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
432             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
433                 return getEndpoint (endPointType );
434             } finally {
435                 _releaseReply ($in);
436             }
437   } // getEndpoint
438

439
440   /** Useful from external BadServerIdHandlers which need
441     * to pick a particular port type.
442     */

443   public int getServerPortForType (com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB location, String JavaDoc endPointType) throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint
444   {
445             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
446             try {
447                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getServerPortForType", true);
448                 com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write ($out, location);
449                 $out.write_string (endPointType);
450                 $in = _invoke ($out);
451                 int $result = com.sun.corba.se.PortableActivationIDL.TCPPortHelper.read ($in);
452                 return $result;
453             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
454                 $in = $ex.getInputStream ();
455                 String JavaDoc _id = $ex.getId ();
456                 if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
457                     throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
458                 else
459                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
460             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
461                 return getServerPortForType (location, endPointType );
462             } finally {
463                 _releaseReply ($in);
464             }
465   } // getServerPortForType
466

467   // Type-specific CORBA::Object operations
468
private static String JavaDoc[] __ids = {
469     "IDL:PortableActivationIDL/ServerManager:1.0",
470     "IDL:PortableActivationIDL/Activator:1.0",
471     "IDL:PortableActivationIDL/Locator:1.0"};
472
473   public String JavaDoc[] _ids ()
474   {
475     return (String JavaDoc[])__ids.clone ();
476   }
477
478   private void readObject (java.io.ObjectInputStream JavaDoc s) throws java.io.IOException JavaDoc
479   {
480      String JavaDoc str = s.readUTF ();
481      String JavaDoc[] args = null;
482      java.util.Properties JavaDoc props = null;
483      org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
484      org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
485      _set_delegate (delegate);
486   }
487
488   private void writeObject (java.io.ObjectOutputStream JavaDoc s) throws java.io.IOException JavaDoc
489   {
490      String JavaDoc[] args = null;
491      java.util.Properties JavaDoc props = null;
492      String JavaDoc str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
493      s.writeUTF (str);
494   }
495 } // class _ServerManagerStub
496
Popular Tags