You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/10/04 15:40:56 UTC
svn commit: r581897 [4/4] - in /incubator/tuscany/java/sca:
distribution/webapp/src/main/java/org/apache/tuscany/sca/webapp/
itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/
modules/ modules/binding-sca-axis2/src/main/ja...
Modified: incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java Thu Oct 4 06:40:50 2007
@@ -21,6 +21,10 @@
import java.net.URI;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -28,90 +32,55 @@
import org.apache.tuscany.sca.assembly.AssemblyFactory;
import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.DeployedArtifact;
import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl;
import org.apache.tuscany.sca.contribution.service.ContributionService;
import org.apache.tuscany.sca.core.assembly.ActivationException;
-import org.apache.tuscany.sca.core.context.ServiceReferenceImpl;
-import org.apache.tuscany.sca.domain.DomainManagerService;
import org.apache.tuscany.sca.domain.SCADomain;
-import org.apache.tuscany.sca.domain.SCADomainService;
-import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
import org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.node.ComponentManager;
-import org.apache.tuscany.sca.node.ContributionManager;
-import org.apache.tuscany.sca.node.NodeManagerInitService;
+import org.apache.tuscany.sca.node.NodeException;
+import org.apache.tuscany.sca.node.NodeFactoryImpl;
+import org.apache.tuscany.sca.node.SCADomainFinder;
import org.apache.tuscany.sca.node.SCANode;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentContext;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.osoa.sca.CallableReference;
-import org.osoa.sca.ServiceReference;
-import org.osoa.sca.ServiceRuntimeException;
/**
* A local representation of the sca domain running on a single node
*
* @version $Rev: 552343 $ $Date: 2007-09-09 23:54:46 +0100 (Sun, 09 Sep 2007) $
*/
-public class SCANodeImpl extends SCADomain implements SCANode {
+public class SCANodeImpl implements SCANode {
private final static Logger logger = Logger.getLogger(SCANodeImpl.class.getName());
-
- public final static String LOCAL_DOMAIN_URI = "standalonedomain";
- public final static String LOCAL_NODE_URI = "standalonenode";
-
- private boolean isStandalone = false;
-
- // the domain used by the node to talk to the rest of the domain
- private EmbeddedSCADomain managementRuntime;
-
- // class loader used to get the runtime going
- private ClassLoader domainClassLoader;
-
+
// class loader used to get application resources
- private ClassLoader applicationClassLoader;
+ private ClassLoader nodeClassLoader;
- // representation of the private state of the node that the domain is running on
- private String domainUri;
- private URL domainUrl;
- private String nodeUri;
- private URL nodeUrl;
+ // identity and endpoints for the node and the domain it belongs to
+ private String nodeURI;
+ private URL nodeURL;
+ private String domainURI;
+ private URL domainURL;
+
+ // The tuscany runtime that does the hard work
private ReallySmallRuntime nodeRuntime;
+
+ // the top level components in this node. A subset of the the domain level composite
private Composite nodeComposite;
- // the managers used to control the domain node
- private ComponentManagerServiceImpl componentManager;
- private ContributionManagerImpl contributionManager;
-
- // the proxies to the domain
- private SCADomainService scaDomain;
- private DomainManagerService domainManager;
- private NodeManagerInitService nodeManagerInit;
+ // the domain that the node belongs to. This object acts as a proxy to the domain
+ private SCADomain scaDomain;
+
+ // collection for managing contributions that have been added to the node
+ private Map<String, Contribution> contributions = new HashMap<String, Contribution>();
+ private Map<QName, Composite> composites = new HashMap<QName, Composite>();
+ private List<QName> compositesToStart = new ArrayList<QName>();
// methods defined on the implementation only
-
- /**
- * Default constructor creates a standalone node with no connectivity to a wider
- * domain and no local web page.
- */
- public SCANodeImpl()
- throws ActivationException {
- this.domainUri = LOCAL_DOMAIN_URI ;
- this.nodeUri = LOCAL_NODE_URI;
- this.domainClassLoader = SCANodeImpl.class.getClassLoader();
- this.applicationClassLoader = Thread.currentThread().getContextClassLoader();
- this.isStandalone = true;
- init();
- }
/**
* Creates a node connected to a wider domain. To find its place in the domain
@@ -121,13 +90,10 @@
* @param nodeUri - if this is a url it is assumed that this will be used as root url for management components, e.g. http://localhost:8082
* @throws ActivationException
*/
- public SCANodeImpl(String domainUri, String nodeUri)
- throws ActivationException {
- this.domainUri = domainUri;
- this.nodeUri = nodeUri;
- this.domainClassLoader = SCANodeImpl.class.getClassLoader();
- this.applicationClassLoader = Thread.currentThread().getContextClassLoader();
- this.isStandalone = LOCAL_DOMAIN_URI.equals(domainUri);
+ public SCANodeImpl(String nodeURI, String domainURI) throws NodeException {
+ this.domainURI = domainURI;
+ this.nodeURI = nodeURI;
+ this.nodeClassLoader = Thread.currentThread().getContextClassLoader();
init();
}
@@ -140,55 +106,11 @@
* @param cl - the ClassLoader to use for loading system resources for the node
* @throws ActivationException
*/
- public SCANodeImpl(String domainUri, String nodeUri, ClassLoader cl)
- throws ActivationException {
- this.domainUri = domainUri;
- this.nodeUri = nodeUri;
- this.domainClassLoader = cl;
- this.applicationClassLoader = Thread.currentThread().getContextClassLoader();
- this.isStandalone = LOCAL_DOMAIN_URI.equals(domainUri);
- init();
- }
-
- /**
- * Creates a node connected to a wider domain and allows a classpath to be specified.
- * To find its place in the domain node and domain identifiers must be provided.
- *
- * @param domainUri - identifies what host and port the domain service is running on, e.g. http://localhost:8081
- * @param nodeUri - if this is a url it is assumed that this will be used as root url for management components, e.g. http://localhost:8082
- * @param cl - the ClassLoader to use for loading system resources for the node
- * @param applicationCl - the ClassLoader to use for loading application resources for the node
- * @throws ActivationException
- */
- public SCANodeImpl(String domainUri, String nodeUri, ClassLoader cl, ClassLoader applicationCl, String contributionPath, String[] composites)
- throws ActivationException {
- this.domainUri = domainUri;
- this.nodeUri = nodeUri;
- this.domainClassLoader = cl;
- this.applicationClassLoader = applicationCl;
- this.isStandalone = LOCAL_DOMAIN_URI.equals(domainUri);
+ public SCANodeImpl(String nodeURI, String domainURI, ClassLoader cl) throws NodeException {
+ this.domainURI = domainURI;
+ this.nodeURI = nodeURI;
+ this.nodeClassLoader = cl;
init();
- start();
-
- try {
- URL contributionURL = SCANodeUtil.findContributionURLFromCompositeNameOrPath(applicationClassLoader, contributionPath, composites);
-
- contributionManager.addContribution(contributionURL);
-
- if (composites.length > 0 ){
- for(int i = 0; i < composites.length; i++) {
- contributionManager.addComposite(composites[i]);
- contributionManager.startComposite(composites[i]);
- }
- } else {
- contributionManager.addAllComposites(contributionURL);
- contributionManager.startAllComposites(contributionURL);
- }
-
- } catch(Exception ex) {
- throw new ActivationException(ex);
- }
-
}
/**
@@ -196,348 +118,226 @@
* get domain information. This all depends on whether there is a management
* composite on the classpath
*/
- private void init()
- throws ActivationException {
+ private void init() throws NodeException {
try {
// create a node runtime for the domain contributions to run on
- nodeRuntime = new ReallySmallRuntime(domainClassLoader);
+ nodeRuntime = new ReallySmallRuntime(nodeClassLoader);
+
+ // Start the runtime
+ nodeRuntime.start();
+
+ // Create an in-memory domain level composite
+ AssemblyFactory assemblyFactory = nodeRuntime.getAssemblyFactory();
+ nodeComposite = assemblyFactory.createComposite();
+ nodeComposite.setName(new QName(Constants.SCA10_NS, "node"));
+ nodeComposite.setURI(nodeURI);
+
+ // add the top level composite into the composite activator
+ nodeRuntime.getCompositeActivator().setDomainComposite(nodeComposite);
- // Check if node has been given a domain name to connect to
- if (isStandalone) {
- logger.log(Level.INFO, "Domain node will be started stand-alone as node and domain URIs are not provided");
- managementRuntime = null;
- scaDomain = null;
- } else {
- // check where domain and node uris are urls, they will be used to configure various
- // endpoints if they are
- URI tmpURI;
- try {
- tmpURI = new URI(domainUri);
- if (tmpURI.isAbsolute()){
- domainUrl = tmpURI.toURL();
- }
- } catch(Exception ex) {
- throw new ActivationException("domain uri " +
- domainUri +
- "must be a valid url");
- }
-
- try {
- tmpURI = new URI(nodeUri);
- if (tmpURI.isAbsolute()){
- nodeUrl = tmpURI.toURL();
- }
- } catch(Exception ex) {
- nodeUrl = null;
+ // check whether node uri is an absolute url,
+ try {
+ URI tmpURI = new URI(nodeURI);
+ if (tmpURI.isAbsolute()){
+ nodeURL = tmpURI.toURL();
}
-
- createManagementNode();
+ } catch(Exception ex) {
+ nodeURL = null;
}
- } catch(ActivationException ex) {
- throw ex;
+
+ // create a link to the domain
+ scaDomain = SCADomainFinder.newInstance().getSCADomain(domainURI);
+
+ // add the node to the domain
+ ((SCADomainImpl)scaDomain).addNode(this);
+
+
+ // make the node available to the model.
+ // TODO - No sure how this should be done properly. As a nod to this though
+ // I have a domain factory which always returns the same domain
+ // object. I.e. this node
+ ModelFactoryExtensionPoint factories = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
+ NodeFactoryImpl domainFactory = new NodeFactoryImpl(this);
+ factories.addFactory(domainFactory);
+
} catch(Exception ex) {
- throw new ActivationException(ex);
+ throw new NodeException(ex);
}
}
- private void createManagementNode()
- throws ActivationException {
- try {
- // create a runtime for components to run on that will be used for talking to the
- // rest of the domain. The components are defined in the node.composite file
- String nodeCompositeName = "node.composite";
- URL contributionURL = SCANodeUtil.findContributionURLFromCompositeNameOrPath(domainClassLoader, null, new String[]{nodeCompositeName} );
-
- if ( contributionURL != null ){
- logger.log(Level.INFO, "Node management configured from " + contributionURL);
-
- // start a local domain in order to talk to the logical domain
- managementRuntime = new EmbeddedSCADomain(domainClassLoader, "node");
- managementRuntime.start();
-
- // add node composite to the management domain
- ContributionService contributionService = managementRuntime.getContributionService();
- Contribution contribution = null;
-
- contribution = contributionService.contribute(nodeUri,
- contributionURL,
- false);
-
- if (contribution.getDeployables().size() != 0) {
- Composite composite = contribution.getDeployables().get(0);
-
- managementRuntime.getDomainComposite().getIncludes().add(composite);
- managementRuntime.getCompositeBuilder().build(composite);
-
- // deal with the special case of registering the node manager service
- // in service discovery. It's not on an SCA binding.
- // TODO - really want to be able to hand out service references but they
- // don't serialize out over web services yet.
- SCANodeUtil.fixUpNodeServiceUrls(managementRuntime.getDomainComposite().getIncludes().get(0).getComponents(), nodeUrl);
- SCANodeUtil.fixUpNodeReferenceUrls(managementRuntime.getDomainComposite().getIncludes().get(0).getComponents(), domainUrl);
-
- managementRuntime.getCompositeActivator().activate(composite);
- managementRuntime.getCompositeActivator().start(composite);
-
- // get the management components out of the domain so that they
- // can be configured/used.
- scaDomain = managementRuntime.getService(SCADomainService.class, "SCADomainComponent");
- domainManager = managementRuntime.getService(DomainManagerService.class, "DomainManagerComponent");
- nodeManagerInit = managementRuntime.getService(NodeManagerInitService.class, "NodeManagerComponent/NodeManagerInitService");
-
- // Now get the uri back out of the component now it has been built and started
- // TODO - this doesn't pick up the url from external hosting environments
- String nodeManagerUrl = SCANodeUtil.getNodeManagerServiceUrl(managementRuntime.getDomainComposite().getIncludes().get(0).getComponents());
-
- if (nodeManagerUrl != null) {
- if (isStandalone == false){
- try {
-
- scaDomain.registerServiceEndpoint(domainUri,
- nodeUri,
- nodeUri + "NodeManagerService",
- "",
- nodeManagerUrl);
-
- } catch(Exception ex) {
- logger.log(Level.SEVERE,
- "Can't connect to domain manager at: " +
- domainUrl);
- throw new ActivationException(ex);
- }
- }
- }
-
- } else {
- throw new ActivationException("Node management contribution " +
- contributionURL +
- " found but could not be loaded");
+ // temp methods to help integrate with existing code
+
+ public ReallySmallRuntime getNodeRuntime() {
+ return nodeRuntime;
+ }
+
+ public Component getComponent(String componentName) {
+ for (Composite composite: nodeComposite.getIncludes()) {
+ for (Component component: composite.getComponents()) {
+ if (component.getName().equals(componentName)) {
+ return component;
}
- } else {
- throw new ActivationException("Node management contribution " +
- nodeCompositeName +
- " not found on the classpath");
}
- } catch(ActivationException ex) {
- throw ex;
- } catch(Exception ex) {
- throw new ActivationException(ex);
}
- }
-
-
- // methods that implement interfaces
+ return null;
+ }
- public void start() throws ActivationException {
- // Start the runtime
- nodeRuntime.start();
-
- // Create an in-memory domain level composite
- AssemblyFactory assemblyFactory = nodeRuntime.getAssemblyFactory();
- nodeComposite = assemblyFactory.createComposite();
- nodeComposite.setName(new QName(Constants.SCA10_NS, "domain"));
- nodeComposite.setURI(domainUri);
-
- // add the top level composite into the composite activator
- nodeRuntime.getCompositeActivator().setDomainComposite(nodeComposite);
-
- // make the domain available to the model.
- // TODO - No sure how this should be done properly. As a nod to this though
- // I have a domain factory which always returns the same domain
- // object. I.e. this node
- ModelFactoryExtensionPoint factories = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
- NodeFactoryImpl domainFactory = new NodeFactoryImpl(this);
- factories.addFactory(domainFactory);
-
- // create the domain node managers
- componentManager = new ComponentManagerServiceImpl(domainUri, nodeUri, nodeComposite, nodeRuntime);
- contributionManager = new ContributionManagerImpl(domainUri, nodeUri, nodeComposite, nodeRuntime, applicationClassLoader, null);
-
- if (isStandalone == false){
- // pass this object into the node manager
- nodeManagerInit.setNode((SCANode)this);
-
- try {
- // go out and add this node to the wider domain
- domainManager.registerNode(domainUri, nodeUri);
- } catch(Exception ex) {
- logger.log(Level.SEVERE,
- "Can't connect to domain manager at: " +
- domainUrl);
- throw new ActivationException(ex);
- }
+ public List<Component> getComponents() {
+ List<Component> components = new ArrayList<Component>();
+ for (Composite composite: nodeComposite.getIncludes()) {
+ components.addAll(composite.getComponents());
}
+ return components;
+ }
+
+
+ // API methods
+
+ public void start() throws NodeException {
+ startComposites();
}
- @Override
- public void close() {
+ public void stop() throws NodeException {
try {
- stop();
- } catch (Exception ex) {
- throw new ServiceRuntimeException(ex);
- }
- }
+ // stop the composite
+ stopComposites();
+
+ // remove contributions
+ removeContributions();
- public void stop() throws ActivationException {
- // stop the components
-
- // remove contributions
-
- // Stop the node
- nodeRuntime.stop();
-
- // Cleanup the top level composite
- nodeComposite = null;
-
- // remove the manager objects
-
- // go out and remove this node from the wider domain
- if (isStandalone == false){
- try {
- domainManager.removeNode(domainUri, nodeUri);
- } catch(Exception ex) {
- logger.log(Level.SEVERE,
- "Can't connect to domain manager at: " +
- domainUrl);
- throw new ActivationException(ex);
- }
+
+ } catch (Exception ex) {
+ throw new NodeException(ex);
}
}
public String getURI(){
- return domainUri;
- }
-
- public String getDomainURI(){
- return domainUri;
+ return nodeURI;
}
- public String getNodeURI(){
- return nodeUri;
- }
+ public SCADomain getDomain(){
+ return scaDomain;
+ }
- public URL getDomainURL(){
- return domainUrl;
+ public void addContribution(String contributionURI, URL contributionURL) throws NodeException {
+ addContribution(contributionURI, contributionURL, null);
}
- public URL getNodeURL(){
- return nodeUrl;
- }
-
- public ComponentManager getComponentManager() {
- return componentManager;
- }
-
- public ContributionManager getContributionManager() {
- return contributionManager;
- }
-
+ public void addContribution(String contributionURI, URL contributionURL, ClassLoader contributionClassLoader ) throws NodeException {
+ try {
+ // check to see if the node has been started and start it if it hasn't
+ if ( nodeComposite == null ) {
+ start();
+ }
+
+ if (contributionURL != null) {
+ ModelResolver modelResolver = null;
+
+ // if the contribution is to be resolved using a separate class loader
+ // then create a new model resolver
+ if (contributionClassLoader != null) {
+ modelResolver = new ModelResolverImpl(contributionClassLoader);
+ }
+
+ // Add the contribution to the node
+ ContributionService contributionService = nodeRuntime.getContributionService();
+ Contribution contribution = contributionService.contribute(contributionURI,
+ contributionURL,
+ modelResolver,
+ false);
+
+ contributions.put(contributionURI, contribution);
+
+ for (DeployedArtifact artifact : contribution.getArtifacts()) {
+ if (artifact.getModel() instanceof Composite) {
+ Composite composite = (Composite)artifact.getModel();
+ composites.put(composite.getName(), composite);
+ }
+ }
- /**
- * Return an interface for registering local services and for
- * finding remote services
- *
- * @return The service discovery interface
- */
- public SCADomainService getDomainService(){
- return scaDomain;
- }
-
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- return (R)nodeRuntime.getProxyFactory().cast(target);
+ } else {
+ throw new ActivationException("Contribution " + contributionURL + " not found");
+ }
+ } catch (Exception ex) {
+ throw new NodeException(ex);
+ }
}
- public <B> B getService(Class<B> businessInterface, String serviceName) {
- ServiceReference<B> serviceReference = getServiceReference(businessInterface, serviceName);
- if (serviceReference == null) {
- throw new ServiceRuntimeException("Service not found: " + serviceName);
- }
- return serviceReference.getService();
+ private void removeContributions() throws NodeException {
+ try {
+ // Remove all contributions
+ for (String contributionURI : contributions.keySet()){
+ nodeRuntime.getContributionService().remove(contributionURI);
+ contributions.remove(contributionURI);
+ }
+ } catch (Exception ex) {
+ throw new NodeException(ex);
+ }
}
-
- private <B> ServiceReference<B> createServiceReference(Class<B> businessInterface, String targetURI) {
- try {
- AssemblyFactory assemblyFactory = nodeRuntime.getAssemblyFactory();
- Composite composite = assemblyFactory.createComposite();
- composite.setName(new QName(Constants.SCA10_TUSCANY_NS, "default"));
- RuntimeComponent component = (RuntimeComponent)assemblyFactory.createComponent();
- component.setName("default");
- component.setURI("default");
- nodeRuntime.getCompositeActivator().configureComponentContext(component);
- composite.getComponents().add(component);
- RuntimeComponentReference reference = (RuntimeComponentReference)assemblyFactory.createComponentReference();
- reference.setName("default");
- ModelFactoryExtensionPoint factories =
- nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
- JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
- InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(businessInterface));
- reference.setInterfaceContract(interfaceContract);
- component.getReferences().add(reference);
- reference.setComponent(component);
- SCABindingFactory scaBindingFactory = factories.getFactory(SCABindingFactory.class);
- SCABinding binding = scaBindingFactory.createSCABinding();
- binding.setURI(targetURI);
- reference.getBindings().add(binding);
- return new ServiceReferenceImpl<B>(businessInterface, component, reference, binding, nodeRuntime
- .getProxyFactory(), nodeRuntime.getCompositeActivator());
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
+
+ public void startComposite(QName compositeName) throws NodeException {
+ compositesToStart.add(compositeName);
}
+
+ private void startComposites() throws NodeException {
+ try {
+ if (compositesToStart.size() == 0 ){
+ throw new NodeException("Starting node " +
+ nodeURI +
+ " with no composite started");
+ }
+
+ for (QName compositeName : compositesToStart) {
+ Composite composite = composites.get(compositeName);
+
+ if (composite == null) {
+ logger.log(Level.INFO, "Composite not found: " + compositeName);
+ } else {
+ // Add the composite to the top level domain
+ nodeComposite.getIncludes().add(composite);
+ nodeRuntime.getCompositeBuilder().build(composite);
+
+ // activate the composite
+ nodeRuntime.getCompositeActivator().activate(composite);
+
+ //start the composite
+ nodeRuntime.getCompositeActivator().start(composite);
+ }
+ }
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String name) {
-
- // Extract the component name
- String componentName;
- String serviceName;
- int i = name.indexOf('/');
- if (i != -1) {
- componentName = name.substring(0, i);
- serviceName = name.substring(i + 1);
-
- } else {
- componentName = name;
- serviceName = null;
- }
-
- // Lookup the component in the domain
- Component component = componentManager.getComponent(componentName);
- if (component == null) {
- // The component is not local in the partition, try to create a remote service ref
- return createServiceReference(businessInterface, name);
- }
- RuntimeComponentContext componentContext = null;
+ } catch (NodeException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new NodeException(ex);
+ }
+ }
- // If the component is a composite, then we need to find the
- // non-composite component that provides the requested service
- if (component.getImplementation() instanceof Composite) {
- for (ComponentService componentService : component.getServices()) {
- if (serviceName == null || serviceName.equals(componentService.getName())) {
- CompositeService compositeService = (CompositeService)componentService.getService();
- if (compositeService != null) {
- if (serviceName != null) {
- serviceName = "$promoted$." + serviceName;
- }
- componentContext =
- ((RuntimeComponent)compositeService.getPromotedComponent()).getComponentContext();
- return componentContext.createSelfReference(businessInterface, compositeService
- .getPromotedService());
- }
- break;
- }
+ private void stopComposites() throws NodeException {
+
+ try {
+ if (compositesToStart.size() == 0 ){
+ throw new NodeException("Stopping node " +
+ nodeURI +
+ " with no composite started");
}
- // No matching service is found
- throw new ServiceRuntimeException("Composite service not found: " + name);
- } else {
- componentContext = ((RuntimeComponent)component).getComponentContext();
- if (serviceName != null) {
- return componentContext.createSelfReference(businessInterface, serviceName);
- } else {
- return componentContext.createSelfReference(businessInterface);
+ for (QName compositeName : compositesToStart) {
+ Composite composite = composites.get(compositeName);
+
+ nodeRuntime.getCompositeActivator().stop(composite);
+ nodeRuntime.getCompositeActivator().deactivate(composite);
+
+ composites.remove(compositeName);
}
- }
- }
+
+ compositesToStart.clear();
+ } catch (NodeException ex) {
+ throw ex;
+
+ } catch (Exception ex) {
+ throw new NodeException(ex);
+ }
+ }
+
}
Modified: incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeUtil.java?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeUtil.java (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeUtil.java Thu Oct 4 06:40:50 2007
@@ -57,80 +57,7 @@
* @return the contribution URL
* @throws MalformedURLException
*/
-/* original version
- public static URL findContributionURLFromCompositeNameOrPath(ClassLoader classLoader, String contributionPath, String[] composites)
- throws MalformedURLException {
- if (contributionPath != null && contributionPath.length() > 0) {
- //encode spaces as they would cause URISyntaxException
- contributionPath = contributionPath.replace(" ", "%20");
- URI contributionURI = URI.create(contributionPath);
- if (contributionURI.isAbsolute() || composites.length == 0) {
- return new URL(contributionPath);
- }
- }
-
- String contributionArtifactPath = null;
- URL contributionArtifactURL = null;
- if (composites != null && composites.length > 0 && composites[0].length() > 0) {
-
- // Here the SCADomain was started with a reference to a composite file
- contributionArtifactPath = composites[0];
- contributionArtifactURL = classLoader.getResource(contributionArtifactPath);
- if (contributionArtifactURL == null) {
- throw new IllegalArgumentException("Composite not found: " + contributionArtifactPath);
- }
- } else {
-
- // Here the SCANode was started without any reference to a composite file
- // We are going to look for an sca-contribution.xml or sca-contribution-generated.xml
-
- // Look for META-INF/sca-contribution.xml
- contributionArtifactPath = Contribution.SCA_CONTRIBUTION_META;
- contributionArtifactURL = classLoader.getResource(contributionArtifactPath);
-
- // Look for META-INF/sca-contribution-generated.xml
- if (contributionArtifactURL == null) {
- contributionArtifactPath = Contribution.SCA_CONTRIBUTION_GENERATED_META;
- contributionArtifactURL = classLoader.getResource(contributionArtifactPath);
- }
-
- // Look for META-INF/sca-deployables directory
- if (contributionArtifactURL == null) {
- contributionArtifactPath = Contribution.SCA_CONTRIBUTION_DEPLOYABLES;
- contributionArtifactURL = classLoader.getResource(contributionArtifactPath);
- }
- }
-
- if (contributionArtifactURL == null) {
- throw new IllegalArgumentException("Can't determine contribution deployables. Either specify a composite file, or use an sca-contribution.xml file to specify the deployables.");
- }
-
- URL contributionURL = null;
- // "jar:file://....../something.jar!/a/b/c/app.composite"
- try {
- String url = contributionArtifactURL.toExternalForm();
- String protocol = contributionArtifactURL.getProtocol();
- if ("file".equals(protocol)) {
- // directory contribution
- if (url.endsWith(contributionArtifactPath)) {
- String location = url.substring(0, url.lastIndexOf(contributionArtifactPath));
- // workaround from evil url/uri form maven
- contributionURL = FileHelper.toFile(new URL(location)).toURI().toURL();
- }
-
- } else if ("jar".equals(protocol)) {
- // jar contribution
- String location = url.substring(4, url.lastIndexOf("!/"));
- // workaround for evil url/uri from maven
- contributionURL = FileHelper.toFile(new URL(location)).toURI().toURL();
- }
- } catch (MalformedURLException mfe) {
- throw new IllegalArgumentException(mfe);
- }
-
- return contributionURL;
- }
- */
+
public static URL findContributionURLFromCompositeNameOrPath(ClassLoader classLoader, String contributionPath, String[] composites)
throws MalformedURLException {
@@ -214,51 +141,6 @@
return contributionURL;
}
-
- /**
- * Given the name of a composite this method finds the contribution that it belongs to
- * this could be either a local directory of a jar file.
- *
- * @param classLoader
- * @param compositeString
- * @return the contribution URL
- * @throws MalformedURLException
- */
-/*
- public static URL findContributionFromComposite(ClassLoader classLoader, String compositeString)
- throws MalformedURLException {
-
- URL contributionURL = classLoader.getResource(compositeString);
-
- if ( contributionURL != null ){
- String contributionString = contributionURL.toExternalForm();
- int jarPosition = contributionString.indexOf(".jar");
-
- if (jarPosition> -1){
- // if the node dir is in a jar just contribute the name of the jar file
- // rather the name of the directory in the jar file.
- // changing
- // jar:file:/myjarfile.jar!/contributiondir
- // to
- // file:/myjarfile.jar
- contributionString = contributionString.substring(0, jarPosition + 4);
- contributionString = contributionString.substring(4);
- contributionURL = new URL(contributionString);
- } else {
- // Assume the node.composite file is in a directory so find the directory name
- // changing
- // file:/mydir/node.composite
- // to
- // file:/mydir
- int compositePosition = contributionString.indexOf(compositeString);
- contributionString = contributionString.substring(0, compositePosition);
- contributionURL = new URL(contributionString);
- }
- }
-
- return contributionURL;
- }
-*/
/**
* A rather ugly method to find and fix the url of the service, assuming that there
Modified: incubator/tuscany/java/sca/modules/node-impl/src/main/resources/node.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/resources/node.composite?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/main/resources/node.composite (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/main/resources/node.composite Thu Oct 4 06:40:50 2007
@@ -30,6 +30,15 @@
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
name="Management">
+
+ <component name="DomainManagerComponent">
+ <implementation.java class="org.apache.tuscany.sca.node.impl.DomainManagerServiceImpl"/>
+ <reference name="domainManager">
+ <interface.java interface="org.apache.tuscany.sca.domain.DomainManagerService"/>
+ <binding.ws uri="http://localhost:8878/DomainManagerComponent/DomainManager"/>
+ </reference>
+ </component>
+
<component name="NodeManagerComponent">
<implementation.java class="org.apache.tuscany.sca.node.impl.NodeManagerServiceImpl"/>
<service name="NodeManagerInitService">
@@ -38,28 +47,13 @@
</service>
<service name="NodeManagerService">
<interface.java interface="org.apache.tuscany.sca.node.NodeManagerService"/>
- <tuscany:binding.jsonrpc uri="http://localhost:8878/NodeManagerComponent/NodeManagerJson"/>
+ <binding.ws uri="http://localhost:8878/NodeManagerComponent/NodeManagerService"/>
</service>
<service name="ComponentManagerService">
<interface.java interface="org.apache.tuscany.sca.node.ComponentManagerService"/>
<tuscany:binding.jsonrpc uri="http://localhost:8878/NodeManagerComponent/ComponentManagerJson"/>
</service>
</component>
-
- <component name="DomainManagerComponent">
- <implementation.java class="org.apache.tuscany.sca.node.impl.DomainManagerServiceImpl"/>
- <reference name="domainManager">
- <interface.java interface="org.apache.tuscany.sca.domain.DomainManagerService"/>
- <binding.ws uri="http://localhost:8878/DomainManagerComponent/DomainManager"/>
- </reference>
- </component>
-
- <component name="SCADomainComponent">
- <implementation.java class="org.apache.tuscany.sca.node.impl.SCADomainServiceImpl" />
- <reference name="scaDomainService">
- <binding.ws uri="http://localhost:8878/SCADomainComponent/SCADomainService"/>
- </reference>
- </component>
<component name="node">
<tuscany:implementation.resource location="webroot"/>
@@ -67,6 +61,5 @@
<tuscany:binding.http uri="http://localhost:8878/node"/>
</service>
</component>
-
</composite>
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java?rev=581897&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java Thu Oct 4 06:40:50 2007
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.impl;
+
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.domain.SCADomain;
+import org.apache.tuscany.sca.domain.SCADomainFactory;
+import org.apache.tuscany.sca.node.SCADomainFinder;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import calculator.AddService;
+import calculator.CalculatorService;
+
+/**
+ * Runs a distributed domain in a single VM by using and in memory
+ * implementation of the distributed domain
+ */
+public class DomainDrivenTestCase {
+
+ private static String DEFAULT_DOMAIN_URI = "http://localhost:8877";
+
+ private static SCADomain domain;
+ private static SCANode nodeA;
+ private static SCANode nodeB;
+ private static SCANode nodeC;
+ private static CalculatorService calculatorServiceA;
+ private static CalculatorService calculatorServiceB;
+ private static AddService addServiceB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+
+ try {
+ System.out.println("Setting up domain");
+
+ SCADomainFactory domainFactory = SCADomainFactory.newInstance();
+ domain = domainFactory.createSCADomain(DEFAULT_DOMAIN_URI);
+ domain.start();
+
+ System.out.println("Setting up calculator nodes");
+
+ ClassLoader cl = DomainDrivenTestCase.class.getClassLoader();
+
+ SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
+
+ nodeA = nodeFactory.createSCANode("nodeA", DEFAULT_DOMAIN_URI);
+ nodeB = nodeFactory.createSCANode("nodeB", DEFAULT_DOMAIN_URI);
+ nodeC = nodeFactory.createSCANode("nodeC", DEFAULT_DOMAIN_URI);
+
+ domain.addContribution("nodeA", cl.getResource("nodeA/"));
+ domain.addContribution("nodeB", cl.getResource("nodeB/"));
+ domain.addContribution("nodeC", cl.getResource("nodeC/"));
+
+ domain.addComposite(new QName("http://sample", "Calculator"));
+
+ domain.startComposite(new QName("http://sample", "Calculator"));
+
+ // get a reference to various services in the domain
+ calculatorServiceA = nodeA.getDomain().getService(CalculatorService.class, "CalculatorServiceComponentA");
+ calculatorServiceB = nodeB.getDomain().getService(CalculatorService.class, "CalculatorServiceComponentB");
+
+ //addServiceB = domain.getService(AddService.class, "AddServiceComponentB");
+ addServiceB = nodeA.getDomain().getService(AddService.class, "AddServiceComponentB");
+
+ } catch(Exception ex){
+ System.err.println(ex.toString());
+ }
+
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ // stop the nodes and hence the domains they contain
+ nodeA.stop();
+ nodeB.stop();
+ nodeC.stop();
+ domain.stop();
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+
+ // Calculate
+ Assert.assertEquals(calculatorServiceA.add(3, 2), 5.0);
+ Assert.assertEquals(calculatorServiceA.subtract(3, 2), 1.0);
+ Assert.assertEquals(calculatorServiceA.multiply(3, 2), 6.0);
+ Assert.assertEquals(calculatorServiceA.divide(3, 2), 1.5);
+ Assert.assertEquals(calculatorServiceB.add(3, 2), 5.0);
+ Assert.assertEquals(calculatorServiceB.subtract(3, 2), 1.0);
+ Assert.assertEquals(calculatorServiceB.multiply(3, 2), 6.0);
+ Assert.assertEquals(calculatorServiceB.divide(3, 2), 1.5);
+ Assert.assertEquals(addServiceB.add(3, 2), 5.0);
+
+ }
+}
Copied: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java (from r580763, incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/InMemoryTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java?p2=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java&p1=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/InMemoryTestCase.java&r1=580763&r2=581897&rev=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/InMemoryTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java Thu Oct 4 06:40:50 2007
@@ -20,54 +20,80 @@
package org.apache.tuscany.sca.node.impl;
+import javax.xml.namespace.QName;
+
import junit.framework.Assert;
import org.apache.tuscany.sca.domain.SCADomain;
+import org.apache.tuscany.sca.domain.SCADomainFactory;
+import org.apache.tuscany.sca.node.SCADomainFinder;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import calculator.AddService;
import calculator.CalculatorService;
/**
* Runs a distributed domain in a single VM by using and in memory
* implementation of the distributed domain
*/
-public class InMemoryTestCase {
+public class NodeDrivenTestCase {
private static String DEFAULT_DOMAIN_URI = "http://localhost:8877";
- private static SCADomain registry;
- private static SCADomain domainNodeA;
- private static SCADomain domainNodeB;
- private static SCADomain domainNodeC;
+ private static SCADomain domain;
+ private static SCANode nodeA;
+ private static SCANode nodeB;
+ private static SCANode nodeC;
+ private static SCADomain domainProxy;
private static CalculatorService calculatorServiceA;
private static CalculatorService calculatorServiceB;
+ private static AddService addServiceB;
@BeforeClass
public static void init() throws Exception {
try {
- System.out.println("Setting up domain registry");
+ System.out.println("Setting up domain");
+
+ SCADomainFactory domainFactory = SCADomainFactory.newInstance();
+ domain= domainFactory.createSCADomain(DEFAULT_DOMAIN_URI);
+
+ System.out.println("Setting up calculator nodes");
- registry = SCADomain.newInstance("domain.composite");
+ ClassLoader cl = NodeDrivenTestCase.class.getClassLoader();
- System.out.println("Setting up calculator ");
-
- // Create the domain representation
- domainNodeA = SCADomain.newInstance(DEFAULT_DOMAIN_URI, "nodeA", null, "nodeA/Calculator.composite");
+ SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- // Create the domain representation
- domainNodeB = SCADomain.newInstance(DEFAULT_DOMAIN_URI, "nodeB", null, "nodeB/Calculator.composite");
+ nodeA = nodeFactory.createSCANode("nodeA", DEFAULT_DOMAIN_URI);
+ nodeA.addContribution("nodeA", cl.getResource("nodeA/"));
+ nodeA.startComposite(new QName("http://sample", "Calculator"));
+ nodeA.start();
- // create the node that runs the
- // subtract component
- domainNodeC = SCADomain.newInstance(DEFAULT_DOMAIN_URI, "nodeC", null, "nodeC/Calculator.composite");
-
- // get a reference to the calculator service from domainA
- // which will be running this component
- calculatorServiceA = domainNodeA.getService(CalculatorService.class, "CalculatorServiceComponent");
- calculatorServiceB = domainNodeB.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ nodeB = nodeFactory.createSCANode("nodeB", DEFAULT_DOMAIN_URI);
+ nodeB.addContribution("nodeB", cl.getResource("nodeB/"));
+ nodeB.startComposite(new QName("http://sample", "Calculator"));
+ nodeB.start();
+
+
+ nodeC = nodeFactory.createSCANode("nodeC", DEFAULT_DOMAIN_URI);
+ nodeC.addContribution("nodeC", cl.getResource("nodeC/"));
+ nodeC.startComposite(new QName("http://sample", "Calculator"));
+ nodeC.start();
+
+ SCADomainFinder domainFinder = SCADomainFinder.newInstance();
+ domainProxy = domainFinder.getSCADomain(DEFAULT_DOMAIN_URI);
+
+ // get a reference to various services in the domain
+ calculatorServiceA = nodeA.getDomain().getService(CalculatorService.class, "CalculatorServiceComponentA");
+ calculatorServiceB = nodeB.getDomain().getService(CalculatorService.class, "CalculatorServiceComponentB");
+
+ //addServiceB = domain.getService(AddService.class, "AddServiceComponentB");
+ addServiceB = nodeA.getDomain().getService(AddService.class, "AddServiceComponentB");
} catch(Exception ex){
System.err.println(ex.toString());
@@ -78,9 +104,9 @@
@AfterClass
public static void destroy() throws Exception {
// stop the nodes and hence the domains they contain
- domainNodeA.close();
- domainNodeB.close();
- domainNodeC.close();
+ nodeA.stop();
+ nodeB.stop();
+ nodeC.stop();
}
@Test
@@ -95,6 +121,7 @@
Assert.assertEquals(calculatorServiceB.subtract(3, 2), 1.0);
Assert.assertEquals(calculatorServiceB.multiply(3, 2), 6.0);
Assert.assertEquals(calculatorServiceB.divide(3, 2), 1.5);
+ Assert.assertEquals(addServiceB.add(3, 2), 5.0);
}
}
Modified: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/Calculator.composite?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/Calculator.composite (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/Calculator.composite Thu Oct 4 06:40:50 2007
@@ -22,19 +22,19 @@
xmlns:sample="http://sample"
name="Calculator">
- <component name="CalculatorServiceComponent">
+ <component name="CalculatorServiceComponentA">
<implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent"/>
- <reference name="divideService" target="DivideServiceComponent" />
+ <reference name="addService" target="AddServiceComponentB" />
+ <reference name="subtractService" target="SubtractServiceComponentC" />
+ <reference name="multiplyService" target="MultiplyServiceComponentA"/>
+ <reference name="divideService" target="DivideServiceComponentA" />
</component>
- <component name="MultiplyServiceComponent">
+ <component name="MultiplyServiceComponentA">
<implementation.java class="calculator.MultiplyServiceImpl" />
</component>
- <component name="DivideServiceComponent">
+ <component name="DivideServiceComponentA">
<implementation.java class="calculator.DivideServiceImpl" />
</component>
Modified: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeB/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeB/Calculator.composite?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeB/Calculator.composite (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeB/Calculator.composite Thu Oct 4 06:40:50 2007
@@ -22,23 +22,23 @@
xmlns:sample="http://sample"
name="Calculator">
- <component name="CalculatorServiceComponent">
+ <component name="CalculatorServiceComponentB">
<implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent"/>
- <reference name="divideService" target="DivideServiceComponent" />
+ <reference name="addService" target="AddServiceComponentB" />
+ <reference name="subtractService" target="SubtractServiceComponentC" />
+ <reference name="multiplyService" target="MultiplyServiceComponentB"/>
+ <reference name="divideService" target="DivideServiceComponentB" />
</component>
- <component name="MultiplyServiceComponent">
+ <component name="MultiplyServiceComponentB">
<implementation.java class="calculator.MultiplyServiceImpl" />
</component>
- <component name="DivideServiceComponent">
+ <component name="DivideServiceComponentB">
<implementation.java class="calculator.DivideServiceImpl" />
</component>
- <component name="AddServiceComponent">
+ <component name="AddServiceComponentB">
<implementation.java class="calculator.AddServiceImpl" />
</component>
Modified: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeC/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeC/Calculator.composite?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeC/Calculator.composite (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeC/Calculator.composite Thu Oct 4 06:40:50 2007
@@ -22,10 +22,10 @@
xmlns:sample="http://sample"
name="Calculator">
- <component name="SubtractServiceComponent">
+ <component name="SubtractServiceComponentC">
<implementation.java class="calculator.SubtractServiceImpl" />
<service name="SubtractService">
- <binding.sca uri="http://localhost:8086/SubtractServiceComponent"/>
+ <binding.sca uri="http://localhost:8086/SubtractServiceComponentC"/>
</service>
</component>
Modified: incubator/tuscany/java/sca/modules/node/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node/pom.xml?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/node/pom.xml Thu Oct 4 06:40:50 2007
@@ -65,7 +65,13 @@
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-domain-api</artifactId>
<version>1.1-incubating-SNAPSHOT</version>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ </dependency>
</dependencies>
Modified: incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/ComponentManagerService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/ComponentManagerService.java?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/ComponentManagerService.java (original)
+++ incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/ComponentManagerService.java Thu Oct 4 06:40:50 2007
@@ -47,20 +47,6 @@
*/
ComponentInfo getComponentInfo(String componentName);
- /**
- * Start a component, making it ready to receive messages
- *
- * @param componentName
- * @throws ActivationException
- */
- void startComponent(String componentName) throws ActivationException;
- /**
- * Stop a component
- *
- * @param componentName
- * @throws ActivationException
- */
- void stopComponent(String componentName) throws ActivationException;
}
Copied: incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/NodeFactoryImpl.java (from r580763, incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/NodeFactoryImpl.java?p2=incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/NodeFactoryImpl.java&p1=incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java&r1=580763&r2=581897&rev=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java (original)
+++ incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/NodeFactoryImpl.java Thu Oct 4 06:40:50 2007
@@ -17,9 +17,8 @@
* under the License.
*/
-package org.apache.tuscany.sca.node.impl;
+package org.apache.tuscany.sca.node;
-import org.apache.tuscany.sca.node.NodeFactory;
import org.apache.tuscany.sca.node.SCANode;
Modified: incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/NodeManagerService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/NodeManagerService.java?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/NodeManagerService.java (original)
+++ incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/NodeManagerService.java Thu Oct 4 06:40:50 2007
@@ -19,6 +19,11 @@
package org.apache.tuscany.sca.node;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.domain.SCADomain;
import org.osoa.sca.annotations.Remotable;
@@ -30,20 +35,37 @@
@Remotable
public interface NodeManagerService {
- /**
- * Return the Uri that identifies the node
+ /**
+ * Returns the URI of the SCA node. That URI is the endpoint of the
+ * SCA node administration service.
*
- * @return
+ * @return the URI of the SCA node
*/
- public String getNodeUri();
+ public String getURI();
/**
- * The configuration of a domain running on this node has changed.
- * It is the responsibility of the node to respond to this and retrieve
- * any relevent configuration changes
+ * Add an SCA contribution into the node.
*
- * @param domainUri the string uri for the distributed domain
+ * @param uri the URI of the contribution
+ * @param url the URL of the contribution
+ */
+ public void addContribution(String contributionURI, String contributionURL);
+
+ /**
+ * Start the specified deployable composite on the node.
+ *
+ * @param composite
+ */
+ public void startComposite(String compositeName);
+
+ /**
+ * Start the SCA node service.
+ */
+ public void start();
+
+ /**
+ * Stop the SCA node service.
*/
- // public void addContribution(String domainUri);
+ public void stop();
}
Added: incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/SCADomainProxySPI.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/SCADomainProxySPI.java?rev=581897&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/SCADomainProxySPI.java (added)
+++ incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/SCADomainProxySPI.java Thu Oct 4 06:40:50 2007
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node;
+
+import org.apache.tuscany.sca.domain.DomainException;
+import org.apache.tuscany.sca.domain.SCADomain;
+import org.apache.tuscany.sca.domain.SCADomainSPI;
+
+/**
+ * Represents an SCA domain.
+ *
+ * @version $Rev: 580520 $ $Date: 2007-09-29 00:50:25 +0100 (Sat, 29 Sep 2007) $
+ */
+public interface SCADomainProxySPI extends SCADomainSPI {
+
+ /**
+ * Add a node implementation to the domain proxy
+ *
+ * @param nodeImpl
+ * @throws DomainException
+ */
+ public void addNode(SCANode nodeImpl) throws DomainException;
+
+ /**
+ * Remove a node implementation from the domain proxy
+ *
+ * @param nodeImpl
+ * @throws DomainException
+ */
+ public void removeNode(SCANode nodeImpl) throws DomainException;
+
+}
\ No newline at end of file
Modified: incubator/tuscany/java/sca/modules/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/pom.xml?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/pom.xml Thu Oct 4 06:40:50 2007
@@ -111,6 +111,7 @@
<module>maven-java2wsdl</module>
<module>maven-wsdl2java</module>
<module>node</module>
+ <module>node-api</module>
<module>node-impl</module>
<module>policy</module>
<module>policy-xml</module>
Modified: incubator/tuscany/java/sca/samples/calculator-distributed/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-distributed/pom.xml?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-distributed/pom.xml (original)
+++ incubator/tuscany/java/sca/samples/calculator-distributed/pom.xml Thu Oct 4 06:40:50 2007
@@ -41,17 +41,16 @@
<artifactId>tuscany-host-embedded</artifactId>
<version>1.1-incubating-SNAPSHOT</version>
</dependency>
-
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
+ <artifactId>tuscany-node-api</artifactId>
<version>1.1-incubating-SNAPSHOT</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-domain-impl</artifactId>
+ <artifactId>tuscany-domain-api</artifactId>
<version>1.1-incubating-SNAPSHOT</version>
</dependency>
@@ -86,7 +85,21 @@
<artifactId>tuscany-host-tomcat</artifactId>
<version>1.1-incubating-SNAPSHOT</version>
<scope>test</scope>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-impl</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
Modified: incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/CalculatorNode.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/CalculatorNode.java?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/CalculatorNode.java (original)
+++ incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/CalculatorNode.java Thu Oct 4 06:40:50 2007
@@ -21,8 +21,11 @@
import java.io.IOException;
+import javax.xml.namespace.QName;
+
import org.apache.tuscany.sca.domain.SCADomain;
-import org.apache.tuscany.sca.node.impl.SCANodeImpl;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
import calculator.CalculatorService;
@@ -47,15 +50,21 @@
try {
String domainName = args[0];
String nodeName = args[1];
+
+ ClassLoader cl = CalculatorNode.class.getClassLoader();
- SCADomain domainNode = SCADomain.newInstance(domainName, nodeName, null, nodeName + "/Calculator.composite");
-
+ SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
+ SCANode node = nodeFactory.createSCANode(nodeName, domainName);
+ node.addContribution(nodeName, cl.getResource(nodeName + "/"));
+ node.startComposite(new QName("http://sample", "Calculator"));
+ node.start();
+
// nodeA is the head node and runs some tests while all other nodes
// simply listen for incoming messages
if ( nodeName.equals("nodeA") ) {
// do some application stuff
CalculatorService calculatorService =
- domainNode.getService(CalculatorService.class, "CalculatorServiceComponent");
+ node.getDomain().getService(CalculatorService.class, "CalculatorServiceComponent");
// Calculate
System.out.println("3 + 2=" + calculatorService.add(3, 2));
@@ -84,7 +93,7 @@
}
// stop the node and all the domains in it
- domainNode.close();
+ node.stop();
} catch(Exception ex) {
System.err.println("Exception in node - " + ex.getMessage());
Modified: incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/DomainNode.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/DomainNode.java?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/DomainNode.java (original)
+++ incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/DomainNode.java Thu Oct 4 06:40:50 2007
@@ -19,8 +19,7 @@
package node;
import org.apache.tuscany.sca.domain.SCADomain;
-import org.apache.tuscany.sca.node.impl.SCANodeImpl;
-import org.apache.tuscany.sca.node.impl.SCANodeUtil;
+import org.apache.tuscany.sca.domain.SCADomainFactory;
/**
@@ -30,20 +29,24 @@
*/
public class DomainNode {
+ private static String DEFAULT_DOMAIN_URI = "http://localhost:8877";
+
public static void main(String[] args) {
try {
- SCADomain domainNode = SCADomain.newInstance("domain.composite");
+ SCADomainFactory domainFactory = SCADomainFactory.newInstance();
+ SCADomain domain = domainFactory.createSCADomain(DEFAULT_DOMAIN_URI);
+ domain.start();
- System.out.println("Domain node started (press enter to shutdown)");
+ System.out.println("Domain started (press enter to shutdown)");
System.in.read();
- domainNode.close();
+ domain.stop();
} catch (Exception e) {
e.printStackTrace();
}
- System.out.println("Domain node stopped");
+ System.out.println("Domain stopped");
}
}
Modified: incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeA/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeA/Calculator.composite?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeA/Calculator.composite (original)
+++ incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeA/Calculator.composite Thu Oct 4 06:40:50 2007
@@ -22,19 +22,19 @@
xmlns:sample="http://sample"
name="Calculator">
- <component name="CalculatorServiceComponent">
+ <component name="CalculatorServiceComponentA">
<implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent"/>
- <reference name="divideService" target="DivideServiceComponent" />
+ <reference name="addService" target="AddServiceComponentB" />
+ <reference name="subtractService" target="SubtractServiceComponentC" />
+ <reference name="multiplyService" target="MultiplyServiceComponentA"/>
+ <reference name="divideService" target="DivideServiceComponentA" />
</component>
- <component name="MultiplyServiceComponent">
+ <component name="MultiplyServiceComponentA">
<implementation.java class="calculator.MultiplyServiceImpl" />
</component>
- <component name="DivideServiceComponent">
+ <component name="DivideServiceComponentA">
<implementation.java class="calculator.DivideServiceImpl" />
</component>
Modified: incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeB/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeB/Calculator.composite?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeB/Calculator.composite (original)
+++ incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeB/Calculator.composite Thu Oct 4 06:40:50 2007
@@ -22,7 +22,7 @@
xmlns:sample="http://sample"
name="Calculator">
- <component name="AddServiceComponent">
+ <component name="AddServiceComponentB">
<implementation.java class="calculator.AddServiceImpl" />
</component>
Modified: incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeC/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeC/Calculator.composite?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeC/Calculator.composite (original)
+++ incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeC/Calculator.composite Thu Oct 4 06:40:50 2007
@@ -22,10 +22,10 @@
xmlns:sample="http://sample"
name="Calculator">
- <component name="SubtractServiceComponent">
+ <component name="SubtractServiceComponentC">
<implementation.java class="calculator.SubtractServiceImpl" />
<service name="SubtractService">
- <binding.sca uri="http://localhost:8086/SubtractServiceComponent"/>
+ <binding.sca uri="http://localhost:8086/SubtractServiceComponentC"/>
</service>
</component>
Modified: incubator/tuscany/java/sca/samples/calculator-distributed/src/test/java/calculator/DomainInMemoryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/calculator-distributed/src/test/java/calculator/DomainInMemoryTestCase.java?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/calculator-distributed/src/test/java/calculator/DomainInMemoryTestCase.java (original)
+++ incubator/tuscany/java/sca/samples/calculator-distributed/src/test/java/calculator/DomainInMemoryTestCase.java Thu Oct 4 06:40:50 2007
@@ -19,11 +19,15 @@
package calculator;
+import javax.xml.namespace.QName;
+
import junit.framework.Assert;
import org.apache.tuscany.sca.domain.SCADomain;
-import org.apache.tuscany.sca.node.impl.SCANodeImpl;
-import org.apache.tuscany.sca.node.impl.SCANodeUtil;
+import org.apache.tuscany.sca.domain.SCADomainFactory;
+import org.apache.tuscany.sca.node.SCADomainFinder;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -36,50 +40,72 @@
*/
public class DomainInMemoryTestCase {
- private static String DEFAULT_DOMAIN_URL = "http://localhost:8877";
+ private static String DEFAULT_DOMAIN_URI = "http://localhost:8877";
+ private static SCADomain domainManager;
+ private static SCANode nodeA;
+ private static SCANode nodeB;
+ private static SCANode nodeC;
private static SCADomain domain;
- private static SCADomain domainNodeA;
- private static SCADomain domainNodeB;
- private static SCADomain domainNodeC;
-
private static CalculatorService calculatorServiceA;
+ private static CalculatorService calculatorServiceB;
+ private static AddService addServiceB;
@BeforeClass
public static void init() throws Exception {
-
+
try {
- System.out.println("Setting up domain registry");
- domain = SCADomain.newInstance("domain.composite");
-
- System.out.println("Setting up distributed nodes");
-
- // Create the domain representation
- domainNodeA = SCADomain.newInstance(DEFAULT_DOMAIN_URL, "nodeA", null, "nodeA/Calculator.composite");
-
- // Create the domain representation
- domainNodeB = SCADomain.newInstance(DEFAULT_DOMAIN_URL, "nodeB", null, "nodeB/Calculator.composite");
-
- // create the node that runs the
- // subtract component
- domainNodeC = SCADomain.newInstance(DEFAULT_DOMAIN_URL, "nodeC", null, "nodeC/Calculator.composite");
-
- // get a reference to the calculator service from domainA
- // which will be running this component
- calculatorServiceA = domainNodeA.getService(CalculatorService.class, "CalculatorServiceComponent");
+ System.out.println("Setting up domain manager");
+
+ SCADomainFactory domainFactory = SCADomainFactory.newInstance();
+ domainManager = domainFactory.createSCADomain(DEFAULT_DOMAIN_URI);
+
+ System.out.println("Setting up calculator nodes");
+
+ ClassLoader cl = DomainInMemoryTestCase.class.getClassLoader();
+
+ SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
+
+ nodeA = nodeFactory.createSCANode("nodeA", DEFAULT_DOMAIN_URI);
+ nodeA.addContribution("nodeA", cl.getResource("nodeA/"));
+ nodeA.startComposite(new QName("http://sample", "Calculator"));
+ nodeA.start();
+
+
+ nodeB = nodeFactory.createSCANode("nodeB", DEFAULT_DOMAIN_URI);
+ nodeB.addContribution("nodeB", cl.getResource("nodeB/"));
+ nodeB.startComposite(new QName("http://sample", "Calculator"));
+ nodeB.start();
+
+
+ nodeC = nodeFactory.createSCANode("nodeC", DEFAULT_DOMAIN_URI);
+ nodeC.addContribution("nodeC", cl.getResource("nodeC/"));
+ nodeC.startComposite(new QName("http://sample", "Calculator"));
+ nodeC.start();
+
+ SCADomainFinder domainFinder = SCADomainFinder.newInstance();
+ domain = domainFinder.getSCADomain(DEFAULT_DOMAIN_URI);
+
+ // get a reference to various services in the domain
+ calculatorServiceA = nodeA.getDomain().getService(CalculatorService.class, "CalculatorServiceComponentA");
+ calculatorServiceB = nodeB.getDomain().getService(CalculatorService.class, "CalculatorServiceComponentB");
+
+ //addServiceB = domain.getService(AddService.class, "AddServiceComponentB");
+ addServiceB = nodeA.getDomain().getService(AddService.class, "AddServiceComponentB");
+
} catch(Exception ex){
- System.err.println(ex.toString());
- }
+ System.err.println(ex.toString());
+ }
+
}
@AfterClass
public static void destroy() throws Exception {
- // stop the domain and hence the nodes it contains
- domainNodeA.close();
- domainNodeB.close();
- domainNodeC.close();
- domain.close();
- }
+ // stop the nodes and hence the domains they contain
+ nodeA.stop();
+ nodeB.stop();
+ nodeC.stop();
+ }
@Test
public void testCalculator() throws Exception {
Modified: incubator/tuscany/java/sca/samples/domain-webapp/src/main/java/node/DomainServer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/domain-webapp/src/main/java/node/DomainServer.java?rev=581897&r1=581896&r2=581897&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/domain-webapp/src/main/java/node/DomainServer.java (original)
+++ incubator/tuscany/java/sca/samples/domain-webapp/src/main/java/node/DomainServer.java Thu Oct 4 06:40:50 2007
@@ -20,7 +20,6 @@
import java.io.IOException;
-import org.apache.tuscany.sca.node.impl.NodeImpl;
/**
* This server program that loads a composite to provide simple registry function.
@@ -31,6 +30,7 @@
public static void main(String[] args) {
try {
+/*
NodeImpl node = new NodeImpl();
node.start();
node.getContributionManager().startContribution(DomainServer.class.getClassLoader().getResource("."));
@@ -44,6 +44,7 @@
node.stop();
System.out.println("Domain server stopped");
+*/
} catch (Exception ex) {
System.out.println("Exception in domain server " +
ex.toString());
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org