KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.PortableActivationIDL;
2
3
4 /**
5 * com/sun/corba/se/PortableActivationIDL/_LocatorImplBase.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 _LocatorImplBase extends org.omg.CORBA.portable.ObjectImpl JavaDoc
12                 implements com.sun.corba.se.PortableActivationIDL.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   /** locate server - returns the port with a specific type for all registered
42     * ORBs of an active server.
43     * Starts the server if it is not already running.
44     */

45        case 0: // PortableActivationIDL/Locator/locateServer
46
{
47          try {
48            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
49            String JavaDoc endPoint = in.read_string ();
50            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType $result = null;
51            $result = this.locateServer (serverId, endPoint);
52            out = $rh.createReply();
53            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerTypeHelper.write (out, $result);
54          } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
55            out = $rh.createExceptionReply ();
56            com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
57          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
58            out = $rh.createExceptionReply ();
59            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
60          } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
61            out = $rh.createExceptionReply ();
62            com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
63          }
64          break;
65        }
66
67
68   /** locate server - returns all ports registered with a specified ORB for
69     * an active server
70     * Starts the server if it is not already running.
71     */

72        case 1: // PortableActivationIDL/Locator/locateServerForORB
73
{
74          try {
75            String JavaDoc serverId = org.omg.PortableInterceptor.ServerIdHelper.read (in);
76            String JavaDoc orbId = org.omg.PortableInterceptor.ORBIdHelper.read (in);
77            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB $result = null;
78            $result = this.locateServerForORB (serverId, orbId);
79            out = $rh.createReply();
80            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write (out, $result);
81          } catch (com.sun.corba.se.PortableActivationIDL.InvalidORBid $ex) {
82            out = $rh.createExceptionReply ();
83            com.sun.corba.se.PortableActivationIDL.InvalidORBidHelper.write (out, $ex);
84          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
85            out = $rh.createExceptionReply ();
86            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write (out, $ex);
87          } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
88            out = $rh.createExceptionReply ();
89            com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write (out, $ex);
90          }
91          break;
92        }
93
94
95   /** get the port for the endpoint of the locator
96     */

97        case 2: // PortableActivationIDL/Locator/getEndpoint
98
{
99          try {
100            String JavaDoc endPointType = in.read_string ();
101            int $result = (int)0;
102            $result = this.getEndpoint (endPointType);
103            out = $rh.createReply();
104            out.write_long ($result);
105          } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
106            out = $rh.createExceptionReply ();
107            com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
108          }
109          break;
110        }
111
112
113   /** Useful from external BadServerIdHandlers which need
114     * to pick a particular port type.
115     */

116        case 3: // PortableActivationIDL/Locator/getServerPortForType
117
{
118          try {
119            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB location = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read (in);
120            String JavaDoc endPointType = in.read_string ();
121            int $result = (int)0;
122            $result = this.getServerPortForType (location, endPointType);
123            out = $rh.createReply();
124            out.write_long ($result);
125          } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
126            out = $rh.createExceptionReply ();
127            com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write (out, $ex);
128          }
129          break;
130        }
131
132        default:
133          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
134     }
135
136     return out;
137   } // _invoke
138

139   // Type-specific CORBA::Object operations
140
private static String JavaDoc[] __ids = {
141     "IDL:PortableActivationIDL/Locator:1.0"};
142
143   public String JavaDoc[] _ids ()
144   {
145     return (String JavaDoc[])__ids.clone ();
146   }
147
148
149 } // class _LocatorImplBase
150
Popular Tags