当前位置: 首页>>代码示例>>Java>>正文


Java UnicastServerRef2类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:RMIJRMPServerImpl.java

示例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));
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:13,代码来源:RegistryImpl.java

示例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));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:UnicastRemoteObject.java

示例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));
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:21,代码来源:UnicastRemoteObject.java

示例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));
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:21,代码来源:UnicastRemoteObject.java


注:本文中的sun.rmi.server.UnicastServerRef2类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。