KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.sun.corba.se.PortableActivationIDL;
2
3
4 /**
5 * com/sun/corba/se/PortableActivationIDL/_LocatorStub.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 class _LocatorStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements com.sun.corba.se.PortableActivationIDL.Locator
12 {
13
14
15   /** locate server - returns the port with a specific type for all registered
16     * ORBs of an active server.
17     * Starts the server if it is not already running.
18     */

19   public com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType locateServer (String JavaDoc serverId, String JavaDoc endPoint) throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown
20   {
21             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
22             try {
23                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("locateServer", true);
24                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
25                 $out.write_string (endPoint);
26                 $in = _invoke ($out);
27                 com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType $result = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerTypeHelper.read ($in);
28                 return $result;
29             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
30                 $in = $ex.getInputStream ();
31                 String JavaDoc _id = $ex.getId ();
32                 if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
33                     throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
34                 else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
35                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
36                 else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
37                     throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
38                 else
39                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
40             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
41                 return locateServer (serverId, endPoint );
42             } finally {
43                 _releaseReply ($in);
44             }
45   } // locateServer
46

47
48   /** locate server - returns all ports registered with a specified ORB for
49     * an active server
50     * Starts the server if it is not already running.
51     */

52   public com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB locateServerForORB (String JavaDoc serverId, String JavaDoc orbId) throws com.sun.corba.se.PortableActivationIDL.InvalidORBid, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown
53   {
54             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
55             try {
56                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("locateServerForORB", true);
57                 org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId);
58                 org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId);
59                 $in = _invoke ($out);
60                 com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB $result = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read ($in);
61                 return $result;
62             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
63                 $in = $ex.getInputStream ();
64                 String JavaDoc _id = $ex.getId ();
65                 if (_id.equals ("IDL:PortableActivationIDL/InvalidORBid:1.0"))
66                     throw com.sun.corba.se.PortableActivationIDL.InvalidORBidHelper.read ($in);
67                 else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
68                     throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in);
69                 else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
70                     throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in);
71                 else
72                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
73             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
74                 return locateServerForORB (serverId, orbId );
75             } finally {
76                 _releaseReply ($in);
77             }
78   } // locateServerForORB
79

80
81   /** get the port for the endpoint of the locator
82     */

83   public int getEndpoint (String JavaDoc endPointType) throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint
84   {
85             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
86             try {
87                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getEndpoint", true);
88                 $out.write_string (endPointType);
89                 $in = _invoke ($out);
90                 int $result = com.sun.corba.se.PortableActivationIDL.TCPPortHelper.read ($in);
91                 return $result;
92             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
93                 $in = $ex.getInputStream ();
94                 String JavaDoc _id = $ex.getId ();
95                 if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
96                     throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
97                 else
98                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
99             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
100                 return getEndpoint (endPointType );
101             } finally {
102                 _releaseReply ($in);
103             }
104   } // getEndpoint
105

106
107   /** Useful from external BadServerIdHandlers which need
108     * to pick a particular port type.
109     */

110   public int getServerPortForType (com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB location, String JavaDoc endPointType) throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint
111   {
112             org.omg.CORBA.portable.InputStream JavaDoc $in = null;
113             try {
114                 org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getServerPortForType", true);
115                 com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write ($out, location);
116                 $out.write_string (endPointType);
117                 $in = _invoke ($out);
118                 int $result = com.sun.corba.se.PortableActivationIDL.TCPPortHelper.read ($in);
119                 return $result;
120             } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
121                 $in = $ex.getInputStream ();
122                 String JavaDoc _id = $ex.getId ();
123                 if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
124                     throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in);
125                 else
126                     throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
127             } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
128                 return getServerPortForType (location, endPointType );
129             } finally {
130                 _releaseReply ($in);
131             }
132   } // getServerPortForType
133

134   // Type-specific CORBA::Object operations
135
private static String JavaDoc[] __ids = {
136     "IDL:PortableActivationIDL/Locator:1.0"};
137
138   public String JavaDoc[] _ids ()
139   {
140     return (String JavaDoc[])__ids.clone ();
141   }
142
143   private void readObject (java.io.ObjectInputStream JavaDoc s) throws java.io.IOException JavaDoc
144   {
145      String JavaDoc str = s.readUTF ();
146      String JavaDoc[] args = null;
147      java.util.Properties JavaDoc props = null;
148      org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
149      org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
150      _set_delegate (delegate);
151   }
152
153   private void writeObject (java.io.ObjectOutputStream JavaDoc s) throws java.io.IOException JavaDoc
154   {
155      String JavaDoc[] args = null;
156      java.util.Properties JavaDoc props = null;
157      String JavaDoc str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
158      s.writeUTF (str);
159   }
160 } // class _LocatorStub
161
Popular Tags