本文整理汇总了Java中org.objectweb.proactive.core.node.NodeFactory.getNode方法的典型用法代码示例。如果您正苦于以下问题:Java NodeFactory.getNode方法的具体用法?Java NodeFactory.getNode怎么用?Java NodeFactory.getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.objectweb.proactive.core.node.NodeFactory
的用法示例。
在下文中一共展示了NodeFactory.getNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getReboundTaskTerminateNotificationHandler
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
/**
* Attempt to reaquire a correct reference to the TaskTerminateNotification
* active object from a previously saved URL for this object.
*
* @return a correct reference to a TaskTerminateNotification, or null if none can be retrieved
*/
TaskTerminateNotification getReboundTaskTerminateNotificationHandler() {
try {
logger.debug("List AOs on " + terminateNotificationNodeURL + " (expect only one): " +
Arrays.toString(NodeFactory.getNode(terminateNotificationNodeURL)
.getActiveObjects(TaskTerminateNotification.class.getName())));
Node node = NodeFactory.getNode(terminateNotificationNodeURL);
Object[] aos = node.getActiveObjects(TaskTerminateNotification.class.getName());
logger.info("On node " + node.getNodeInformation().getName() + " number of active objects found is " +
aos.length + " and the first one " + aos[0] + " will be used to send back the task result");
return (TaskTerminateNotification) aos[0];
} catch (Throwable e) {
// error when retrieving the termination handler after reconnection
logger.error("Failed to rebind TaskTerminatedNotification handler of task " + taskId.getReadableName() +
" from URL " + terminateNotificationNodeURL, e);
return null;
}
}
示例2: createNode
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
public static TestNode createNode(String nodeName, String expectedUrl, JVMProcess nodeProcess)
throws IOException, NodeException, InterruptedException {
Node newNode = null;
long startTimeStamp = System.currentTimeMillis();
NodeException toThrow = null;
while ((System.currentTimeMillis() - startTimeStamp) < DEFAULT_NODES_TIMEOUT) {
try {
newNode = NodeFactory.getNode(expectedUrl);
} catch (NodeException e) {
toThrow = e;
//nothing, wait another loop
}
if (newNode != null) {
return new TestNode(nodeProcess, newNode);
} else {
Thread.sleep(100);
}
}
throw toThrow == null ? new NodeException("unable to create the node " + nodeName) : toThrow;
}
示例3: releaseNode
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
/**
* Release a node
*
* @param sessionId a valid session id
* @param url node's URL
* @return true of the node has been released
* @throws NodeException
* @throws NotConnectedException
*/
@Override
@POST
@Path("node/release")
@Produces("application/json")
public boolean releaseNode(@HeaderParam("sessionid") String sessionId, @FormParam("url") String url)
throws NodeException, NotConnectedException {
ResourceManager rm = checkAccess(sessionId);
Node n;
n = NodeFactory.getNode(url);
return rm.releaseNode(n).getBooleanValue();
}
示例4: killNode
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
/**
* Kills the node with specified url
* @param url of the node
* @throws NodeException if node cannot be looked up
*/
public static void killNode(String url) throws NodeException {
Node node = NodeFactory.getNode(url);
try {
ProActiveRuntime rt = node.getProActiveRuntime();
rt.killNode(node.getNodeInformation().getName());
} catch (Exception ignored) {
}
}
示例5: killRuntime
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
/**
* Kills the runtime associated with specified node url
*
* @param url of the node
* @throws NodeException if node cannot be looked up
*/
public static void killRuntime(String url) throws NodeException {
try {
Node node = NodeFactory.getNode(url);
node.getProActiveRuntime().killRT(false);
} catch (Exception ignored) {
}
}
示例6: migrateTo
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
public void migrateTo(String nodeUrl) throws MigrationException {
if (!(this.body instanceof Migratable)) {
throw new MigrationException("Object cannot Migrate");
}
Node node = null;
try {
node = NodeFactory.getNode(nodeUrl);
} catch (NodeException e) {
throw new MigrationException("Cannot find node " + nodeUrl, e);
}
PAMobileAgent.migrateTo(body, node, true, Request.NFREQUEST_IMMEDIATE_PRIORITY);
}
示例7: test
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
@Test
public void test() throws NodeException {
Node node = NodeFactory.getDefaultNode();
String url = node.getNodeInformation().getURL();
NodeFactory.getNode(url);
}
示例8: 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");
}
}
示例9: 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));
}
示例10: call
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
public Node call() throws Exception {
Node node = NodeFactory.getNode(nodeUrl);
return node;
}
示例11: testRemoteException
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
@Test(expected = NodeException.class)
public void testRemoteException() throws NodeException {
NodeFactory.getNode("rmi://chuck.norris:1099/gun");
}
示例12: getActiveObjectNode
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
public static Node getActiveObjectNode(Object activeObject) throws NodeException {
Node node = NodeFactory.getNode(getActiveObjectNodeUrl(activeObject));
return node;
}
示例13: newGroup
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
/**
* Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList.
* @param className the name of the (upper) class of the group's members.
* @param genericParameters genericParameters parameterizing types
* @param params the parameters used to build all the group's members.
* @param nodeListString the names of the nodes where the members are created.
* @return a typed group with its members.
* @throws ActiveObjectCreationException if a problem occur while creating the stub or the body
* @throws ClassNotFoundException if the Class<?> corresponding to <code>className</code> can't be found.
* @throws ClassNotReifiableException if the Class<?> corresponding to <code>className</code> can't be reify.
* @throws NodeException if the node was null and that the DefaultNode cannot be created
*/
public static Object newGroup(String className, Class<?>[] genericParameters, Object[] params,
String[] nodeListString) throws ClassNotFoundException, ClassNotReifiableException,
ActiveObjectCreationException, NodeException {
Node[] nodeList = new Node[nodeListString.length];
for (int i = 0; i < nodeListString.length; i++)
nodeList[i] = NodeFactory.getNode(nodeListString[i]);
return PAGroup.newGroup(className, genericParameters, params, nodeList);
}
示例14: newGroup
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
/**
* Creates an object representing a group (a typed group) and creates all members with params on the node.
* @param className the name of the (upper) class of the group's members.
* @param genericParameters genericParameters parameterizing types
* @param params the array that contain the parameters used to build the group's members.
* @param nodeName the name (String) of the node where the members are created.
* @return a typed group with its members.
* @throws ActiveObjectCreationException if a problem occur while creating the stub or the body
* @throws ClassNotFoundException if the Class<?> corresponding to <code>className</code> can't be found.
* @throws ClassNotReifiableException if the Class<?> corresponding to <code>className</code> can't be reify.
* @throws NodeException if the node was null and that the DefaultNode cannot be created
* @deprecated Use {@link org.objectweb.proactive.api.PAGroup#newGroup(String,Class<?>[],Object[][],String)} instead
*/
@Deprecated
public static Object newGroup(String className, Class<?>[] genericParameters, Object[][] params,
String nodeName) throws ClassNotFoundException, ClassNotReifiableException,
ActiveObjectCreationException, NodeException {
Node[] nodeList = new Node[1];
nodeList[0] = NodeFactory.getNode(nodeName);
return ProActiveGroup.newGroup(className, genericParameters, params, nodeList);
}
示例15: newGroupBuiltWithMultithreading
import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
/**
* @deprecated use newGroupInParallel
* Creates an object representing a group (a typed group) and creates members with params cycling on nodeList.
* Threads are used to build the group's members. This methods returns when all members were created.
* @param className the name of the (upper) class of the group's member.
* @param params the array that contain the parameters used to build the group's member.
* If <code>params</code> is <code>null</code>, builds an empty group.
* @param nodeList the names of the nodes where the members are created.
* @return a typed group with its members.
* @throws ActiveObjectCreationException if a problem occur while creating the stub or the body
* @throws ClassNotFoundException if the Class<?> corresponding to <code>className</code> can't be found.
* @throws ClassNotReifiableException if the Class<?> corresponding to <code>className</code> can't be reify.
* @throws NodeException if the node was null and that the DefaultNode cannot be created
* @deprecated use newGroupInParallel
*/
@Deprecated
public static Object newGroupBuiltWithMultithreading(String className, Object[][] params,
String[] nodeList) throws ClassNotFoundException, ClassNotReifiableException,
ActiveObjectCreationException, NodeException {
Node[] nodeListString = new Node[nodeList.length];
for (int i = 0; i < nodeList.length; i++)
nodeListString[i] = NodeFactory.getNode(nodeList[i]);
return ProActiveGroup.newGroupBuiltWithMultithreading(className, params, nodeListString);
}