本文整理汇总了Java中sun.rmi.server.UnicastServerRef2类的典型用法代码示例。如果您正苦于以下问题:Java UnicastServerRef2类的具体用法?Java UnicastServerRef2怎么用?Java UnicastServerRef2使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnicastServerRef2类属于sun.rmi.server包,在下文中一共展示了UnicastServerRef2类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: export
import sun.rmi.server.UnicastServerRef2; //导入依赖的package包/类
private void export(Remote obj) throws RemoteException {
final RMIExporter exporter =
(RMIExporter) env.get(RMIExporter.EXPORTER_ATTRIBUTE);
final boolean daemon = EnvHelp.isServerDaemon(env);
if (daemon && exporter != null) {
throw new IllegalArgumentException("If "+EnvHelp.JMX_SERVER_DAEMON+
" is specified as true, "+RMIExporter.EXPORTER_ATTRIBUTE+
" cannot be used to specify an exporter!");
}
if (daemon) {
if (csf == null && ssf == null) {
new UnicastServerRef(port).exportObject(obj, null, true);
} else {
new UnicastServerRef2(port, csf, ssf).exportObject(obj, null, true);
}
} else if (exporter != null) {
exporter.exportObject(obj, port, csf, ssf);
} else {
UnicastRemoteObject.exportObject(obj, port, csf, ssf);
}
}
示例2: RegistryImpl
import sun.rmi.server.UnicastServerRef2; //导入依赖的package包/类
/**
* Construct a new RegistryImpl on the specified port with the
* given custom socket factory pair.
*/
public RegistryImpl(int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
throws RemoteException
{
LiveRef lref = new LiveRef(id, port, csf, ssf);
setup(new UnicastServerRef2(lref));
}
示例3: exportObject
import sun.rmi.server.UnicastServerRef2; //导入依赖的package包/类
/**
* Exports the remote object to make it available to receive incoming
* calls, using a transport specified by the given socket factory.
*
* <p>Either socket factory may be {@code null}, in which case
* the corresponding client or server socket creation method of
* {@link RMISocketFactory} is used instead.
*
* @param obj the remote object to be exported
* @param port the port to export the object on
* @param csf the client-side socket factory for making calls to the
* remote object
* @param ssf the server-side socket factory for receiving remote calls
* @return remote object stub
* @exception RemoteException if export fails
* @since 1.2
*/
public static Remote exportObject(Remote obj, int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
throws RemoteException
{
return exportObject(obj, new UnicastServerRef2(port, csf, ssf));
}
示例4: exportObject
import sun.rmi.server.UnicastServerRef2; //导入依赖的package包/类
/**
* Exports the remote object to make it available to receive incoming
* calls, using a transport specified by the given socket factory.
* @param obj the remote object to be exported
* @param port the port to export the object on
* @param csf the client-side socket factory for making calls to the
* remote object
* @param ssf the server-side socket factory for receiving remote calls
* @return remote object stub
* @exception RemoteException if export fails
* @since 1.2
*/
public static Remote exportObject(Remote obj, int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
throws RemoteException
{
return exportObject(obj, new UnicastServerRef2(port, csf, ssf));
}
示例5: exportObject
import sun.rmi.server.UnicastServerRef2; //导入依赖的package包/类
/**
* Exports the remote object to make it available to receive incoming
* calls, using a transport specified by the given socket factory.
* @param obj the remote object to be exported
* @param port the port to export the object on
* @param csf the client-side socket factory for making calls to the
* remote object
* @param ssf the server-side socket factory for receiving remote calls
* @return remote object stub
* @exception RemoteException if export fails
* @since 1.2
*/
public static Remote exportObject(Remote obj, int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
throws RemoteException
{
return exportObject(obj, new UnicastServerRef2(port, csf, ssf));
}