Modified: incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCADomainProxyImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCADomainProxyImpl.java?rev=597640&r1=597639&r2=597640&view=diff ============================================================================== --- incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCADomainProxyImpl.java (original) +++ incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCADomainProxyImpl.java Fri Nov 23 03:10:56 2007 @@ -45,11 +45,11 @@ import org.apache.tuscany.sca.core.assembly.ActivationException; import org.apache.tuscany.sca.core.context.ServiceReferenceImpl; import org.apache.tuscany.sca.domain.DomainException; -import org.apache.tuscany.sca.domain.DomainManagerInitService; -import org.apache.tuscany.sca.domain.DomainManagerNodeEventService; +import org.apache.tuscany.sca.domain.SCADomainEventService; import org.apache.tuscany.sca.domain.SCADomainSPI; import org.apache.tuscany.sca.domain.impl.DomainManagerNodeImpl; import org.apache.tuscany.sca.domain.impl.SCADomainImpl; +import org.apache.tuscany.sca.domain.management.SCADomainManagerInitService; import org.apache.tuscany.sca.domain.model.DomainModel; import org.apache.tuscany.sca.domain.model.DomainModelFactory; import org.apache.tuscany.sca.domain.model.impl.DomainModelFactoryImpl; @@ -60,9 +60,9 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; import org.apache.tuscany.sca.node.NodeFactoryImpl; -import org.apache.tuscany.sca.node.NodeManagerInitService; import org.apache.tuscany.sca.node.SCADomainProxySPI; import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.management.SCANodeManagerInitService; import org.apache.tuscany.sca.node.util.SCAContributionUtil; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentContext; @@ -76,13 +76,13 @@ * * @version $Rev$ $Date$ */ -public class SCADomainProxyImpl extends SCADomainImpl implements SCADomainProxySPI { +public class SCADomainProxyImpl extends SCADomainImpl { private final static Logger logger = Logger.getLogger(SCADomainProxyImpl.class.getName()); // management services - private DomainManagerNodeEventService domainManagerService; - private NodeManagerInitService nodeManagerInitService; + private SCADomainEventService domainManagerService; + private SCANodeManagerInitService nodeManagerInitService; // the local node implementation private String nodeURI; @@ -125,131 +125,12 @@ } } - // SPI methods - - public void addNode(SCANode nodeImpl) throws DomainException { - this.nodeImpl = (SCANodeImpl)nodeImpl; - - // add the node into the local domain model - super.addNode(nodeImpl.getURI(), nodeImpl.getURI()); - - // the registration of the node with the domain is delayed until - // after the runtime has been started - start(); - } - - private void addNode() throws DomainException { - - // pass this object into the node manager service - nodeManagerInitService.setNode(nodeImpl); - - if (domainModel.getDomainURL() != null){ - // add the node to the domain - - try { - // create the node manager endpoint - // TODO - we really need to pass in a callable reference - URI nodeURI = new URI(nodeImpl.getURI()); - String nodeHost = nodeURI.getHost(); - - if (nodeHost.equals("localhost")){ - nodeHost = InetAddress.getLocalHost().getHostName(); - } - - String nodeManagerURL = nodeURI.getScheme()+ "://" + - nodeHost + ":" + - nodeURI.getPort() + nodeURI.getPath() + "/NodeManagerComponent/NodeManagerService"; - - // go out and add this node to the wider domain - domainManagerService.registerNode(nodeImpl.getURI(),nodeManagerURL); - - } catch(Exception ex) { - logger.log(Level.SEVERE, - "Can't connect to domain manager at: " + - domainModel.getDomainURL()); - throw new DomainException(ex); - } - } - } - - public void removeNode(SCANode nodeImpl) throws DomainException { - - // remove the node from the local domain model - super.removeNode(nodeImpl.getURI()); - - if (domainModel.getDomainURL() != null){ - - try { - // go out and remove this node to the wider domain - domainManagerService.removeNode(nodeImpl.getURI()); - } catch(Exception ex) { - logger.log(Level.SEVERE, - "Can't connect to domain manager at: " + - domainModel.getDomainURL()); - throw new DomainException(ex); - } - } - - // remove this object from the node manager service - nodeManagerInitService.setNode(null); - - this.nodeImpl = null; - } - - public void registerContribution(String nodeURI, String contributionURI, String contributionURL){ - - if (domainModel.getDomainURL() != null) { - domainManagerService.registerContribution(nodeURI, contributionURI, contributionURL); - } - } - - public void unregisterContribution(String contributionURI){ - if (domainModel.getDomainURL() != null) { - domainManagerService.unregisterContribution(contributionURI); - } - } - - - public String registerServiceEndpoint(String domainURI, String nodeURI, String serviceName, String bindingName, String URL){ - - super.registerServiceEndpoint(domainURI, nodeURI, serviceName, bindingName, URL); - - if (domainModel.getDomainURL() != null) { - return domainManagerService.registerServiceEndpoint(domainURI, nodeURI, serviceName, bindingName, URL); - } else { - return null; - } - } - - public String removeServiceEndpoint(String domainURI, String nodeURI, String serviceName, String bindingName){ - - super.removeServiceEndpoint(domainURI, nodeURI, serviceName, bindingName); - - if (domainModel.getDomainURL() != null) { - return domainManagerService.removeServiceEndpoint(domainURI, nodeURI, serviceName, bindingName); - } else { - return null; - } - } - - public String findServiceEndpoint(String domainURI, String serviceName, String bindingName){ - - String endpoint = super.findServiceEndpoint(domainURI, serviceName, bindingName); - - if ( (endpoint.equals("")) && (domainModel.getDomainURL() != null)){ - endpoint = domainManagerService.findServiceEndpoint(domainURI, serviceName, bindingName); - } - - return endpoint; - } - - public DomainModel getDomainModel(){ - return domainModel; - } - - // API methods - public void start() throws DomainException { + private void createRuntime() throws DomainException { try { + // check we don;t try to do this twice + if (domainManagementRuntime != null){ + return; + } // if there is no node create a runtime otherwise use the runtime from the node if (nodeImpl == null){ @@ -353,13 +234,13 @@ // get the management components out of the domain so that they // can be configured/used. - domainManagerService = getService(DomainManagerNodeEventService.class, - "DomainManagerComponent", + domainManagerService = getService(SCADomainEventService.class, + "SCADomainEventServiceProxyComponent", domainManagementRuntime, domainManagementComposite); - nodeManagerInitService = getService(NodeManagerInitService.class, - "NodeManagerComponent/NodeManagerInitService", + nodeManagerInitService = getService(SCANodeManagerInitService.class, + "SCANodeManagerComponent/SCANodeManagerInitService", domainManagementRuntime, domainManagementComposite); @@ -381,20 +262,145 @@ } catch(Exception ex) { throw new DomainException(ex); } + } + + // SCADomainEventService methods + + public void addNode(SCANode nodeImpl) throws DomainException { + this.nodeImpl = (SCANodeImpl)nodeImpl; + + // add the node into the local domain model + super.registerNode(nodeImpl.getURI(), nodeImpl.getURI()); + + // the registration of the node with the domain is delayed until + // after the runtime has been started + createRuntime(); } - public void stop() throws DomainException { + private void addNode() throws DomainException { + + // pass this object into the node manager service + nodeManagerInitService.setNode(nodeImpl); + + if (domainModel.getDomainURL() != null){ + // add the node to the domain + + try { + // create the node manager endpoint + // TODO - we really need to pass in a callable reference + URI nodeURI = new URI(nodeImpl.getURI()); + String nodeHost = nodeURI.getHost(); + + if (nodeHost.equals("localhost")){ + nodeHost = InetAddress.getLocalHost().getHostName(); + } + + String nodeManagerURL = nodeURI.getScheme()+ "://" + + nodeHost + ":" + + nodeURI.getPort() + nodeURI.getPath() + "/SCANodeManagerComponent/SCANodeManagerService"; + + // go out and add this node to the wider domain + domainManagerService.registerNode(nodeImpl.getURI(),nodeManagerURL); + + } catch(Exception ex) { + logger.log(Level.SEVERE, + "Can't connect to domain manager at: " + + domainModel.getDomainURL()); + throw new DomainException(ex); + } + } + } + + public void removeNode(SCANode nodeImpl) throws DomainException { + + // remove the node from the local domain model + super.unregisterNode(nodeImpl.getURI()); + + if (domainModel.getDomainURL() != null){ + + try { + // go out and remove this node to the wider domain + domainManagerService.unregisterNode(nodeImpl.getURI()); + } catch(Exception ex) { + logger.log(Level.SEVERE, + "Can't connect to domain manager at: " + + domainModel.getDomainURL()); + throw new DomainException(ex); + } + } + + // remove this object from the node manager service + nodeManagerInitService.setNode(null); + + this.nodeImpl = null; + } + + public void registerContribution(String nodeURI, String contributionURI, String contributionURL) throws DomainException { + + if ((domainModel.getDomainURL() != null) && (domainManagerService != null)){ + domainManagerService.registerContribution(nodeURI, contributionURI, contributionURL); + } + } + + public void unregisterContribution(String nodeURI, String contributionURI) throws DomainException { + if ((domainModel.getDomainURL() != null) && (domainManagerService != null)) { + domainManagerService.unregisterContribution(nodeURI, contributionURI); + } + } + + + public void registerServiceEndpoint(String domainURI, String nodeURI, String serviceName, String bindingName, String URL) throws DomainException { + + super.registerServiceEndpoint(domainURI, nodeURI, serviceName, bindingName, URL); + + if ((domainModel.getDomainURL() != null) && (domainManagerService != null)) { + domainManagerService.registerServiceEndpoint(domainURI, nodeURI, serviceName, bindingName, URL); + } + } + + public void unregisterServiceEndpoint(String domainURI, String nodeURI, String serviceName, String bindingName) throws DomainException { + + super.unregisterServiceEndpoint(domainURI, nodeURI, serviceName, bindingName); + + if ((domainModel.getDomainURL() != null) && (domainManagerService != null)) { + domainManagerService.unregisterServiceEndpoint(domainURI, nodeURI, serviceName, bindingName); + } + } + + public String findServiceEndpoint(String domainURI, String serviceName, String bindingName) throws DomainException { + + String endpoint = super.findServiceEndpoint(domainURI, serviceName, bindingName); + + if ( (endpoint.equals("")) && (domainModel.getDomainURL() != null) && (domainManagerService != null)){ + endpoint = domainManagerService.findServiceEndpoint(domainURI, serviceName, bindingName); + } + + return endpoint; + } + + + // SCADomain API methods + public void start() throws DomainException { try { - Composite composite = domainManagementComposite.getIncludes().get(0); + createRuntime(); - domainManagementRuntime.getCompositeActivator().stop(composite); - domainManagementRuntime.getCompositeActivator().deactivate(composite); + if (nodeImpl != null){ + nodeImpl.start(); + } + + } catch(Exception ex) { + throw new DomainException(ex); + } + } + + public void stop() throws DomainException { + try { + if (nodeImpl != null){ nodeImpl.stop(); - } else { - domainManagementRuntime.stop(); - } + } + } catch (Exception ex) { throw new DomainException(ex); } @@ -404,7 +410,9 @@ try { if (nodeImpl != null){ nodeImpl.destroy(); - } else { + } + + if (domainManagementRuntime != null) { Composite composite = domainManagementComposite.getIncludes().get(0); domainManagementRuntime.getCompositeActivator().stop(composite); @@ -421,6 +429,7 @@ domainManagerService = null; nodeManagerInitService = null; } + } catch (Exception ex) { throw new DomainException(ex); @@ -435,6 +444,10 @@ new DomainException(ex); } } + + public void updateContribution(String contributionURI, URL contributionURL) throws DomainException { + // TODO + } public void removeContribution(String uri) throws DomainException { try { @@ -448,6 +461,10 @@ // TODO } + public void updateDeploymentComposite(String contributionURI, String compositeXML) throws DomainException { + // TODO + } + public void addToDomainLevelComposite(QName qname) throws DomainException { try { nodeImpl.addToDomainLevelComposite(qname); @@ -462,7 +479,15 @@ } catch(Exception ex) { new DomainException(ex); } - } + } + + public String getDomainLevelComposite() throws DomainException { + return null; + } + + public String getQNameDefinition(QName artifact) throws DomainException { + return null; + } public void startComposite(QName qname) throws DomainException { try {
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=597640&r1=597639&r2=597640&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 Fri Nov 23 03:10:56 2007 @@ -55,6 +55,7 @@ import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.assembly.ActivationException; import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.domain.SCADomainEventService; import org.apache.tuscany.sca.domain.SCADomainSPI; import org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime; import org.apache.tuscany.sca.host.http.ServletHost; @@ -411,11 +412,11 @@ // remove the local record of the contribution contributions.remove(contributionURI); - // remove the contribution from the domain. It will generally already be remove - // unless the contribution has been remove from the node itself. - //((SCADomainProxyImpl)scaDomain).unregisterContribution(nodeURI, contributionURI); + // remove the contribution from the domain. It will generally already be removed + // unless the contribution has been removed from the node itself. + ((SCADomainEventService)scaDomain).unregisterContribution(nodeURI, contributionURI); - } catch (ContributionException ex) { + } catch (Exception ex) { throw new NodeException(ex); } @@ -651,11 +652,11 @@ String uri = binding.getURI(); if (uri != null) { try { - ((SCADomainSPI)scaDomain).registerServiceEndpoint(domainURI, - nodeURI, - service.getName(), - binding.getClass().getName(), - uri); + ((SCADomainEventService)scaDomain).registerServiceEndpoint(domainURI, + nodeURI, + service.getName(), + binding.getClass().getName(), + uri); } catch(Exception ex) { logger.log(Level.WARNING, "Unable to register service: " + @@ -679,11 +680,11 @@ if (uriString != null) { try { URI uri = new URI(uriString); - ((SCADomainSPI)scaDomain).registerServiceEndpoint(domainURI, - nodeURI, - uri.getPath(), - binding.getClass().getName(), - uriString); + ((SCADomainEventService)scaDomain).registerServiceEndpoint(domainURI, + nodeURI, + uri.getPath(), + binding.getClass().getName(), + uriString); } catch(Exception ex) { logger.log(Level.WARNING, "Unable to register service: " + @@ -717,9 +718,9 @@ // binding uri String uri = ""; try { - uri = ((SCADomainSPI)scaDomain).findServiceEndpoint(domainURI, - binding.getURI(), - binding.getClass().getName()); + uri = ((SCADomainEventService)scaDomain).findServiceEndpoint(domainURI, + binding.getURI(), + binding.getClass().getName()); } catch(Exception ex) { logger.log(Level.WARNING, "Unable to find service: " + @@ -750,9 +751,9 @@ // binding uri String uri = ""; try { - uri = ((SCADomainSPI)scaDomain).findServiceEndpoint(domainURI, - binding.getURI(), - binding.getClass().getName()); + uri = ((SCADomainEventService)scaDomain).findServiceEndpoint(domainURI, + binding.getURI(), + binding.getClass().getName()); } catch(Exception ex) { logger.log(Level.WARNING, "Unable to find service: " + Added: incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/impl/SCANodeManagerServiceImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/impl/SCANodeManagerServiceImpl.java?rev=597640&view=auto ============================================================================== --- incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/impl/SCANodeManagerServiceImpl.java (added) +++ incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/impl/SCANodeManagerServiceImpl.java Fri Nov 23 03:10:56 2007 @@ -0,0 +1,132 @@ +/* + * 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.management.impl; + +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.assembly.Component; +import org.apache.tuscany.sca.core.assembly.RuntimeComponentImpl; +import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.node.ComponentInfo; +import org.apache.tuscany.sca.node.ComponentManagerService; +import org.apache.tuscany.sca.node.NodeException; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.impl.ComponentInfoImpl; +import org.apache.tuscany.sca.node.impl.SCANodeImpl; +import org.apache.tuscany.sca.node.management.SCANodeManagerInitService; +import org.apache.tuscany.sca.node.management.SCANodeManagerService; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +/** + * Manages a node implementation + * + * @version $Rev: 552343 $ $Date: 2007-09-11 18:45:36 +0100 (Tue, 11 Sep 2007) $ + */ [EMAIL PROTECTED]("COMPOSITE") [EMAIL PROTECTED](interfaces = {SCANodeManagerService.class, SCANodeManagerInitService.class, ComponentManagerService.class}) +public class SCANodeManagerServiceImpl implements SCANodeManagerService, SCANodeManagerInitService, ComponentManagerService { + + private final static Logger logger = Logger.getLogger(SCANodeManagerServiceImpl.class.getName()); + + private SCANodeImpl node; + + + // NodeManagerInitService + + public void setNode(SCANode node) { + this.node = (SCANodeImpl)node; + } + + // SCANodeManagerService methods + + public String getURI() { + return node.getURI(); + } + + public void addContribution(String contributionURI, String contributionURL) throws NodeException { + try { + node.addContribution(contributionURI, new URL(contributionURL)); + } catch (Exception ex){ + // TODO - sort out exceptions passing across binding.sca + logger.log(Level.SEVERE, ex.toString()); + } + } + + public void removeContribution(String contributionURI) throws NodeException { + + } + + public void addToDomainLevelComposite(String compositeName) throws NodeException { + try { + node.addToDomainLevelComposite(QName.valueOf(compositeName)); + } catch (Exception ex){ + // TODO - sort out exceptions passing across binding.sca + logger.log(Level.SEVERE, ex.toString()); + } + + } + + public void start() throws NodeException { + try { + node.start(); + } catch (Exception ex){ + // TODO - sort out exceptions passing across binding.sca + logger.log(Level.SEVERE, ex.toString()); + } + } + + public void stop() throws NodeException { + try { + node.stop(); + } catch (Exception ex){ + // TODO - sort out exceptions passing across binding.sca + logger.log(Level.SEVERE, ex.toString()); + } + } + + // ComponentManagerService + + public List<ComponentInfo> getComponentInfos() { + List<ComponentInfo> componentInfos = new ArrayList<ComponentInfo>(); + for (Component component : node.getComponents()) { + ComponentInfo componentInfo = new ComponentInfoImpl(); + componentInfo.setName(component.getName()); + componentInfo.setStarted(((RuntimeComponentImpl)component).isStarted()); + componentInfos.add(componentInfo); + } + return componentInfos; + } + + public ComponentInfo getComponentInfo(String componentName) { + Component component = node.getComponent(componentName); + ComponentInfo componentInfo = new ComponentInfoImpl(); + componentInfo.setName(component.getName()); + componentInfo.setStarted(((RuntimeComponentImpl)component).isStarted()); + return componentInfo; + } + +} 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=597640&r1=597639&r2=597640&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 Fri Nov 23 03:10:56 2007 @@ -29,26 +29,26 @@ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" name="node"> - <component name="DomainManagerComponent"> - <implementation.java class="org.apache.tuscany.sca.node.impl.DomainManagerServiceImpl"/> - <service name="DomainManagerNodeEventService"> - <interface.java interface="org.apache.tuscany.sca.domain.DomainManagerNodeEventService"/> + <component name="SCADomainEventServiceProxyComponent"> + <implementation.java class="org.apache.tuscany.sca.node.impl.SCADomainEventServiceProxyImpl"/> + <service name="SCADomainEventService"> + <interface.java interface="org.apache.tuscany.sca.domain.SCADomainEventService"/> <binding.sca/> </service> <reference name="domainManager"> - <interface.java interface="org.apache.tuscany.sca.domain.DomainManagerNodeEventService"/> - <binding.ws uri="http://localhost:9999/DomainManagerComponent/DomainManagerNodeEventService"/> + <interface.java interface="org.apache.tuscany.sca.domain.SCADomainEventService"/> + <binding.ws uri="http://localhost:9999/SCADomainManagerComponent/SCADomainEventService"/> </reference> </component> - <component name="NodeManagerComponent"> - <implementation.java class="org.apache.tuscany.sca.node.impl.NodeManagerServiceImpl"/> - <service name="NodeManagerInitService"> - <interface.java interface="org.apache.tuscany.sca.node.NodeManagerInitService"/> + <component name="SCANodeManagerComponent"> + <implementation.java class="org.apache.tuscany.sca.node.management.impl.SCANodeManagerServiceImpl"/> + <service name="SCANodeManagerInitService"> + <interface.java interface="org.apache.tuscany.sca.node.management.SCANodeManagerInitService"/> <binding.sca/> </service> - <service name="NodeManagerService"> - <interface.java interface="org.apache.tuscany.sca.node.NodeManagerService"/> + <service name="SCANodeManagerService"> + <interface.java interface="org.apache.tuscany.sca.node.management.SCANodeManagerService"/> <binding.ws/> </service> <service name="ComponentManagerService"> Modified: 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=597640&r1=597639&r2=597640&view=diff ============================================================================== --- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java (original) +++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java Fri Nov 23 03:10:56 2007 @@ -86,7 +86,7 @@ } catch(Exception ex){ - System.err.println(ex.toString()); + ex.printStackTrace(); } } Modified: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.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?rev=597640&r1=597639&r2=597640&view=diff ============================================================================== --- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java (original) +++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java Fri Nov 23 03:10:56 2007 @@ -96,7 +96,7 @@ addServiceB = nodeA.getDomain().getService(AddService.class, "AddServiceComponentB"); } catch(Exception ex){ - System.err.println(ex.toString()); + ex.printStackTrace(); } } Added: incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/management/SCANodeManagerInitService.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/management/SCANodeManagerInitService.java?rev=597640&view=auto ============================================================================== --- incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/management/SCANodeManagerInitService.java (added) +++ incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/management/SCANodeManagerInitService.java Fri Nov 23 03:10:56 2007 @@ -0,0 +1,40 @@ +/* + * 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.management; + +import org.apache.tuscany.sca.node.SCANode; + + + +/** + * Initializes the Node Management component + * + * @version $Rev: 552343 $ $Date: 2007-09-11 18:45:36 +0100 (Tue, 11 Sep 2007) $ + */ +public interface SCANodeManagerInitService { + + /** + * Set the node object into the NodeManagement component so that is can manage it + * + * @param node + */ + public void setNode(SCANode node); + +} Added: incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/management/SCANodeManagerService.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/management/SCANodeManagerService.java?rev=597640&view=auto ============================================================================== --- incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/management/SCANodeManagerService.java (added) +++ incubator/tuscany/java/sca/modules/node/src/main/java/org/apache/tuscany/sca/node/management/SCANodeManagerService.java Fri Nov 23 03:10:56 2007 @@ -0,0 +1,80 @@ +/* + * 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.management; + +import java.net.URL; +import java.util.logging.Level; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.domain.SCADomain; +import org.apache.tuscany.sca.node.NodeException; +import org.osoa.sca.annotations.Remotable; + + +/** + * The management interface for a node + * + * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ + */ [EMAIL PROTECTED] +public interface SCANodeManagerService { + + /** + * Returns the URI of the SCA node. That URI is the endpoint of the + * SCA node administration service. + * + * @return the URI of the SCA node + */ + public String getURI(); + + /** + * Add an SCA contribution into the node. + * + * @param uri the URI of the contribution + * @param url the URL of the contribution + */ + public void addContribution(String contributionURI, String contributionURL) throws NodeException; + + /** + * Remove an SCA contribution from the node. + * + * @param contributionURI the URI of the contribution + */ + public void removeContribution(String contributionURI) throws NodeException; + + /** + * Add the named deployable composite to the domain level composite + * + * @param compositeQName the name of the composite + */ + public void addToDomainLevelComposite(String compositeName) throws NodeException; + + /** + * Start the SCA node service. + */ + public void start() throws NodeException; + + /** + * Stop the SCA node service. + */ + public void stop() throws NodeException; + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
