本文整理汇总了Java中com.sun.jmx.remote.internal.IIOPHelper.getOrb方法的典型用法代码示例。如果您正苦于以下问题:Java IIOPHelper.getOrb方法的具体用法?Java IIOPHelper.getOrb怎么用?Java IIOPHelper.getOrb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jmx.remote.internal.IIOPHelper
的用法示例。
在下文中一共展示了IIOPHelper.getOrb方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encodeIIOPStub
import com.sun.jmx.remote.internal.IIOPHelper; //导入方法依赖的package包/类
static String encodeIIOPStub(
RMIServer rmiServer, Map<String, ?> env)
throws IOException {
try {
Object orb = IIOPHelper.getOrb(rmiServer);
return IIOPHelper.objectToString(orb, rmiServer);
} catch (RuntimeException x) {
throw newIOException(x.getMessage(), x);
}
}
示例2: connectStub
import com.sun.jmx.remote.internal.IIOPHelper; //导入方法依赖的package包/类
/**
* <p>In order to be usable, an IIOP stub must be connected to an ORB.
* The stub is automatically connected to the ORB if:
* <ul>
* <li> It was returned by the COS naming</li>
* <li> Its server counterpart has been registered in COS naming
* through JNDI.</li>
* </ul>
* Otherwise, it is not connected. A stub which is deserialized
* from Jini is not connected. A stub which is obtained from a
* non registered RMIIIOPServerImpl is not a connected.<br>
* A stub which is not connected can't be serialized, and thus
* can't be registered in Jini. A stub which is not connected can't
* be used to invoke methods on the server.
* <p>
* In order to palliate this, this method will connect the
* given stub if it is not yet connected. If the given
* <var>RMIServer</var> is not an instance of
* {@link javax.rmi.CORBA.Stub javax.rmi.CORBA.Stub}, then the
* method do nothing and simply returns that stub. Otherwise,
* this method will attempt to connect the stub to an ORB as
* follows:
* <ul>
* <li>This method looks in the provided <var>environment</var> for
* the "java.naming.corba.orb" property. If it is found, the
* referenced object (an {@link org.omg.CORBA.ORB ORB}) is used to
* connect the stub. Otherwise, a new org.omg.CORBA.ORB is created
* by calling {@link
* org.omg.CORBA.ORB#init(String[], Properties)
* org.omg.CORBA.ORB.init((String[])null,(Properties)null)}</li>
* <li>The new created ORB is kept in a static
* {@link WeakReference} and can be reused for connecting other
* stubs. However, no reference is ever kept on the ORB provided
* in the <var>environment</var> map, if any.</li>
* </ul>
* @param rmiServer A RMI Server Stub.
* @param environment An environment map, possibly containing an ORB.
* @return the given stub.
* @exception IllegalArgumentException if the
* <tt>java.naming.corba.orb</tt> property is specified and
* does not point to an {@link org.omg.CORBA.ORB ORB}.
* @exception IOException if the connection to the ORB failed.
**/
static RMIServer connectStub(RMIServer rmiServer,
Map<String, ?> environment)
throws IOException {
if (IIOPHelper.isStub(rmiServer)) {
try {
IIOPHelper.getOrb(rmiServer);
} catch (UnsupportedOperationException x) {
// BAD_OPERATION
IIOPHelper.connect(rmiServer, resolveOrb(environment));
}
}
return rmiServer;
}
示例3: connectStub
import com.sun.jmx.remote.internal.IIOPHelper; //导入方法依赖的package包/类
/**
* <p>In order to be usable, an IIOP stub must be connected to an ORB.
* The stub is automatically connected to the ORB if:
* <ul>
* <li> It was returned by the COS naming</li>
* <li> Its server counterpart has been registered in COS naming
* through JNDI.</li>
* </ul>
* Otherwise, it is not connected. A stub which is deserialized
* from Jini is not connected. A stub which is obtained from a
* non registered RMIIIOPServerImpl is not a connected.<br>
* A stub which is not connected can't be serialized, and thus
* can't be registered in Jini. A stub which is not connected can't
* be used to invoke methods on the server.
* <p>
* In order to palliate this, this method will connect the
* given stub if it is not yet connected. If the given
* <var>RMIServer</var> is not an instance of
* {@link javax.rmi.CORBA.Stub javax.rmi.CORBA.Stub}, then the
* method do nothing and simply returns that stub. Otherwise,
* this method will attempt to connect the stub to an ORB as
* follows:
* <ul>
* <p>This method looks in the provided <var>environment</var> for
* the "java.naming.corba.orb" property. If it is found, the
* referenced object (an {@link org.omg.CORBA.ORB ORB}) is used to
* connect the stub. Otherwise, a new org.omg.CORBA.ORB is created
* by calling {@link
* org.omg.CORBA.ORB#init(String[], Properties)
* org.omg.CORBA.ORB.init((String[])null,(Properties)null)}
* <p>The new created ORB is kept in a static
* {@link WeakReference} and can be reused for connecting other
* stubs. However, no reference is ever kept on the ORB provided
* in the <var>environment</var> map, if any.
* </ul>
* @param rmiServer A RMI Server Stub.
* @param environment An environment map, possibly containing an ORB.
* @return the given stub.
* @exception IllegalArgumentException if the
* <tt>java.naming.corba.orb</tt> property is specified and
* does not point to an {@link org.omg.CORBA.ORB ORB}.
* @exception IOException if the connection to the ORB failed.
**/
static RMIServer connectStub(RMIServer rmiServer,
Map<String, ?> environment)
throws IOException {
if (IIOPHelper.isStub(rmiServer)) {
try {
IIOPHelper.getOrb(rmiServer);
} catch (UnsupportedOperationException x) {
// BAD_OPERATION
IIOPHelper.connect(rmiServer, resolveOrb(environment));
}
}
return rmiServer;
}