KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.PortableActivationIDL;
2
3
4 /**
5 * com/sun/corba/se/PortableActivationIDL/_ActivatorStub.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 class _ActivatorStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements com.sun.corba.se.PortableActivationIDL.Activator
12 {
13
14
15   /** A new ORB started server registers itself with the Activator
16     */

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

40
41   /** A server is shutting down that was started by this activator.
42     * Complete termination of the server is detected by the death of the
43     * process implementing the server.
44     */

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

64
65   /** Called whenever an ORB instance is created. This registers
66     * the transport endpoints and the ORB proxy callback object.
67     * Note that we cannot detect when an ORB shuts down, although
68     * all of the POA shutdowns should still be reported.
69     */

70   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
71   {
72             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
73             try {
74                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("registerORB", true);
75                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
76                 org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
77                 com.sun.corba.se.PortableActivationIDL.ORBProxyHelper.write ($out, orb);
78                 com.sun.corba.se.PortableActivationIDL.EndpointInfoListHelper.write ($out, endPointInfo);
79                 $in = _invoke ($out);
80                 return;
81             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
82                 $in = $ex.getInputStream ();
83                 String JavaDoc _id = $ex.getId ();
84                 if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
85                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
86                 else if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
87                     throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
88                 else if (_id.equals ("IDL:PortableActivationIDL/ORBAlreadyRegistered:1.0"))
89                     throw com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegisteredHelper.read ($in);
90                 else
91                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
92             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
93                 registerORB (serverId, orbId, orb, endPointInfo );
94             } finally {
95                 _releaseReply ($in);
96             }
97   } // registerORB
98

99
100   /** Construct or find an ORBD object template corresponding to the
101     * server's object template and return it. Called whenever a
102     * persistent POA is created.
103     */

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

126
127   /** Called whenever a POA is destroyed.
128     */

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

150
151   /** If the server is not running, start it up. This is allowed
152     * whether or not the server has been installed.
153     */

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

180
181   /** If the server is running, shut it down
182     */

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

207
208   /** Invoke the server install hook. If the server is not
209     * currently running, this method will activate it.
210     */

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

237
238   /** Invoke the server uninstall hook. If the server is not
239     * currently running, this method will activate it.
240     * After this hook completes, the server may still be running.
241     */

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

268
269   /** list active servers
270     */

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

290
291   /** list all registered ORBs for a server
292     */

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

316
317   /** Find the server template that corresponds to the ORBD's
318     * adapter id.
319     */

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

342   // Type-specific CORBA::Object operations
343
private static String JavaDoc[] __ids = {
344     "IDL:PortableActivationIDL/Activator:1.0"};
345
346   public String JavaDoc[] _ids ()
347   {
348     return (String JavaDoc[])__ids.clone ();
349   }
350
351   private void readObject (java.io.ObjectInputStream JavaDoc s) throws java.io.IOException JavaDoc
352   {
353      String JavaDoc str = s.readUTF ();
354      String JavaDoc[] args = null;
355      java.util.Properties JavaDoc props = null;
356      org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
357      org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
358      _set_delegate (delegate);
359   }
360
361   private void writeObject (java.io.ObjectOutputStream JavaDoc s) throws java.io.IOException JavaDoc
362   {
363      String JavaDoc[] args = null;
364      java.util.Properties JavaDoc props = null;
365      String JavaDoc str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
366      s.writeUTF (str);
367   }
368 } // class _ActivatorStub
369
Popular Tags