KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.PortableActivationIDL;
2
3
4 /**
5 * com/sun/corba/se/PortableActivationIDL/_RepositoryImplBase.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 abstract class _RepositoryImplBase extends org.omg.CORBA.portable.ObjectImpl JavaDoc
12                 implements com.sun.corba.se.PortableActivationIDL.Repository, org.omg.CORBA.portable.InvokeHandler JavaDoc
13 {
14
15   // Constructors
16
public _RepositoryImplBase ()
17   {
18   }
19
20   private static java.util.Hashtable JavaDoc _methods = new java.util.Hashtable JavaDoc ();
21   static
22   {
23     _methods.put ("registerServer", new java.lang.Integer JavaDoc (0));
24     _methods.put ("unregisterServer", new java.lang.Integer JavaDoc (1));
25     _methods.put ("getServer", new java.lang.Integer JavaDoc (2));
26     _methods.put ("isInstalled", new java.lang.Integer JavaDoc (3));
27     _methods.put ("install", new java.lang.Integer JavaDoc (4));
28     _methods.put ("uninstall", new java.lang.Integer JavaDoc (5));
29     _methods.put ("listRegisteredServers", new java.lang.Integer JavaDoc (6));
30     _methods.put ("getApplicationNames", new java.lang.Integer JavaDoc (7));
31     _methods.put ("getServerID", new java.lang.Integer JavaDoc (8));
32   }
33
34   public org.omg.CORBA.portable.OutputStream JavaDoc _invoke (String JavaDoc $method,
35                                 org.omg.CORBA.portable.InputStream JavaDoc in,
36                                 org.omg.CORBA.portable.ResponseHandler JavaDoc $rh)
37   {
38     org.omg.CORBA.portable.OutputStream JavaDoc out = null;
39     java.lang.Integer JavaDoc __method = (java.lang.Integer JavaDoc)_methods.get ($method);
40     if (__method == null)
41       throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
42
43     switch (__method.intValue ())
44     {
45
46   /** register server definition.
47     * This returns the serverId of the server. A newly created server is
48     * always uninstalled.
49     */

50        case 0: // PortableActivationIDL/Repository/registerServer
51
{
52          try {
53            com.sun.corba.se.PortableActivationIDL.RepositoryPackage.ServerDef serverDef = com.sun.corba.se.PortableActivationIDL.RepositoryPackage.ServerDefHelper.read (in);
54            String JavaDoc $result = null;
55            $result = this.registerServer (serverDef);
56            out = $rh.createReply();
57            out.write_string ($result);
58          } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyRegistered $ex) {
59            out = $rh.createExceptionReply ();
60            com.sun.corba.se.PortableActivationIDL.ServerAlreadyRegisteredHelper.write (out, $ex);
61          } catch (com.sun.corba.se.PortableActivationIDL.BadServerDefinition $ex) {
62            out = $rh.createExceptionReply ();
63            com.sun.corba.se.PortableActivationIDL.BadServerDefinitionHelper.write (out, $ex);
64          }
65          break;
66        }
67
68
69   /** unregister server definition
70     */

71        case 1: // PortableActivationIDL/Repository/unregisterServer
72
{
73          try {
74            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
75            this.unregisterServer (serverId);
76            out = $rh.createReply();
77          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
78            out = $rh.createExceptionReply ();
79            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
80          }
81          break;
82        }
83
84
85   /** get server definition
86     */

87        case 2: // PortableActivationIDL/Repository/getServer
88
{
89          try {
90            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
91            com.sun.corba.se.PortableActivationIDL.RepositoryPackage.ServerDef $result = null;
92            $result = this.getServer (serverId);
93            out = $rh.createReply();
94            com.sun.corba.se.PortableActivationIDL.RepositoryPackage.ServerDefHelper.write (out, $result);
95          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
96            out = $rh.createExceptionReply ();
97            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
98          }
99          break;
100        }
101
102
103   /** Return whether the server has been installed
104     */

105        case 3: // PortableActivationIDL/Repository/isInstalled
106
{
107          try {
108            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
109            boolean $result = false;
110            $result = this.isInstalled (serverId);
111            out = $rh.createReply();
112            out.write_boolean ($result);
113          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
114            out = $rh.createExceptionReply ();
115            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
116          }
117          break;
118        }
119
120
121   /** Mark the server as being installed. Raises ServerAlreadyInstalled
122     * if the server is currently marked as installed.
123     */

124        case 4: // PortableActivationIDL/Repository/install
125
{
126          try {
127            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
128            this.install (serverId);
129            out = $rh.createReply();
130          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
131            out = $rh.createExceptionReply ();
132            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
133          } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalled $ex) {
134            out = $rh.createExceptionReply ();
135            com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalledHelper.write (out, $ex);
136          }
137          break;
138        }
139
140
141   /** Mark the server as being uninstalled. Raises ServerAlreadyUninstalled
142     * if the server is currently marked as uninstalled.
143     */

144        case 5: // PortableActivationIDL/Repository/uninstall
145
{
146          try {
147            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
148            this.uninstall (serverId);
149            out = $rh.createReply();
150          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
151            out = $rh.createExceptionReply ();
152            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
153          } catch (com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalled $ex) {
154            out = $rh.createExceptionReply ();
155            com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalledHelper.write (out, $ex);
156          }
157          break;
158        }
159
160
161   /** list registered servers
162     */

163        case 6: // PortableActivationIDL/Repository/listRegisteredServers
164
{
165          String JavaDoc $result[] = null;
166          $result = this.listRegisteredServers ();
167          out = $rh.createReply();
168          com.sun.corba.se.PortableActivationIDL.ServerIdsHelper.write (out, $result);
169          break;
170        }
171
172
173   /** Returns list of ALL applicationNames defined in ServerDefs of registered
174     * servers.
175     */

176        case 7: // PortableActivationIDL/Repository/getApplicationNames
177
{
178          String JavaDoc $result[] = null;
179          $result = this.getApplicationNames ();
180          out = $rh.createReply();
181          com.sun.corba.se.PortableActivationIDL.RepositoryPackage.AppNamesHelper.write (out, $result);
182          break;
183        }
184
185
186   /** Find the ServerID associated with the given application name.
187     */

188        case 8: // PortableActivationIDL/Repository/getServerID
189
{
190          try {
191            String JavaDoc applicationName = in.read_string ();
192            String JavaDoc $result = null;
193            $result = this.getServerID (applicationName);
194            out = $rh.createReply();
195            out.write_string ($result);
196          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
197            out = $rh.createExceptionReply ();
198            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
199          }
200          break;
201        }
202
203        default:
204          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
205     }
206
207     return out;
208   } // _invoke
209

210   // Type-specific CORBA::Object operations
211
private static String JavaDoc[] __ids = {
212     "IDL:PortableActivationIDL/Repository:1.0"};
213
214   public String JavaDoc[] _ids ()
215   {
216     return (String JavaDoc[])__ids.clone ();
217   }
218
219
220 } // class _RepositoryImplBase
221
Popular Tags