本文整理汇总了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;
}
示例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();
}
}
}