本文整理汇总了Java中org.objectweb.proactive.core.node.NodeFactory.createLocalNode方法的典型用法代码示例。如果您正苦于以下问题:Java NodeFactory.createLocalNode方法的具体用法?Java NodeFactory.createLocalNode怎么用?Java NodeFactory.createLocalNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.objectweb.proactive.core.node.NodeFactory
的用法示例。
在下文中一共展示了NodeFactory.createLocalNode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SchedulingMethodImpl
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
public SchedulingMethodImpl(SchedulingService schedulingService) throws Exception {
this.schedulingService = schedulingService;
this.checkEligibleTaskDescriptorScript = new CheckEligibleTaskDescriptorScript();
terminateNotification = new TerminateNotification(schedulingService);
Node terminateNotificationNode = NodeFactory.createLocalNode("taskTerminationNode",
true,
"taskTerminationVNode");
terminateNotification = PAActiveObject.turnActive(terminateNotification,
TaskTerminateNotification.class.getName(),
terminateNotificationNode);
terminateNotificationNodeURL = terminateNotificationNode.getNodeInformation().getURL();
this.threadPool = TimeoutThreadPoolExecutor.newFixedThreadPool(PASchedulerProperties.SCHEDULER_STARTTASK_THREADNUMBER.getValueAsInt(),
new NamedThreadFactory("DoTask_Action"));
this.corePrivateKey = Credentials.getPrivateKey(PASchedulerProperties.getAbsolutePath(PASchedulerProperties.SCHEDULER_AUTH_PRIVKEY_PATH.getValueAsString()));
}
示例2: startLocal
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
/**
* Creates and starts a Resource manager on the local host using the given initializer to configure it.
* Only one RM can be started by JVM.
*
* @param initializer Use to configure the Resource Manager before starting it.
* This parameter can be null, if so the Resource Manager will try to start on the JVM properties and
* the "pa.rm.home" property MUST be set to the root of the RM directory.
* @return a RM authentication that allow you to administer the RM or get its connection URL.
*
* @throws NodeException If the RM's node can't be created
* @throws ActiveObjectCreationException If RMCore cannot be created
* @throws AlreadyBoundException if a node with the same RMNode's name is already exist.
* @throws IOException If node and RMCore fails.
* @throws RMException if the connection to the authentication interface fails.
*/
public static RMAuthentication startLocal(RMInitializer initializer) throws Exception {
if (rmcore == null) {
if (initializer != null) {
//configure application
configure(initializer);
}
configureLog4j();
Node nodeRM = NodeFactory.createLocalNode(PAResourceManagerProperties.RM_NODE_NAME.getValueAsString(),
false,
null,
null);
String RMCoreName = RMConstants.NAME_ACTIVE_OBJECT_RMCORE;
rmcore = (RMCore) PAActiveObject.newActive(RMCore.class.getName(), // the class to deploy
new Object[] { RMCoreName, nodeRM },
nodeRM);
logger.debug("New RM core started locally");
return RMConnection.waitAndJoin(null);
} else {
throw new RMException("RM Core already running locally");
}
}
示例3: createLocalNode
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
/**
* Creates the node with the name given as parameter and returns it.
* @param nodeName The expected name of the node
* @return the newly created node.
*/
protected Node createLocalNode(String nodeName) {
Node localNode = null;
try {
localNode = NodeFactory.createLocalNode(nodeName, false, null, nodeName + "vnname");
if (localNode == null) {
logger.error(ExitStatus.RMNODE_NULL.description);
System.exit(ExitStatus.RMNODE_NULL.exitCode);
}
// setting system properties to node (they will be accessible remotely)
for (Object key : System.getProperties().keySet()) {
localNode.setProperty(key.toString(), System.getProperty(key.toString()));
}
} catch (Throwable t) {
logger.error("Unable to create the local node " + nodeName, t);
System.exit(ExitStatus.RMNODE_ADD_ERROR.exitCode);
}
return localNode;
}
示例4: activate
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
protected void activate() throws Exception {
try {
mainNode = NodeFactory.createLocalNode(MIDDLEMAN_NODE_NAME, true, null, null);
} catch (Exception e) {
e.printStackTrace();
// try again
mainNode = NodeFactory.createLocalNode(MIDDLEMAN_NODE_NAME, true, null, null);
}
pastub_reg = PAActiveObject.turnActive(reg, mainNode);
pastub_itf = PAActiveObject.turnActive(itf, mainNode);
}
示例5: test
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
@Test
public void test() throws NodeException, AlreadyBoundException {
Node node = NodeFactory.createLocalNode("PROACTIVE-573", false, null, null);
node = NodeFactory.getNode(node.getNodeInformation().getURL());
Assert.assertNotNull(node);
NodeFactory.killNode(node.getNodeInformation().getURL());
try {
node = NodeFactory.getNode(node.getNodeInformation().getURL());
Assert.fail("The previous line must throw a NodeException");
} catch (NodeException e) {
logger.info("Exception catched, everything is fine");
}
}
示例6: action
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
@org.junit.Test
public void action() throws Exception {
Node node = NodeFactory.createLocalNode(NODE_NAME, false, null, null);
String nodeURL = node.getNodeInformation().getURL();
Node returnedNode = NodeFactory.getNode(nodeURL);
assertTrue((returnedNode != null) && NodeFactory.isNodeLocal(returnedNode));
}
示例7: test
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
@Test
public void test() throws NodeException, AlreadyBoundException {
Node node1 = NodeFactory.createLocalNode("node1", false, null, null);
Node node2 = NodeFactory.createLocalNode("node2", false, null, null);
VMInformation localVM1 = node1.getVMInformation();
VMInformation localVM2 = node2.getVMInformation();
Assert.assertEquals(localVM1, localVM2);
NodeInformation nodeInformation1 = node1.getNodeInformation();
NodeInformation nodeInformation2 = node2.getNodeInformation();
logger.info("NodeInformation");
Assert.assertEquals(nodeInformation1, nodeInformation1);
Assert.assertEquals(nodeInformation2, nodeInformation2);
Assert.assertFalse(nodeInformation1.equals(nodeInformation2));
Assert.assertFalse(nodeInformation2.equals(nodeInformation1));
logger.info("Node self equals");
Assert.assertEquals(node1, node1);
Assert.assertEquals(node2, node2);
logger.info("Nodes not equals");
Assert.assertFalse(node1.equals(node2));
Assert.assertFalse(node2.equals(node1));
}
示例8: test
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
@Test
public void test() throws NodeException, AlreadyBoundException, ActiveObjectCreationException,
IOException {
Node node = NodeFactory.createLocalNode("my_node", false, null, null);
PAActiveObject.newActive(Object.class, new Object[] {}, node);
node.killAllActiveObjects();
System.out.println("TestKillLocalNode.main() Node killed ");
}
示例9: testHalfBody
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
@Test(expected = NodeException.class)
public void testHalfBody() throws NodeException, AlreadyBoundException {
NodeFactory.createLocalNode("HalfbodiesNode_", false, null, null);
}