Package com.sun.jndi.toolkit.corba
Class CorbaUtils
java.lang.Object
com.sun.jndi.toolkit.corba.CorbaUtils
Contains utilities for performing CORBA-related tasks:
1. Get the org.omg.CORBA.Object for a java.rmi.Remote object.
2. Create an ORB to use for a given host/port, and environment properties.
...
- Author:
- Simon Nash, Bryan Atsatt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final StringDecode a URI string (according to RFC 2396).static final StringDecode a URI string (according to RFC 2396).static ORBGet ORB using given server and port number, and properties from environment.static booleanCheck whether object factory code base is trusted.static ObjectremoteToCorba(Remote remoteObj, ORB orb) Returns the CORBA object reference associated with a Remote object by using the javax.rmi.CORBA package.
-
Constructor Details
-
CorbaUtils
public CorbaUtils()
-
-
Method Details
-
remoteToCorba
Returns the CORBA object reference associated with a Remote object by using the javax.rmi.CORBA package.This method effective does the following:
java.lang.Object stub; try { stub = PortableRemoteObject.toStub(remoteObj); } catch (Exception e) { throw new ConfigurationException("Object not exported or not found"); } if (!(stub instanceof javax.rmi.CORBA.Stub)) { return null; // JRMP impl or JRMP stub } try { ((javax.rmi.CORBA.Stub)stub).connect(orb); // try to connect IIOP stub } catch (RemoteException e) { // ignore 'already connected' error } return (javax.rmi.CORBA.Stub)stub;- Parameters:
remoteObj- The non-null remote object fororb- The non-null ORB to connect the remote object to- Returns:
- The CORBA Object for remoteObj; null if
remoteObjis a JRMP implementation or JRMP stub. - Throws:
ConfigurationException- The CORBA Object cannot be obtained because of configuration problems.
-
getOrb
Get ORB using given server and port number, and properties from environment.- Parameters:
server- Possibly null server; if null means use default; For applet, it is the applet host; for app, it is localhost.port- Port number, -1 means default portenv- Possibly null environment. Contains environment properties. Could contain ORB itself; or applet used for initializing ORB. Use all String properties from env for initializing ORB- Returns:
- A non-null ORB.
-
isObjectFactoryTrusted
Check whether object factory code base is trusted. Classes may only be loaded from an arbitrary URL code base when the system property com.sun.jndi.rmi.object.trustURLCodebase has been set to "true".- Throws:
NamingException
-
decode
Decode a URI string (according to RFC 2396).- Throws:
MalformedURLException
-
decode
public static final String decode(String s, String enc) throws MalformedURLException, UnsupportedEncodingException Decode a URI string (according to RFC 2396). Three-character sequences '%xy', where 'xy' is the two-digit hexadecimal representation of the lower 8-bits of a character, are decoded into the character itself. The string is subsequently converted using the specified encoding
-