/** * Start an SCA node * @param args a list of contribution jars for the node to run */ public static void main(String[] args) throws Exception { Contribution[] contributions = new Contribution[args.length]; for (int i = 0; i < args.length; i++) { File f = new File(args[i]); if (!f.exists()) { System.err.println("contribution not found: " + f); System.exit(1); } contributions[i] = new Contribution(f.toURI().toString(), f.toURI().toString()); } Node node = NodeFactory.newInstance().createNode(contributions).start(); System.out.println("Hit enter to stop node..."); if (System.in.read() == -1) { // no sysin so wait for ever letting caller do the terminate Object lock = new Object(); synchronized (lock) { lock.wait(); } } node.stop(); } }
public static void stop(WebContextConfigurator configurator) { Node node = null; if (configurator != null) { node = (Node)configurator.getAttribute(SCA_NODE_ATTRIBUTE); } if (node != null) { node.stop(); configurator.setAttribute(SCA_NODE_ATTRIBUTE, null); } }
private static Node createAndStartNode(final WebContextConfigurator configurator) throws ServletException { NodeConfiguration configuration = null; try { configuration = getNodeConfiguration(configurator); } catch (IOException e) { throw new ServletException(e); } catch (URISyntaxException e) { throw new ServletException(e); } Node node = null; if (configuration != null) { node = factory.createNode(configuration).start(); } return node; }
public synchronized void destroy() { if (inited) { for (Node node : nodes.values()) { node.stop(); } nodes.clear(); deployer.stop(); registry.stop(); super.destroy(); inited = false; } }
/** * Start an SCA node * @param args a list of contribution jars for the node to run */ public static void main(String[] args) throws Exception { Contribution[] contributions = new Contribution[args.length]; for (int i = 0; i < args.length; i++) { File f = new File(args[i]); if (!f.exists()) { System.err.println("contribution not found: " + f); System.exit(1); } contributions[i] = new Contribution(f.toURI().toString(), f.toURI().toString()); } Node node = NodeFactory.newInstance().createNode(contributions).start(); System.out.println("Hit enter to stop node..."); if (System.in.read() == -1) { // no sysin so wait for ever letting caller do the terminate Object lock = new Object(); synchronized (lock) { lock.wait(); } } node.stop(); } }
public synchronized void destroy() { if (inited) { for (Node node : nodes.values()) { node.stop(); } nodes.clear(); deployer.stop(); registry.stop(); super.destroy(); inited = false; } }