KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.spi.activation;
2
3
4 /**
5 * com/sun/corba/se/spi/activation/_RepositoryStub.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 _RepositoryStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements com.sun.corba.se.spi.activation.Repository
12 {
13
14
15   // always uninstalled.
16
public int registerServer (com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef serverDef) throws com.sun.corba.se.spi.activation.ServerAlreadyRegistered, com.sun.corba.se.spi.activation.BadServerDefinition
17   {
18             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
19             try {
20                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("registerServer", true);
21                 com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.write ($out, serverDef);
22                 $in = _invoke ($out);
23                 int $result = com.sun.corba.se.spi.activation.ServerIdHelper.read ($in);
24                 return $result;
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/ServerAlreadyRegistered:1.0"))
29                     throw com.sun.corba.se.spi.activation.ServerAlreadyRegisteredHelper.read ($in);
30                 else if (_id.equals ("IDL:activation/BadServerDefinition:1.0"))
31                     throw com.sun.corba.se.spi.activation.BadServerDefinitionHelper.read ($in);
32                 else
33                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
34             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
35                 return registerServer (serverDef );
36             } finally {
37                 _releaseReply ($in);
38             }
39   } // registerServer
40

41
42   // unregister server definition
43
public void unregisterServer (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered
44   {
45             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
46             try {
47                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("unregisterServer", true);
48                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
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
57                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
58             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
59                 unregisterServer (serverId );
60             } finally {
61                 _releaseReply ($in);
62             }
63   } // unregisterServer
64

65
66   // get server definition
67
public com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef getServer (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered
68   {
69             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
70             try {
71                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getServer", true);
72                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
73                 $in = _invoke ($out);
74                 com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef $result = com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.read ($in);
75                 return $result;
76             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
77                 $in = $ex.getInputStream ();
78                 String JavaDoc _id = $ex.getId ();
79                 if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
80                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
81                 else
82                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
83             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
84                 return getServer (serverId );
85             } finally {
86                 _releaseReply ($in);
87             }
88   } // getServer
89

90
91   // Return whether the server has been installed
92
public boolean isInstalled (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered
93   {
94             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
95             try {
96                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("isInstalled", true);
97                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
98                 $in = _invoke ($out);
99                 boolean $result = $in.read_boolean ();
100                 return $result;
101             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
102                 $in = $ex.getInputStream ();
103                 String JavaDoc _id = $ex.getId ();
104                 if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
105                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
106                 else
107                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
108             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
109                 return isInstalled (serverId );
110             } finally {
111                 _releaseReply ($in);
112             }
113   } // isInstalled
114

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

141
142   // if the server is currently marked as uninstalled.
143
public void uninstall (int serverId) throws com.sun.corba.se.spi.activation.ServerNotRegistered, com.sun.corba.se.spi.activation.ServerAlreadyUninstalled
144   {
145             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
146             try {
147                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("uninstall", true);
148                 com.sun.corba.se.spi.activation.ServerIdHelper.write ($out, serverId);
149                 $in = _invoke ($out);
150                 return;
151             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
152                 $in = $ex.getInputStream ();
153                 String JavaDoc _id = $ex.getId ();
154                 if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
155                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
156                 else if (_id.equals ("IDL:activation/ServerAlreadyUninstalled:1.0"))
157                     throw com.sun.corba.se.spi.activation.ServerAlreadyUninstalledHelper.read ($in);
158                 else
159                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
160             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
161                 uninstall (serverId );
162             } finally {
163                 _releaseReply ($in);
164             }
165   } // uninstall
166

167
168   // list registered servers
169
public int[] listRegisteredServers ()
170   {
171             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
172             try {
173                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("listRegisteredServers", true);
174                 $in = _invoke ($out);
175                 int $result[] = com.sun.corba.se.spi.activation.ServerIdsHelper.read ($in);
176                 return $result;
177             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
178                 $in = $ex.getInputStream ();
179                 String JavaDoc _id = $ex.getId ();
180                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
181             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
182                 return listRegisteredServers ( );
183             } finally {
184                 _releaseReply ($in);
185             }
186   } // listRegisteredServers
187

188
189   // servers.
190
public String JavaDoc[] getApplicationNames ()
191   {
192             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
193             try {
194                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getApplicationNames", true);
195                 $in = _invoke ($out);
196                 String JavaDoc $result[] = com.sun.corba.se.spi.activation.RepositoryPackage.StringSeqHelper.read ($in);
197                 return $result;
198             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
199                 $in = $ex.getInputStream ();
200                 String JavaDoc _id = $ex.getId ();
201                 throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
202             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
203                 return getApplicationNames ( );
204             } finally {
205                 _releaseReply ($in);
206             }
207   } // getApplicationNames
208

209
210   // Find the ServerID associated with the given application name.
211
public int getServerID (String JavaDoc applicationName) throws com.sun.corba.se.spi.activation.ServerNotRegistered
212   {
213             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
214             try {
215                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getServerID", true);
216                 $out.write_string (applicationName);
217                 $in = _invoke ($out);
218                 int $result = com.sun.corba.se.spi.activation.ServerIdHelper.read ($in);
219                 return $result;
220             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
221                 $in = $ex.getInputStream ();
222                 String JavaDoc _id = $ex.getId ();
223                 if (_id.equals ("IDL:activation/ServerNotRegistered:1.0"))
224                     throw com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.read ($in);
225                 else
226                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
227             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
228                 return getServerID (applicationName );
229             } finally {
230                 _releaseReply ($in);
231             }
232   } // getServerID
233

234   // Type-specific CORBA::Object operations
235
private static String JavaDoc[] __ids = {
236     "IDL:activation/Repository:1.0"};
237
238   public String JavaDoc[] _ids ()
239   {
240     return (String JavaDoc[])__ids.clone ();
241   }
242
243   private void readObject (java.io.ObjectInputStream JavaDoc s) throws java.io.IOException JavaDoc
244   {
245      String JavaDoc str = s.readUTF ();
246      String JavaDoc[] args = null;
247      java.util.Properties JavaDoc props = null;
248      org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
249      org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
250      _set_delegate (delegate);
251   }
252
253   private void writeObject (java.io.ObjectOutputStream JavaDoc s) throws java.io.IOException JavaDoc
254   {
255      String JavaDoc[] args = null;
256      java.util.Properties JavaDoc props = null;
257      String JavaDoc str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
258      s.writeUTF (str);
259   }
260 } // class _RepositoryStub
261
Popular Tags