KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.spi.activation;
2
3
4 /**
5 * com/sun/corba/se/spi/activation/_RepositoryImplBase.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 abstract class _RepositoryImplBase extends org.omg.CORBA.portable.ObjectImpl JavaDoc
12                 implements com.sun.corba.se.spi.activation.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   // always uninstalled.
47
case 0: // activation/Repository/registerServer
48
{
49          try {
50            com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef serverDef = com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.read (in);
51            int $result = (int)0;
52            $result = this.registerServer (serverDef);
53            out = $rh.createReply();
54            out.write_long ($result);
55          } catch (com.sun.corba.se.spi.activation.ServerAlreadyRegistered $ex) {
56            out = $rh.createExceptionReply ();
57            com.sun.corba.se.spi.activation.ServerAlreadyRegisteredHelper.write (out, $ex);
58          } catch (com.sun.corba.se.spi.activation.BadServerDefinition $ex) {
59            out = $rh.createExceptionReply ();
60            com.sun.corba.se.spi.activation.BadServerDefinitionHelper.write (out, $ex);
61          }
62          break;
63        }
64
65
66   // unregister server definition
67
case 1: // activation/Repository/unregisterServer
68
{
69          try {
70            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
71            this.unregisterServer (serverId);
72            out = $rh.createReply();
73          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
74            out = $rh.createExceptionReply ();
75            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
76          }
77          break;
78        }
79
80
81   // get server definition
82
case 2: // activation/Repository/getServer
83
{
84          try {
85            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
86            com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef $result = null;
87            $result = this.getServer (serverId);
88            out = $rh.createReply();
89            com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.write (out, $result);
90          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
91            out = $rh.createExceptionReply ();
92            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
93          }
94          break;
95        }
96
97
98   // Return whether the server has been installed
99
case 3: // activation/Repository/isInstalled
100
{
101          try {
102            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
103            boolean $result = false;
104            $result = this.isInstalled (serverId);
105            out = $rh.createReply();
106            out.write_boolean ($result);
107          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
108            out = $rh.createExceptionReply ();
109            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
110          }
111          break;
112        }
113
114
115   // if the server is currently marked as installed.
116
case 4: // activation/Repository/install
117
{
118          try {
119            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
120            this.install (serverId);
121            out = $rh.createReply();
122          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
123            out = $rh.createExceptionReply ();
124            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
125          } catch (com.sun.corba.se.spi.activation.ServerAlreadyInstalled $ex) {
126            out = $rh.createExceptionReply ();
127            com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.write (out, $ex);
128          }
129          break;
130        }
131
132
133   // if the server is currently marked as uninstalled.
134
case 5: // activation/Repository/uninstall
135
{
136          try {
137            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
138            this.uninstall (serverId);
139            out = $rh.createReply();
140          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
141            out = $rh.createExceptionReply ();
142            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
143          } catch (com.sun.corba.se.spi.activation.ServerAlreadyUninstalled $ex) {
144            out = $rh.createExceptionReply ();
145            com.sun.corba.se.spi.activation.ServerAlreadyUninstalledHelper.write (out, $ex);
146          }
147          break;
148        }
149
150
151   // list registered servers
152
case 6: // activation/Repository/listRegisteredServers
153
{
154          int $result[] = null;
155          $result = this.listRegisteredServers ();
156          out = $rh.createReply();
157          com.sun.corba.se.spi.activation.ServerIdsHelper.write (out, $result);
158          break;
159        }
160
161
162   // servers.
163
case 7: // activation/Repository/getApplicationNames
164
{
165          String JavaDoc $result[] = null;
166          $result = this.getApplicationNames ();
167          out = $rh.createReply();
168          com.sun.corba.se.spi.activation.RepositoryPackage.StringSeqHelper.write (out, $result);
169          break;
170        }
171
172
173   // Find the ServerID associated with the given application name.
174
case 8: // activation/Repository/getServerID
175
{
176          try {
177            String JavaDoc applicationName = in.read_string ();
178            int $result = (int)0;
179            $result = this.getServerID (applicationName);
180            out = $rh.createReply();
181            out.write_long ($result);
182          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
183            out = $rh.createExceptionReply ();
184            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
185          }
186          break;
187        }
188
189        default:
190          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
191     }
192
193     return out;
194   } // _invoke
195

196   // Type-specific CORBA::Object operations
197
private static String JavaDoc[] __ids = {
198     "IDL:activation/Repository:1.0"};
199
200   public String JavaDoc[] _ids ()
201   {
202     return (String JavaDoc[])__ids.clone ();
203   }
204
205
206 } // class _RepositoryImplBase
207
Popular Tags