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


Java NodeFactory.getNode方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:24,代码来源:TaskLauncherRebinder.java

示例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;
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:23,代码来源:RMTHelper.java

示例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();
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:21,代码来源:RMRest.java

示例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) {
    }
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:14,代码来源:RMTHelper.java

示例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) {
    }
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:14,代码来源:RMTHelper.java

示例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);
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:13,代码来源:BodyWrapper.java

示例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);
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:8,代码来源:TestNodeLookup.java

示例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");
    }
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:14,代码来源:TestKillNode.java

示例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));
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:8,代码来源:Test.java

示例10: call

import org.objectweb.proactive.core.node.NodeFactory; //导入方法依赖的package包/类
public Node call() throws Exception {
    Node node = NodeFactory.getNode(nodeUrl);
    return node;
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:5,代码来源:NodeSource.java

示例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");
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:5,代码来源:TestNodeLookup.java

示例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;
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:5,代码来源:PAActiveObject.java

示例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);
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:21,代码来源:PAGroup.java

示例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);
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:22,代码来源:ProActiveGroup.java

示例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);
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:25,代码来源:ProActiveGroup.java


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