KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.spi.activation;
2
3
4 /**
5 * com/sun/corba/se/spi/activation/_LocatorImplBase.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 _LocatorImplBase extends org.omg.CORBA.portable.ObjectImpl JavaDoc
12                 implements com.sun.corba.se.spi.activation.Locator, org.omg.CORBA.portable.InvokeHandler JavaDoc
13 {
14
15   // Constructors
16
public _LocatorImplBase ()
17   {
18   }
19
20   private static java.util.Hashtable JavaDoc _methods = new java.util.Hashtable JavaDoc ();
21   static
22   {
23     _methods.put ("locateServer", new java.lang.Integer JavaDoc (0));
24     _methods.put ("locateServerForORB", new java.lang.Integer JavaDoc (1));
25     _methods.put ("getEndpoint", new java.lang.Integer JavaDoc (2));
26     _methods.put ("getServerPortForType", new java.lang.Integer JavaDoc (3));
27   }
28
29   public org.omg.CORBA.portable.OutputStream JavaDoc _invoke (String JavaDoc $method,
30                                 org.omg.CORBA.portable.InputStream JavaDoc in,
31                                 org.omg.CORBA.portable.ResponseHandler JavaDoc $rh)
32   {
33     org.omg.CORBA.portable.OutputStream JavaDoc out = null;
34     java.lang.Integer JavaDoc __method = (java.lang.Integer JavaDoc)_methods.get ($method);
35     if (__method == null)
36       throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
37
38     switch (__method.intValue ())
39     {
40
41   // Starts the server if it is not already running.
42
case 0: // activation/Locator/locateServer
43
{
44          try {
45            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
46            String JavaDoc endPoint = in.read_string ();
47            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocation $result = null;
48            $result = this.locateServer (serverId, endPoint);
49            out = $rh.createReply();
50            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationHelper.write (out, $result);
51          } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
52            out = $rh.createExceptionReply ();
53            com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
54          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
55            out = $rh.createExceptionReply ();
56            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
57          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
58            out = $rh.createExceptionReply ();
59            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
60          }
61          break;
62        }
63
64
65   // Starts the server if it is not already running.
66
case 1: // activation/Locator/locateServerForORB
67
{
68          try {
69            int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in);
70            String JavaDoc orbId = com.sun.corba.se.spi.activation.ORBidHelper.read (in);
71            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORB $result = null;
72            $result = this.locateServerForORB (serverId, orbId);
73            out = $rh.createReply();
74            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORBHelper.write (out, $result);
75          } catch (com.sun.corba.se.spi.activation.InvalidORBid $ex) {
76            out = $rh.createExceptionReply ();
77            com.sun.corba.se.spi.activation.InvalidORBidHelper.write (out, $ex);
78          } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) {
79            out = $rh.createExceptionReply ();
80            com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex);
81          } catch (com.sun.corba.se.spi.activation.ServerHeldDown $ex) {
82            out = $rh.createExceptionReply ();
83            com.sun.corba.se.spi.activation.ServerHeldDownHelper.write (out, $ex);
84          }
85          break;
86        }
87
88
89   // get the port for the endpoint of the locator
90
case 2: // activation/Locator/getEndpoint
91
{
92          try {
93            String JavaDoc endPointType = in.read_string ();
94            int $result = (int)0;
95            $result = this.getEndpoint (endPointType);
96            out = $rh.createReply();
97            out.write_long ($result);
98          } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
99            out = $rh.createExceptionReply ();
100            com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
101          }
102          break;
103        }
104
105
106   // to pick a particular port type.
107
case 3: // activation/Locator/getServerPortForType
108
{
109          try {
110            com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORB location = com.sun.corba.se.spi.activation.LocatorPackage.ServerLocationPerORBHelper.read (in);
111            String JavaDoc endPointType = in.read_string ();
112            int $result = (int)0;
113            $result = this.getServerPortForType (location, endPointType);
114            out = $rh.createReply();
115            out.write_long ($result);
116          } catch (com.sun.corba.se.spi.activation.NoSuchEndPoint $ex) {
117            out = $rh.createExceptionReply ();
118            com.sun.corba.se.spi.activation.NoSuchEndPointHelper.write (out, $ex);
119          }
120          break;
121        }
122
123        default:
124          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
125     }
126
127     return out;
128   } // _invoke
129

130   // Type-specific CORBA::Object operations
131
private static String JavaDoc[] __ids = {
132     "IDL:activation/Locator:1.0"};
133
134   public String JavaDoc[] _ids ()
135   {
136     return (String JavaDoc[])__ids.clone ();
137   }
138
139
140 } // class _LocatorImplBase
141
Popular Tags