/** * Creates a Node * @return a Node */ public Node createNode() { return createNode((String)null); }
/** * Creates a new TuscanyRuntime * @return a TuscanyRuntime */ public static TuscanyRuntime newInstance() { return new TuscanyRuntime(null); }
protected TuscanyRuntime(Properties config) { init(config); }
public Shell(File nodeXML, boolean useJLine) throws ContributionReadException, MalformedURLException, ActivationException, ValidationException { this.runtime = TuscanyRuntime.newInstance(); this.useJline = useJLine; try { initCommands(); } catch (IOException e) { throw new RuntimeException(e); } Node node = runtime.createNodeFromXML(nodeXML.toURI().toURL().toString()); currentDomain = node.getDomainName(); nodes.put(currentDomain, node); }
/** * Creates a Node from an XML configuration file * @param configURL the URL to the XML configuration file * @return Node the configured Node */ public Node createNodeFromXML(String configURL) throws ContributionReadException, ActivationException, ValidationException { NodeConfiguration configuration = loadConfiguration(configURL); NodeImpl node = (NodeImpl)createNode(configuration.getDomainURI()); for ( ContributionConfiguration c : configuration.getContributions()) { String curi = node.installContribution(c.getURI(), c.getLocation(), c.getMetaDataURL(), c.getDependentContributionURIs()); if (c.isStartDeployables()) { for (String compURI : node.getDeployableCompositeURIs(curi)) { node.startComposite(curi, compURI); } } } return node; }
public static List<String> getDependencies(String contributionURI, Map<String, ZipInputStream> possibles) throws ValidationException, IOException, ContributionReadException, XMLStreamException { Deployer deployer = TuscanyRuntime.newInstance().getDeployer();
public Shell(String domainURI, boolean useJLine) { this.runtime = TuscanyRuntime.newInstance(); this.useJline = useJLine; try { initCommands(); } catch (IOException e) { throw new RuntimeException(e); } if (domainURI != null) { domain(domainURI); } }
public boolean bye() { for (Node node : nodes.values()) { node.stop(); } runtime.stop(); for (Node node : standaloneNodes.values()) { node.stop(); } return false; }
boolean load(final String configXmlUrl) throws ContributionReadException, ActivationException, ValidationException { Node node = runtime.createNodeFromXML(configXmlUrl); currentDomain = node.getDomainName(); nodes.put(currentDomain, node); return true; }
boolean domainComposite() { Composite domainComposite = getNode().getDomainComposite(); System.out.println(Utils.modelToXML(domainComposite, true, runtime.getExtensionPointRegistry())); return true; }
/** * A helper method to run a standalone SCA composite in the default standalone SCA domain. * @param compositeURI URI within the contribution of a composite to run * if compositeURI is null then all deployable composites in the contribution will be run * @param contributionURL URL of the contribution * @param dependentContributionURLs optional URLs of dependent contributions * @return a Node with installed contributions */ public static Node runComposite(String compositeURI, String contributionURL, String... dependentContributionURLs) { return runComposite(null, compositeURI, contributionURL, dependentContributionURLs); }
public Shell(File nodeXML, boolean useJLine) throws ContributionReadException, MalformedURLException, ActivationException, ValidationException { this.runtime = TuscanyRuntime.newInstance(); this.useJline = useJLine; try { initCommands(); } catch (IOException e) { throw new RuntimeException(e); } Node node = runtime.createNodeFromXML(nodeXML.toURI().toURL().toString()); currentDomain = node.getDomainName(); nodes.put(currentDomain, node); }
/** * Creates a Node from an XML configuration file * @param configURL the URL to the XML configuration file * @return Node the configured Node */ public Node createNodeFromXML(String configURL) throws ContributionReadException, ActivationException, ValidationException { NodeConfiguration configuration = loadConfiguration(configURL); NodeImpl node = (NodeImpl)createNode(configuration.getDomainURI()); for ( ContributionConfiguration c : configuration.getContributions()) { String curi = node.installContribution(c.getURI(), c.getLocation(), c.getMetaDataURL(), c.getDependentContributionURIs()); if (c.isStartDeployables()) { for (String compURI : node.getDeployableCompositeURIs(curi)) { node.startComposite(curi, compURI); } } } return node; }
public static List<String> getDependencies(String contributionURI, Map<String, ZipInputStream> possibles) throws ValidationException, IOException, ContributionReadException, XMLStreamException { Deployer deployer = TuscanyRuntime.newInstance().getDeployer();
public Shell(String domainURI, boolean useJLine) { this.runtime = TuscanyRuntime.newInstance(); this.useJline = useJLine; try { initCommands(); } catch (IOException e) { throw new RuntimeException(e); } if (domainURI != null) { domain(domainURI); } }
public boolean bye() { for (Node node : nodes.values()) { node.stop(); } runtime.stop(); for (Node node : standaloneNodes.values()) { node.stop(); } return false; }
boolean load(final String configXmlUrl) throws ContributionReadException, ActivationException, ValidationException { Node node = runtime.createNodeFromXML(configXmlUrl); currentDomain = node.getDomainName(); nodes.put(currentDomain, node); return true; }
boolean domainComposite() { Composite domainComposite = getNode().getDomainComposite(); System.out.println(Utils.modelToXML(domainComposite, true, runtime.getExtensionPointRegistry())); return true; }
/** * A helper method to run a standalone SCA composite in the default standalone SCA domain. * @param compositeURI URI within the contribution of a composite to run * if compositeURI is null then all deployable composites in the contribution will be run * @param contributionURL URL of the contribution * @param dependentContributionURLs optional URLs of dependent contributions * @return a Node with installed contributions */ public static Node runComposite(String compositeURI, String contributionURL, String... dependentContributionURLs) { return runComposite(null, compositeURI, contributionURL, dependentContributionURLs); }
TuscanyRuntime runtime = newInstance(); String domain = domainURI == null ? DEFAUL_DOMAIN_NAME : domainURI.toString(); DomainRegistry domainRegistry = runtime.domainRegistryFactory.getEndpointRegistry(domain, null);