public class CorbaUtils extends Object
| Constructor and Description |
|---|
CorbaUtils() |
| Modifier and Type | Method and Description |
|---|---|
static ORB |
getOrb(String server,
int port,
Hashtable env)
Get ORB using given server and port number, and properties from environment.
|
static Properties |
getOrbProperties() |
static Object |
remoteToCorba(Remote remoteObj,
ORB orb)
Returns the CORBA object reference associated with a Remote
object by using the javax.rmi.CORBA package.
|
static void |
setOrbProperties(Properties orbProperties) |
public static Object remoteToCorba(Remote remoteObj, ORB orb) throws ClassNotFoundException, ConfigurationException
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;remoteObj - The non-null remote object fororb - The non-null ORB to connect the remote object toClassNotFoundException - The RMI-IIOP package is not availableConfigurationException - The CORBA Object cannot be obtained
because of configuration problems.public static ORB getOrb(String server, int port, Hashtable env)
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 ORBpublic static Properties getOrbProperties()
public static void setOrbProperties(Properties orbProperties)
Copyright © 2020 JBoss by Red Hat. All rights reserved.