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


Java Activator类代码示例

本文整理汇总了Java中java.rmi.activation.Activator的典型用法代码示例。如果您正苦于以下问题:Java Activator类的具体用法?Java Activator怎么用?Java Activator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Activator类属于java.rmi.activation包,在下文中一共展示了Activator类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerObject

import java.rmi.activation.Activator; //导入依赖的package包/类
public ActivationID registerObject(ActivationDesc adesc) {
    waitStartup();
    // rmi.log.4B=ActivationSystemImpl.registerObject():
    rLog.log(commonDebugLevel,Messages.getString("rmi.log.4B")); //$NON-NLS-1$
    ActivationGroupID agid = adesc.getGroupID();
    // rmi.log.4C=agid : {0}
    rLog.log(commonDebugLevel, Messages.getString("rmi.log.4C", agid)); //$NON-NLS-1$
    // rmi.log.4D=Activator stub = {0}
    rLog.log(commonDebugLevel, Messages.getString("rmi.log.4D", thisStub)); //$NON-NLS-1$
    ActivationID aid = new ActivationID((Activator) thisStub);
    // rmi.log.4E=aid : {0}
    rLog.log(commonDebugLevel, Messages.getString("rmi.log.4E", aid)); //$NON-NLS-1$
    // rmi.log.4C=agid : {0}
    rLog.log(commonDebugLevel, Messages.getString("rmi.log.4C", agid)); //$NON-NLS-1$

    ActivationGroupInfo info = (ActivationGroupInfo) groupInfoByGroupId
            .get(agid);
    // rmi.log.50=ActivationGroupInfo = {0}
    rLog.log(commonDebugLevel, Messages.getString("rmi.log.50", info)); //$NON-NLS-1$

    info.registerObject(aid, adesc);
    // rmi.log.51=Activation desc was added.
    rLog.log(commonDebugLevel, Messages.getString("rmi.log.51")); //$NON-NLS-1$
    return aid;

}
 
开发者ID:shannah,项目名称:cn1,代码行数:27,代码来源:Rmid.java

示例2: init

import java.rmi.activation.Activator; //导入依赖的package包/类
/**
 * Initialize the Activation instantiation; start activation
 * services.
 */
private void init(int port,
                  RMIServerSocketFactory ssf,
                  ReliableLog log,
                  String[] childArgs)
    throws Exception
{
    // initialize
    this.log = log;
    numUpdates = 0;
    shutdownHook =  new ShutdownHook();
    groupSemaphore = getInt("sun.rmi.activation.groupThrottle", 3);
    groupCounter = 0;
    Runtime.getRuntime().addShutdownHook(shutdownHook);

    // Use array size of 0, since the value from calling size()
    // may be out of date by the time toArray() is called.
    ActivationGroupID[] gids =
        groupTable.keySet().toArray(new ActivationGroupID[0]);

    synchronized (startupLock = new Object()) {
        // all the remote methods briefly synchronize on startupLock
        // (via checkShutdown) to make sure they don't happen in the
        // middle of this block.  This block must not cause any such
        // incoming remote calls to happen, or deadlock would result!
        activator = new ActivatorImpl(port, ssf);
        activatorStub = (Activator) RemoteObject.toStub(activator);
        system = new ActivationSystemImpl(port, ssf);
        systemStub = (ActivationSystem) RemoteObject.toStub(system);
        monitor = new ActivationMonitorImpl(port, ssf);
        initCommand(childArgs);
        registry = new SystemRegistryImpl(port, null, ssf, systemStub);

        if (ssf != null) {
            synchronized (initLock) {
                initDone = true;
                initLock.notifyAll();
            }
        }
    }
    startupLock = null;

    // restart services
    for (int i = gids.length; --i >= 0; ) {
        try {
            getGroupEntry(gids[i]).restartServices();
        } catch (UnknownGroupException e) {
            System.err.println(
                getTextResource("rmid.restart.group.warning"));
            e.printStackTrace();
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:57,代码来源:Activation.java


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