KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.spi.activation;
2
3
4 /**
5 * com/sun/corba/se/spi/activation/_ActivatorStub.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 class _ActivatorStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements com.sun.corba.se.spi.activation.Activator
12 {
13
14
15   // A new ORB started server registers itself with the Activator
16
public void active (int serverId, com.sun.corba.se.spi.activation.Server serverObj) throws com.sun.corba.se.spi.activation.ServerNotRegistered
17   {
18             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
19             try {
20                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("active", true);
21                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
22                 com.sun.corba.se.spi.activation.ServerHelper.write ($out, serverObj);
23                 $in = _invoke ($out);
24                 return;
25             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
26                 $in = $ex.getInputStream ();
27                 String JavaDoc _id = $ex.getId ();
28                 if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
29                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
30                 else
31                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
32             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
33                 active (serverId, serverObj );
34             } finally {
35                 _releaseReply ($in);
36             }
37   } // active
38

39
40   // Install a particular kind of endpoint
41
public void registerEndpoints (int serverId, String JavaDoc orbId, com.sun.corba.se.spi.activation.EndPointInfo[] endPointInfo) throws com.sun.corba.se.spi.activation.ServerNotRegistered, com.sun.corba.se.spi.activation.NoSuchEndPoint, com.sun.corba.se.spi.activation.ORBAlreadyRegistered
42   {
43             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
44             try {
45                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("registerEndpoints", true);
46                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
47                 com.sun.corba.se.spi.activation.ORBidHelper.write ($out, orbId);
48                 com.sun.corba.se.spi.activation.EndpointInfoListHelper.write ($out, endPointInfo);
49                 $in = _invoke ($out);
50                 return;
51             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
52                 $in = $ex.getInputStream ();
53                 String JavaDoc _id = $ex.getId ();
54                 if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
55                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
56                 else if (_id.equals ("IDL:activation/NoSuchEndPoint:1.0"))
57                     throw com.sun.corba.se.spi.activation.NoSuchEndPointHelper.read ($in);
58                 else if (_id.equals ("IDL:activation/ORBAlreadyRegistered:1.0"))
59                     throw com.sun.corba.se.spi.activation.ORBAlreadyRegisteredHelper.read ($in);
60                 else
61                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
62             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
63                 registerEndpoints (serverId, orbId, endPointInfo );
64             } finally {
65                 _releaseReply ($in);
66             }
67   } // registerEndpoints
68

69
70   // list active servers
71
public int[] getActiveServers ()
72   {
73             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
74             try {
75                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getActiveServers", true);
76                 $in = _invoke ($out);
77                 int $result[] = com.sun.corba.se.spi.activation.ServerIdsHelper.read ($in);
78                 return $result;
79             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
80                 $in = $ex.getInputStream ();
81                 String JavaDoc _id = $ex.getId ();
82                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
83             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
84                 return getActiveServers ( );
85             } finally {
86                 _releaseReply ($in);
87             }
88   } // getActiveServers
89

90
91   // If the server is not running, start it up.
92
public void activate (int serverId) throws com.sun.corba.se.spi.activation.ServerAlreadyActive, com.sun.corba.se.spi.activation.ServerNotRegistered, com.sun.corba.se.spi.activation.ServerHeldDown
93   {
94             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
95             try {
96                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("activate", true);
97                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
98                 $in = _invoke ($out);
99                 return;
100             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
101                 $in = $ex.getInputStream ();
102                 String JavaDoc _id = $ex.getId ();
103                 if (_id.equals ("IDL:activation/ServerAlreadyActive:1.0"))
104                     throw com.sun.corba.se.spi.activation.ServerAlreadyActiveHelper.read ($in);
105                 else if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
106                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
107                 else if (_id.equals ("IDL:activation/ServerHeldDown:1.0"))
108                     throw com.sun.corba.se.spi.activation.ServerHeldDownHelper.read ($in);
109                 else
110                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
111             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
112                 activate (serverId );
113             } finally {
114                 _releaseReply ($in);
115             }
116   } // activate
117

118
119   // If the server is running, shut it down
120
public void shutdown (int serverId) throws com.sun.corba.se.spi.activation.ServerNotActive, com.sun.corba.se.spi.activation.ServerNotRegistered
121   {
122             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
123             try {
124                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("shutdown", true);
125                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
126                 $in = _invoke ($out);
127                 return;
128             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
129                 $in = $ex.getInputStream ();
130                 String JavaDoc _id = $ex.getId ();
131                 if (_id.equals ("IDL:activation/ServerNotActive:1.0"))
132                     throw com.sun.corba.se.spi.activation.ServerNotActiveHelper.read ($in);
133                 else if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
134                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
135                 else
136                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
137             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
138                 shutdown (serverId );
139             } finally {
140                 _releaseReply ($in);
141             }
142   } // shutdown
143

144
145   // currently running, this method will activate it.
146
public void install (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered, com.sun.corba.se.spi.activation.ServerHeldDown, com.sun.corba.se.spi.activation.ServerAlreadyInstalled
147   {
148             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
149             try {
150                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("install", true);
151                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
152                 $in = _invoke ($out);
153                 return;
154             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
155                 $in = $ex.getInputStream ();
156                 String JavaDoc _id = $ex.getId ();
157                 if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
158                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
159                 else if (_id.equals ("IDL:activation/ServerHeldDown:1.0"))
160                     throw com.sun.corba.se.spi.activation.ServerHeldDownHelper.read ($in);
161                 else if (_id.equals ("IDL:activation/ServerAlreadyInstalled:1.0"))
162                     throw com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.read ($in);
163                 else
164                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
165             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
166                 install (serverId );
167             } finally {
168                 _releaseReply ($in);
169             }
170   } // install
171

172
173   // list all registered ORBs for a server
174
public String JavaDoc[] getORBNames (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered
175   {
176             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
177             try {
178                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getORBNames", true);
179                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
180                 $in = _invoke ($out);
181                 String JavaDoc $result[] = com.sun.corba.se.spi.activation.ORBidListHelper.read ($in);
182                 return $result;
183             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
184                 $in = $ex.getInputStream ();
185                 String JavaDoc _id = $ex.getId ();
186                 if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
187                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
188                 else
189                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
190             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
191                 return getORBNames (serverId );
192             } finally {
193                 _releaseReply ($in);
194             }
195   } // getORBNames
196

197
198   // After this hook completes, the server may still be running.
199
public void uninstall (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered, com.sun.corba.se.spi.activation.ServerHeldDown, com.sun.corba.se.spi.activation.ServerAlreadyUninstalled
200   {
201             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
202             try {
203                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("uninstall", true);
204                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
205                 $in = _invoke ($out);
206                 return;
207             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
208                 $in = $ex.getInputStream ();
209                 String JavaDoc _id = $ex.getId ();
210                 if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
211                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
212                 else if (_id.equals ("IDL:activation/ServerHeldDown:1.0"))
213                     throw com.sun.corba.se.spi.activation.ServerHeldDownHelper.read ($in);
214                 else if (_id.equals ("IDL:activation/ServerAlreadyUninstalled:1.0"))
215                     throw com.sun.corba.se.spi.activation.ServerAlreadyUninstalledHelper.read ($in);
216                 else
217                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
218             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
219                 uninstall (serverId );
220             } finally {
221                 _releaseReply ($in);
222             }
223   } // uninstall
224

225   // Type-specific CORBA::Object operations
226
private static String JavaDoc[] __ids = {
227     "IDL:activation/Activator:1.0"};
228
229   public String JavaDoc[] _ids ()
230   {
231     return (String JavaDoc[])__ids.clone ();
232   }
233
234   private void readObject (java.io.ObjectInputStream JavaDoc s) throws java.io.IOException JavaDoc
235   {
236      String JavaDoc str = s.readUTF ();
237      String JavaDoc[] args = null;
238      java.util.Properties JavaDoc props = null;
239      org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
240      org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
241      _set_delegate (delegate);
242   }
243
244   private void writeObject (java.io.ObjectOutputStream JavaDoc s) throws java.io.IOException JavaDoc
245   {
246      String JavaDoc[] args = null;
247      java.util.Properties JavaDoc props = null;
248      String JavaDoc str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
249      s.writeUTF (str);
250   }
251 } // class _ActivatorStub
252
Popular Tags