diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java | 96 |
1 files changed, 58 insertions, 38 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java index fdf62b4bb2..28520cb2c1 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java @@ -31,51 +31,59 @@ import org.apache.tuscany.sca.contribution.Contribution; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.deployment.Deployer; import org.apache.tuscany.sca.monitor.ValidationException; -import org.apache.tuscany.sca.node2.impl.InstalledContribution; import org.apache.tuscany.sca.runtime.ActivationException; import org.oasisopen.sca.NoSuchServiceException; public interface Node { /** - * 4577 10.5.1 install Contribution & update Contribution - * 4578 Creates or updates an installed contribution with a supplied root contribution, and installed at a supplied - * 4579 base URI. A supplied dependent contribution list (<export/> elements) specifies the contributions that are - * 4580 used to resolve the dependencies of the root contribution and other dependent contributions. These - * 4581 override any dependent contributions explicitly listed via the @location attribute in the import statements - * 4582 of the contribution. - * 4583 SCA follows the simplifying assumption that the use of a contribution for resolving anything also means - * 4584 that all other exported artifacts can be used from that contribution. Because of this, the dependent - * 4585 contribution list is just a list of installed contribution URIs. There is no need to specify what is being used - * 4586 from each one. - * 4587 Each dependent contribution is also an installed contribution, with its own dependent contributions. By - * 4588 default these dependent contributions of the dependent contributions (which we will call indirect - * 4589 dependent contributions) are included as dependent contributions of the installed contribution. However, - * 4590 if a contribution in the dependent contribution list exports any conflicting definitions with an indirect - * 4591 dependent contribution, then the indirect dependent contribution is not included (i.e. the explicit list - * 4592 overrides the default inclusion of indirect dependent contributions). Also, if there is ever a conflict - * 4593 between two indirect dependent contributions, then the conflict MUST be resolved by an explicit entry in - * 4594 the dependent contribution list. - * 4595 [ASM12009] - * 4596 Note that in many cases, the dependent contribution list can be generated. In particular, if the creator of - * 4597 a Domain is careful to avoid creating duplicate definitions for the same qualified name, then it is easy for - * 4598 this list to be generated by tooling. * - * @param uri - * @param contributionURL + * Creates an installed contribution from a supplied root contribution and installed at a supplied base URI. + * See section 10.5.1 of the Assembly Specification. + * + * @param uri the base uri of where to install the contribution + * @param contributionURL the URL where the contribution is located + * @param metaDataURL the location of an optional generated Contribution Metadata Document. See section 10.2.2 + * of the Assembly Specification. May be null. + * @param dependentContributionURIs specifies the contributions that are used to resolve the dependencies of the + * root contribution and other dependent contributions. May be null. + * @param runDeployables true if the composites defined as deployable in the contributions sca-contribution.xml + * file or supplied metaData file should be run, false if they should not be. + * * @throws ContributionReadException * @throws ActivationException * @throws ValidationException */ - void installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException; - void installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException; + void installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException; + /** + * Creates an installed contribution from a supplied Contribution object. + * See section 10.5.1 of the Assembly Specification. + * + * @param contribution the Contribution object + * @param dependentContributionURIs specifies the contributions that are used to resolve the dependencies of the + * root contribution and other dependent contributions. May be null. + * @param runDeployables true if the composites defined as deployable in the contributions sca-contribution.xml + * file or supplied metaData file should be run, false if they should not be. + * + * @throws ContributionReadException + * @throws ActivationException + * @throws ValidationException + */ + void installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException; + + /** + * Creates an installed contribution from a supplied root contribution. + * See section 10.5.1 of the Assembly Specification. + * + * @param contributionURL the URL where the contribution is located + * @return the URI where the contribution was installed + * + * @throws ContributionReadException + * @throws ActivationException + * @throws ValidationException + */ String installContribution(String contributionURL) throws ContributionReadException, ActivationException, ValidationException; - /* Useful short forms of that for when you don't care or have the others (but leave out for now to keep as simple as possible): - void installContribution(String uri, String contributionURL) throws ContributionReadException, ActivationException, ValidationException; - String installContribution(String contributionURL, boolean autoDeploy) throws ContributionReadException, ActivationException, ValidationException; - */ - /** * 4577 10.5.1 install Contribution & update Contribution * 4578 Creates or updates an installed contribution with a supplied root contribution, and installed at a supplied @@ -210,7 +218,7 @@ public interface Node { * 4700 wsdl:PortTypeportType). The result is a single definition, in whatever form is appropriate for that * 4701 definition type. * 4702 Note that this, like all the other domain-level operations, is a conceptual operation. Its capabilities need to - * 4703 exist in some form, but not necessarily as a service operation with exactly this signature. * + * 4703 exist in some form, but not necessarily as a service operation with exactly this signature. * @param contributionURI * @param definition * @param symbolSpace @@ -228,11 +236,23 @@ public interface Node { */ <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException; - /* do we also need these following ones that are mentioned only indirectly in the spec? */ - + /** + * Get a contributions deployed composites. + * @param contributionURI the contribution URI + * @return the List of deployed composites + */ List<String> getDeployedCompostes(String contributionURI); + + /** + * Get the URIs of all the contributions installed on this Node + * @return the list of installed contribution URIs + */ List<String> getInstalledContributions(); - InstalledContribution getInstalledContribution(String uri); - Deployer getDeployer(); - AssemblyFactory getAssemblyFactory(); + + /** + * Get an installed Contribution + * @param uri the URI of the contribution + * @return the Contribution + */ + Contribution getInstalledContribution(String uri); } |