本文整理汇总了Java中java.rmi.activation.ActivationGroup.createGroup方法的典型用法代码示例。如果您正苦于以下问题:Java ActivationGroup.createGroup方法的具体用法?Java ActivationGroup.createGroup怎么用?Java ActivationGroup.createGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.rmi.activation.ActivationGroup
的用法示例。
在下文中一共展示了ActivationGroup.createGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import java.rmi.activation.ActivationGroup; //导入方法依赖的package包/类
/**
* Main program to start a VM for an activation group.
*/
public static void main(String args[])
{
try {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
}
// read group id, descriptor, and incarnation number from stdin
MarshalInputStream in = new MarshalInputStream(System.in);
ActivationGroupID id = (ActivationGroupID)in.readObject();
ActivationGroupDesc desc = (ActivationGroupDesc)in.readObject();
long incarnation = in.readLong();
// create and set group for the VM
ActivationGroup.createGroup(id, desc, incarnation);
} catch (Exception e) {
System.err.println("Exception in starting ActivationGroupInit:");
e.printStackTrace();
} finally {
try {
System.in.close();
// note: system out/err shouldn't be closed
// since the parent may want to read them.
} catch (Exception ex) {
// ignore exceptions
}
}
}
示例2: main
import java.rmi.activation.ActivationGroup; //导入方法依赖的package包/类
/**
* This main method is used to start new VMs for ActivationGroups. Four
* parameters needed to create ActivationGroup are: <br>
* ActivationGroupID <br>
* ActivationGroupDesc <br>
* incarnation The parameters needed to create ActivationGroup correctly are
* passed through the standard input stream in the following order: <br>
* ActivationGroupID -> ActivationGroupDesc -> incarnation
*/
public static void main(String args[]) {
// rmi.log.4C=ActivationGroupImpl.main:
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.4C")); //$NON-NLS-1$
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
try {
// rmi.log.4F=System.in.available = {0}
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.4F", //$NON-NLS-1$
System.in.available()));
RMIObjectInputStream ois = new RMIObjectInputStream(
new BufferedInputStream(System.in));
// rmi.log.55=ois = {0}
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.55", ois)); //$NON-NLS-1$
ActivationGroupID agid = (ActivationGroupID) ois.readObject();
// rmi.log.57=agid = {0}
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.57", agid)); //$NON-NLS-1$
ActivationGroupDesc agdesc = (ActivationGroupDesc) ois.readObject();
// rmi.log.74=agdesc = {0}
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.74", agdesc)); //$NON-NLS-1$
long incarnation = ois.readLong();
// rmi.log.7B=incarnation = {0}
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.7B", incarnation)); //$NON-NLS-1$
ActivationGroup.createGroup(agid, agdesc, incarnation);
} catch (Throwable t) {
// rmi.log.7C=: Exception: {0}
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.7C", t)); //$NON-NLS-1$
t.printStackTrace();
}
}