106 } |
106 } |
107 return null; |
107 return null; |
108 } |
108 } |
109 |
109 |
110 /** |
110 /** |
111 * Writes a java.lang.Object as a CORBA Object. If <code>obj</code> is |
111 * Writes a java.lang.Object as a CORBA Object. If {@code obj} is |
112 * an exported RMI-IIOP server object, the tie is found |
112 * an exported RMI-IIOP server object, the tie is found |
113 * and wired to <code>obj</code>, then written to |
113 * and wired to {@code obj}, then written to |
114 <code>out.write_Object(org.omg.CORBA.Object)</code>. |
114 * {@code out.write_Object(org.omg.CORBA.Object)}. |
115 * If <code>obj</code> is a CORBA Object, it is written to |
115 * If {@code obj} is a CORBA Object, it is written to |
116 * <code>out.write_Object(org.omg.CORBA.Object)</code>. |
116 * {@code out.write_Object(org.omg.CORBA.Object)}. |
117 * @param out the stream in which to write the object. |
117 * @param out the stream in which to write the object. |
118 * @param obj the object to write. |
118 * @param obj the object to write. |
119 */ |
119 */ |
120 public static void writeRemoteObject(OutputStream out, |
120 public static void writeRemoteObject(OutputStream out, |
121 java.lang.Object obj) { |
121 java.lang.Object obj) { |
126 |
126 |
127 } |
127 } |
128 |
128 |
129 /** |
129 /** |
130 * Writes a java.lang.Object as either a value or a CORBA Object. |
130 * Writes a java.lang.Object as either a value or a CORBA Object. |
131 * If <code>obj</code> is a value object or a stub object, it is written to |
131 * If {@code obj} is a value object or a stub object, it is written to |
132 * <code>out.write_abstract_interface(java.lang.Object)</code>. If <code>obj</code> |
132 * {@code out.write_abstract_interface(java.lang.Object)}. |
133 is |
133 * If {@code obj} is an exported |
134 an exported |
134 * RMI-IIOP server object, the tie is found and wired to {@code obj}, |
135 * RMI-IIOP server object, the tie is found and wired to <code>obj</code>, |
135 * then written to {@code out.write_abstract_interface(java.lang.Object)}. |
136 * then written to <code>out.write_abstract_interface(java.lang.Object)</code>. |
|
137 * @param out the stream in which to write the object. |
136 * @param out the stream in which to write the object. |
138 * @param obj the object to write. |
137 * @param obj the object to write. |
139 */ |
138 */ |
140 public static void writeAbstractObject(OutputStream out, |
139 public static void writeAbstractObject(OutputStream out, |
141 java.lang.Object obj) { |
140 java.lang.Object obj) { |
217 /** |
216 /** |
218 * Returns a class instance for the specified class. |
217 * Returns a class instance for the specified class. |
219 * <P>The spec for this method is the "Java to IDL language |
218 * <P>The spec for this method is the "Java to IDL language |
220 * mapping", ptc/00-01-06. |
219 * mapping", ptc/00-01-06. |
221 * <P>In Java SE Platform, this method works as follows: |
220 * <P>In Java SE Platform, this method works as follows: |
222 * <UL><LI>Find the first non-null <tt>ClassLoader</tt> on the |
221 * <UL><LI>Find the first non-null {@code ClassLoader} on the |
223 * call stack and attempt to load the class using this |
222 * call stack and attempt to load the class using this |
224 * <tt>ClassLoader</tt>. |
223 * {@code ClassLoader}. |
225 * <LI>If the first step fails, and if <tt>remoteCodebase</tt> |
224 * <LI>If the first step fails, and if {@code remoteCodebase} |
226 * is non-null and |
225 * is non-null and |
227 * <tt>useCodebaseOnly</tt> is false, then call |
226 * {@code useCodebaseOnly} is false, then call |
228 * <tt>java.rmi.server.RMIClassLoader.loadClass(remoteCodebase, className)</tt>. |
227 * {@code java.rmi.server.RMIClassLoader.loadClass(remoteCodebase, className)}. |
229 * <LI>If <tt>remoteCodebase</tt> is null or <tt>useCodebaseOnly</tt> |
228 * <LI>If {@code remoteCodebase} is null or {@code useCodebaseOnly} |
230 * is true, then call <tt>java.rmi.server.RMIClassLoader.loadClass(className)</tt>. |
229 * is true, then call {@code java.rmi.server.RMIClassLoader.loadClass(className)}. |
231 * <LI>If a class was not successfully loaded by step 1, 2, or 3, |
230 * <LI>If a class was not successfully loaded by step 1, 2, or 3, |
232 * and <tt>loader</tt> is non-null, then call <tt>loader.loadClass(className)</tt>. |
231 * and {@code loader} is non-null, then call {@code loader.loadClass(className)}. |
233 * <LI>If a class was successfully loaded by step 1, 2, 3, or 4, then |
232 * <LI>If a class was successfully loaded by step 1, 2, 3, or 4, then |
234 * return the loaded class, else throw <tt>ClassNotFoundException</tt>. |
233 * return the loaded class, else throw {@code ClassNotFoundException}. |
235 * </UL> |
234 * </UL> |
236 * |
235 * |
237 * @param className the name of the class. |
236 * @param className the name of the class. |
238 * @param remoteCodebase a space-separated list of URLs at which |
237 * @param remoteCodebase a space-separated list of URLs at which |
239 * the class might be found. May be null. |
238 * the class might be found. May be null. |
240 * @param loader a <tt>ClassLoader</tt> that may be used to |
239 * @param loader a {@code ClassLoader} that may be used to |
241 * load the class if all other methods fail. |
240 * load the class if all other methods fail. |
242 * @return the <code>Class</code> object representing the loaded class. |
241 * @return the {@code Class} object representing the loaded class. |
243 * @exception ClassNotFoundException if class cannot be loaded. |
242 * @exception ClassNotFoundException if class cannot be loaded. |
244 */ |
243 */ |
245 public static Class loadClass(String className, |
244 public static Class loadClass(String className, |
246 String remoteCodebase, |
245 String remoteCodebase, |
247 ClassLoader loader) |
246 ClassLoader loader) |
252 return null ; |
251 return null ; |
253 } |
252 } |
254 |
253 |
255 |
254 |
256 /** |
255 /** |
257 * The <tt>isLocal</tt> method has the same semantics as the |
256 * The {@code isLocal} method has the same semantics as the |
258 * <tt>ObjectImpl._is_local</tt> |
257 * {@code ObjectImpl._is_local} |
259 * method, except that it can throw a <tt>RemoteException</tt>. |
258 * method, except that it can throw a {@code RemoteException}. |
260 * |
259 * |
261 * The <tt>_is_local()</tt> method is provided so that stubs may determine if a |
260 * The {@code _is_local()} method is provided so that stubs may determine if a |
262 * particular object is implemented by a local servant and hence local |
261 * particular object is implemented by a local servant and hence local |
263 * invocation APIs may be used. |
262 * invocation APIs may be used. |
264 * |
263 * |
265 * @param stub the stub to test. |
264 * @param stub the stub to test. |
266 * |
265 * |
267 * @return The <tt>_is_local()</tt> method returns true if |
266 * @return The {@code _is_local()} method returns true if |
268 * the servant incarnating the object is located in the same process as |
267 * the servant incarnating the object is located in the same process as |
269 * the stub and they both share the same ORB instance. The <tt>_is_local()</tt> |
268 * the stub and they both share the same ORB instance. The {@code _is_local()} |
270 * method returns false otherwise. The default behavior of <tt>_is_local()</tt> is |
269 * method returns false otherwise. The default behavior of {@code _is_local()} is |
271 * to return false. |
270 * to return false. |
272 * |
271 * |
273 * @throws RemoteException The Java to IDL specification does not |
272 * @throws RemoteException The Java to IDL specification does not |
274 * specify the conditions that cause a <tt>RemoteException</tt> to be thrown. |
273 * specify the conditions that cause a {@code RemoteException} to be thrown. |
275 */ |
274 */ |
276 public static boolean isLocal(Stub stub) throws RemoteException { |
275 public static boolean isLocal(Stub stub) throws RemoteException { |
277 |
276 |
278 if (utilDelegate != null) { |
277 if (utilDelegate != null) { |
279 return utilDelegate.isLocal(stub); |
278 return utilDelegate.isLocal(stub); |