private Contribution[] getContributions(List<String> locations) { Contribution[] contributions = new Contribution[locations.size()]; int index = 0; for (String location : locations) { contributions[index++] = new Contribution(location, location); } return contributions; }
static Contribution contribution(ContributionFactory contributionFactory, org.apache.tuscany.sca.node.Contribution c) { Contribution contribution = contributionFactory.createContribution(); contribution.setURI(c.getURI()); contribution.setLocation(c.getLocation()); contribution.setUnresolved(true); return contribution; }
static Contribution contribution(ContributionFactory contributionFactory, org.apache.tuscany.sca.node.Contribution c) { Contribution contribution = contributionFactory.createContribution(); contribution.setURI(c.getURI()); contribution.setLocation(c.getLocation()); contribution.setUnresolved(true); return contribution; }
private NodeConfiguration createConfiguration(Contribution... contributions) { NodeConfigurationFactory factory = this; NodeConfiguration configuration = factory.createNodeConfiguration(); if (properties.getProperty("defaultDomainName") != null) { configuration.setDomainURI(properties.getProperty("defaultDomainName")); } // Make sure a unique node URI is created for the same node factory configuration.setURI(generateNodeURI()); if (contributions != null) { for (Contribution c : contributions) { configuration.addContribution(c.getURI(), c.getLocation()); } } return configuration; }
private Contribution[] getContributions(List<String> locations) { Contribution[] contributions = new Contribution[locations.size()]; int index = 0; for (String location : locations) { contributions[index++] = new Contribution(location, location); } return contributions; }
private NodeConfiguration createConfiguration(Contribution... contributions) { NodeConfigurationFactory factory = this; NodeConfiguration configuration = factory.createNodeConfiguration(); if (properties.getProperty("defaultDomainName") != null) { configuration.setDomainURI(properties.getProperty("defaultDomainName")); } // Make sure a unique node URI is created for the same node factory configuration.setURI(generateNodeURI()); if (contributions != null) { for (Contribution c : contributions) { configuration.addContribution(c.getURI(), c.getLocation()); } } return configuration; }
private Contribution[] getContributions(List<String> uris, List<String> locations) { if (uris.size() != locations.size()) { throw new IllegalArgumentException("The number of URIs does not match the number of locations"); } Contribution[] contributions = new Contribution[locations.size()]; for (int i = 0, n = locations.size(); i < n; i++) { contributions[i] = new Contribution(uris.get(i), locations.get(i)); } return contributions; }
private Contribution[] getContributions(List<String> uris, List<String> locations) { if (uris.size() != locations.size()) { throw new IllegalArgumentException("The number of URIs does not match the number of locations"); } Contribution[] contributions = new Contribution[locations.size()]; for (int i = 0, n = locations.size(); i < n; i++) { contributions[i] = new Contribution(uris.get(i), locations.get(i)); } return contributions; }
/** * 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(); } }
/** * 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(); } }