Author: slaws
Date: Thu Dec 6 09:10:23 2007
New Revision: 601789
URL: http://svn.apache.org/viewvc?rev=601789&view=rev
Log:
Code chages and Tutorial artifact to allow the store to talk to an EJB where
the EJB is described using and SCA composite but that composite is not actually
deployed. Also changes here required to bring the Geronimo plugin back up with
the new Node/Domain implementation.
Added:
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/CatalogEJB.componentType
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/catalog-jee.composite
incubator/tuscany/java/sca/tutorial/cloud/tutorial-catalog-ejb-1.1-incubating-SNAPSHOT.jar
(with props)
Modified:
incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingImpl.java
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java
incubator/tuscany/java/sca/modules/domain-impl/src/main/resources/webroot/index.html
incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
incubator/tuscany/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java
incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCADomainProxyImpl.java
incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeFactoryImpl.java
incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java
incubator/tuscany/java/sca/modules/node-impl/src/main/resources/node.composite
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java
incubator/tuscany/java/sca/tutorial/catalog-jee/catalog-jee.composite
incubator/tuscany/java/sca/tutorial/cloud/launch/LaunchCloud.java
incubator/tuscany/java/sca/tutorial/cloud/pom.xml
incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java
incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDB.java
incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java
incubator/tuscany/java/sca/tutorial/store/store-distributed.composite
incubator/tuscany/java/sca/tutorial/store/store-merger.composite
Modified:
incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingImpl.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingImpl.java
(original)
+++
incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingImpl.java
Thu Dec 6 09:10:23 2007
@@ -71,6 +71,7 @@
*/
public EJBBindingImpl() {
super();
+ unresolved = true;
}
/**
Modified:
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
(original)
+++
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
Thu Dec 6 09:10:23 2007
@@ -200,10 +200,14 @@
for (ComponentService service : reference.getTargets()) {
if (service.isUnresolved()) {
for (Binding binding : service.getBindings()) {
+
+
+ //binding.setURI(service.getName());
+
// TODO - we should look at all the bindings now
associated with the
// unresolved target but we assume the SCA binding
here as
// its currently the only wireable one
- if (binding instanceof OptimizableBinding) {
+ if (binding instanceof SCABinding) {
OptimizableBinding scaBinding =
(OptimizableBinding)binding;
// clone the SCA binding and fill in service details
@@ -228,11 +232,15 @@
// warning("The binding doesn't support clone: " +
binding.getClass().getSimpleName(), binding);
}
} else {
+ /*
+ * Just leave the binding as it. It will be filled in
later
+ * when the node resolves the targets
throw new IllegalStateException(
"Unable to create a
distributed SCA binding provider for reference: " + reference
.getName()
+ " and target: "
+
service.getName());
+ */
}
}
}
Modified:
incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java
(original)
+++
incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java
Thu Dec 6 09:10:23 2007
@@ -19,6 +19,7 @@
package org.apache.tuscany.sca.domain.impl;
+import java.io.ByteArrayOutputStream;
import java.io.Externalizable;
import java.net.URI;
import java.net.URL;
@@ -29,6 +30,8 @@
import java.util.logging.Logger;
import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
import org.apache.tuscany.sca.assembly.AssemblyFactory;
import org.apache.tuscany.sca.assembly.Binding;
@@ -48,7 +51,12 @@
import org.apache.tuscany.sca.contribution.Export;
import org.apache.tuscany.sca.contribution.Import;
import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import
org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
+import
org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.assembly.ActivationException;
import org.apache.tuscany.sca.core.context.ServiceReferenceImpl;
import org.apache.tuscany.sca.domain.DomainException;
@@ -79,6 +87,8 @@
import org.osoa.sca.ServiceReference;
import org.osoa.sca.ServiceRuntimeException;
+import com.ibm.xslt4j.bcel.generic.DMUL;
+
/**
* The SCA domain implementation. In Tuscany we currently have a model of the
* SCA Domain that relies on a central domain manager this class provides that
@@ -90,7 +100,8 @@
private final static Logger logger =
Logger.getLogger(SCADomainImpl.class.getName());
-
+ public static final String IMPORTED = "IMPORTED";
+
// class loader used to get the runtime going
protected ClassLoader domainClassLoader;
@@ -226,18 +237,7 @@
} catch(Exception ex) {
throw new DomainException(ex);
}
- }
-
- public Component getComponent(String componentName) {
- for (Composite composite: domainManagementComposite.getIncludes()) {
- for (Component component: composite.getComponents()) {
- if (component.getName().equals(componentName)) {
- return component;
- }
- }
- }
- return null;
- }
+ }
// SCADomainSPI methods
@@ -245,6 +245,93 @@
return domainModel;
}
+ public String getComposite(QName compositeQName){
+ CompositeModel compositeModel =
domainModel.getDeployedComposites().get(compositeQName);
+ Composite composite = compositeModel.getComposite();
+
+ ExtensionPointRegistry registry =
domainManagementRuntime.getExtensionPointRegistry();
+
+ StAXArtifactProcessorExtensionPoint staxProcessors =
+
registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+
+ StAXArtifactProcessor<Composite> processor =
staxProcessors.getProcessor(Composite.class);
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ try {
+ XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+ XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bos);
+ processor.write(composite, writer);
+ writer.flush();
+ writer.close();
+ } catch (Exception ex) {
+ System.out.println(ex.toString());
+ }
+
+ String compositeString = bos.toString();
+
+ return compositeString;
+ }
+
+ public String getComponent(QName compositeQName, String componentName){
+
+ String componentString = null;
+
+ return componentString;
+
+ }
+
+ private void registerRemoteServices(Composite composite){
+ // Loop through all service binding URIs registering them with the
domain
+ for (Service service: composite.getServices()) {
+ for (Binding binding: service.getBindings()) {
+ registerRemoteServiceBinding(null, service, binding);
+ }
+ }
+
+ for (Component component: composite.getComponents()) {
+ for (ComponentService service: component.getServices()) {
+ for (Binding binding: service.getBindings()) {
+ registerRemoteServiceBinding(component, service, binding);
+ }
+ }
+ }
+ }
+
+ private void registerRemoteServiceBinding(Component component, Service
service, Binding binding ){
+ if (service.getInterfaceContract().getInterface().isRemotable()) {
+ String uriString = binding.getURI();
+ if (uriString != null) {
+
+ String serviceName = component.getURI() + '/' +
binding.getName();
+ /*
+ if (component != null) {
+ serviceName = component.getURI();
+ if (component.getServices().size() > 1){
+ serviceName = serviceName + '/' + binding.getName();
+ }
+ } else {
+ serviceName = service.getName();
+ }
+ */
+ try {
+ registerServiceEndpoint(domainModel.getDomainURI(),
+ IMPORTED,
+ serviceName,
+ binding.getClass().getName(),
+ uriString);
+ } catch(Exception ex) {
+ logger.log(Level.WARNING,
+ "Unable to register service: " +
+ domainModel.getDomainURI() + " " +
+ IMPORTED + " " +
+ service.getName()+ " " +
+ binding.getClass().getName() + " " +
+ uriString);
+ }
+ }
+ }
+ }
+
// SCADomainEventService methods
public void registerNode(String nodeURI, String nodeURL, Externalizable
nodeManagerReference) throws DomainException {
@@ -358,22 +445,34 @@
}
public void registerServiceEndpoint(String domainURI, String nodeURI,
String serviceName, String bindingName, String URL)throws DomainException {
+
+ // the component/service name
+ String longServiceName = null;
+
+ // the component name
+ String shortServiceName = null;
+
// if the service name ends in a "/" remove it
- String modifiedServiceName = null;
- if ( serviceName.endsWith("/") ) {
- modifiedServiceName = serviceName.substring(0,
serviceName.length() - 1);
+ if (serviceName.endsWith("/")) {
+ longServiceName = serviceName.substring(0, serviceName.length() -
1);
} else {
- modifiedServiceName = serviceName;
+ longServiceName = serviceName;
}
// if the service name starts with a "/" remove it
- if ( modifiedServiceName.startsWith("/") ) {
- modifiedServiceName = modifiedServiceName.substring(1,
serviceName.length());
+ if (longServiceName.startsWith("/")) {
+ longServiceName = longServiceName.substring(1,
serviceName.length());
+ }
+
+ // extract the short name from the long name
+ if (longServiceName.indexOf("/") >= 0 ) {
+ //TODO - only set this if multiplicity is 1
+ shortServiceName = longServiceName.substring(0,
longServiceName.indexOf("/"));
}
// collect the service info
ServiceModel service = domainModelFactory.createService();
- service.setServiceURI(modifiedServiceName);
+ service.setServiceURI(longServiceName);
service.setServiceURL(URL);
service.setServiceBinding(bindingName);
@@ -383,26 +482,39 @@
if (node != null){
//store the service
- node.getServices().put(modifiedServiceName+bindingName, service);
+ node.getServices().put(longServiceName+bindingName, service);
+
+ if (shortServiceName != null){
+ node.getServices().put(shortServiceName+bindingName, service);
+ }
logger.log(Level.INFO, "Registering service: [" +
domainURI + " " +
- modifiedServiceName + " " +
+ longServiceName + " " +
URL + " " +
bindingName + "]");
} else {
logger.log(Level.WARNING, "Trying to register service: " +
- modifiedServiceName +
+ longServiceName +
" for a node " +
nodeURI +
"that isn't registered");
}
- notifyServiceChange(modifiedServiceName);
+ notifyServiceChange(longServiceName);
}
public void unregisterServiceEndpoint(String domainURI, String nodeURI,
String serviceName, String bindingName) throws DomainException{
NodeModel node = domainModel.getNodes().get(nodeURI);
node.getServices().remove(serviceName + bindingName);
+
+ // extract the short name from the long name
+ String shortServiceName = null;
+ if (serviceName.indexOf("/") >= 0 ) {
+ shortServiceName = serviceName.substring(0,
serviceName.indexOf("/"));
+ }
+
+ node.getServices().remove(shortServiceName + bindingName);
+
logger.log(Level.FINE, "Removed service: " + serviceName );
notifyServiceChange(serviceName);
@@ -450,16 +562,16 @@
url = service.getServiceURL();
// uncomment for debugging
//url = url.replace("8085", "8086");
- logger.log(Level.FINE, "Found service " + serviceName + " url:
" + url);
+ logger.log(Level.INFO, "Found service " + serviceName + " url:
" + url);
break;
- }
+ }
}
return url;
}
public String findServiceNode(String domainURI, String serviceName, String
bindingName) throws DomainException{
- logger.log(Level.INFO, "Finding service: [" +
+ logger.log(Level.INFO, "Finding service node: [" +
domainURI + " " +
serviceName + " " +
bindingName +
@@ -530,7 +642,9 @@
for(NodeModel node : nodes) {
try {
-
((NodeModelImpl)node).getSCANodeManagerService().destroyNode();
+ if ( ((NodeModelImpl)node).getSCANodeManagerService() !=
null){
+
((NodeModelImpl)node).getSCANodeManagerService().destroyNode();
+ }
} catch (Exception ex) {
// TODO - collate errors and report
ex.printStackTrace();
@@ -572,6 +686,38 @@
return domainModel.getDomainURI();
}
+ public void importContribution(String contributionURI, URL
contributionURL) throws DomainException {
+ // check that there is a virutal IMPORTED node that represents all
imported components
+ // running outside the sca domain
+ NodeModel nodeModel = domainModel.getNodes().get(IMPORTED);
+
+ if (nodeModel == null){
+ registerNode(IMPORTED, IMPORTED, null);
+ nodeModel = domainModel.getNodes().get(IMPORTED);
+ }
+
+ // add the contribution information to the domain model
+ org.apache.tuscany.sca.domain.model.ContributionModel
contributionModel =
+ parseContribution(contributionURI,
contributionURL.toExternalForm());
+
+ // add the contribution to the IMPORTED node
+ nodeModel.getContributions().put(contributionURI, contributionModel);
+
+ // this contribution will not be deployed as it represents a component
running elsewhere
+ for ( CompositeModel compositeModel :
contributionModel.getComposites().values()) {
+ // build the model
+ try {
+
domainManagementRuntime.getCompositeBuilder().build(compositeModel.getComposite());
+ } catch (Exception ex) {
+ throw new DomainException(ex);
+ }
+
+ // add all the services that are exposed to the service list for
other, deployed,
+ // components to find.
+ registerRemoteServices(compositeModel.getComposite());
+ }
+
+ }
public void addContribution(String contributionURI, URL contributionURL)
throws DomainException {
// add the contribution information to the domain model
@@ -788,7 +934,8 @@
NodeModel node = null;
for(NodeModel tmpNode : domainModel.getNodes().values()) {
- if ( tmpNode.getContributions().isEmpty()){
+ if ((tmpNode.getContributions().isEmpty()) &&
+ (!tmpNode.getNodeURI().equals(IMPORTED))){
node = tmpNode;
for (Contribution tmpContribution : dependentContributions){
Modified:
incubator/tuscany/java/sca/modules/domain-impl/src/main/resources/webroot/index.html
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-impl/src/main/resources/webroot/index.html?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/domain-impl/src/main/resources/webroot/index.html
(original)
+++
incubator/tuscany/java/sca/modules/domain-impl/src/main/resources/webroot/index.html
Thu Dec 6 09:10:23 2007
@@ -18,7 +18,7 @@
* under the License.
-->
<head>
-<title>Apache Tuscany Domain</TITLE>
+<title>Apache Tuscany Domain Debug</TITLE>
<script type="text/javascript" src="binding-jsonrpc.js"></script>
@@ -120,7 +120,7 @@
<body onload="getDomainInfo()">
-<h1 id="top">Apache Tuscany Domain</h1>
+<h1 id="top">Apache Tuscany Domain Debug</h1>
<div id="errors"></div>
<table>
Modified:
incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java
(original)
+++
incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java
Thu Dec 6 09:10:23 2007
@@ -97,9 +97,19 @@
}
@Test
+ public void testGetDomainLevelComposite() throws Exception {
+ System.out.println(domain.getDomainLevelComposite());
+ }
+
+ @Test
+ public void testGetComposite() throws Exception {
+ System.out.println(((SCADomainImpl)domain).getComposite(new
QName("http://sample", "CalculatorA")));
+ }
+/*
+ @Test
public void testStartComposite() throws Exception {
domain.startComposite(new QName("http://sample", "CalculatorA"));
- }
+ }
@Test
@@ -113,7 +123,7 @@
domainEventService.unregisterNode("http://localhost:8100/mynode1");
domainEventService.unregisterNode("http://localhost:8200/mynode2");
}
-
+ */
//@Test
public void testKeepServerRunning() throws Exception {
System.out.println("press enter to continue");
Modified:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
(original)
+++
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
Thu Dec 6 09:10:23 2007
@@ -75,7 +75,13 @@
implementation.setEJBLink(ejbLink);
// Set the URI of the component type
- implementation.setURI(ejbLink.replace('#', '/'));
+ //implementation.setURI(ejbLink.replace('#', '/'));
+ int hashPosition = ejbLink.indexOf('#');
+ if ( hashPosition >= 0) {
+ implementation.setURI(ejbLink.substring(hashPosition + 1));
+ } else {
+ implementation.setURI(ejbLink);
+ }
}
// Skip to end element
Modified:
incubator/tuscany/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java
(original)
+++
incubator/tuscany/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java
Thu Dec 6 09:10:23 2007
@@ -92,23 +92,47 @@
* used to locate the domain manager on the network
* @return a new SCA node.
*/
- public abstract SCANode createSCANode(String nodeURI, String domainURI)
throws NodeException;
+ public abstract SCANode createSCANode(String physicalNodeURI, String
domainURI) throws NodeException;
/**
- * Creates a new SCA node as part of a node group. Groups of nodes are
used in load balancing
+ * Creates a new SCA node. Many physical nodes may share the same logical
URL in load balancing
* and failover scenarios where each node in the group runs the same
contribution and
* active composites
*
- * @param nodeURI the URI of the node, this URI is used to provide the
default
+ * @param physicalNodeURI the URI of the node, this URI is used to provide
the default
* host and port information for the runtime for situations when
bindings
- * do provide this information
+ * don't provide this information
* @param domainURI the URI of the domain that the node belongs to. This
URI is
* used to locate the domain manager on the network
- * @param nodeGroupURI the uri of the node group. This is the enpoint URI
of the head of the
- * group of nodes. For example, in load balancing scnearios this will be
the loaded balancer itself
+ * @param logicalNodeURI the uri of the node to be used in situations
where more than one node
+ * are grouped together for failover or load balancing scenarios.
The logicalNodeURI
+ * will typically identify the logical node where requests are sent
* @return a new SCA node.
*/
public abstract SCANode createSCANode(String physicalNodeURI, String
domainURI, String logicalNodeURI) throws NodeException;
+
+ /**
+ * Creates a new SCA node. Many physical nodes may share the same logical
URL in load balancing
+ * and failover scenarios where each node in the group runs the same
contribution and
+ * active composites. Also allows a class loaded to b specified. This is
the
+ * classloader that will be used to load the management application used
by the
+ * node to talk to the domain
+ *
+ * @param physicalNodeURI the URI of the node, this URI is used to provide
the default
+ * host and port information for the runtime for situations when
bindings
+ * don't provide this information
+ * @param domainURI the URI of the domain that the node belongs to. This
URI is
+ * used to locate the domain manager on the network
+ * @param logicalNodeURI the uri of the node to be used in situations
where more than one node
+ * are grouped together for failover or load balancing scenarios.
The logicalNodeURI
+ * will typically identify the logical node where requests are
sent. If null is provided
+ * no logicalNodeURI is set.
+ * @param classLoader the class loader to use by default when loading
contributions. If null is provided
+ * the classloader the dervied automatically.
+ * @return a new SCA node.
+ */
+ public abstract SCANode createSCANode(String physicalNodeURI, String
domainURI, String logicalNodeURI, ClassLoader classLoader) throws NodeException;
+
/**
* Convenience method to create and start a node and embedded domain
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=601789&r1=601788&r2=601789&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
Thu Dec 6 09:10:23 2007
@@ -36,6 +36,7 @@
import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.contribution.DeployedArtifact;
import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl;
import org.apache.tuscany.sca.core.assembly.ActivationException;
import org.apache.tuscany.sca.core.context.CallableReferenceImpl;
import org.apache.tuscany.sca.domain.DomainException;
@@ -86,6 +87,17 @@
super(domainURI);
}
+ /**
+ * Creates a domain proxy connected to a wider domain.
+ *
+ * @param domainUri - identifies what host and port the domain service is
running on, e.g. http://localhost:8081
+ * @throws ActivationException
+ */
+ public SCADomainProxyImpl(String domainURI, ClassLoader cl) throws
DomainException {
+ super(domainURI);
+ domainClassLoader = cl;
+ }
+
/**
* Start the composite that connects to the domain manager
*/
@@ -178,10 +190,14 @@
if ( contributionURL != null ){
logger.log(Level.INFO, "Domain management configured from " +
contributionURL);
+ // set up a model resolver with the classloader for this
domain/node
+ ModelResolverImpl modelResolver = new
ModelResolverImpl(domainClassLoader);
+
// add node composite to the management domain
domainManagementContributionService =
domainManagementRuntime.getContributionService();
domainManagementContribution =
domainManagementContributionService.contribute("nodedomain",
contributionURL,
+
modelResolver,
false);
Composite composite = null;
Modified:
incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeFactoryImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeFactoryImpl.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeFactoryImpl.java
(original)
+++
incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeFactoryImpl.java
Thu Dec 6 09:10:23 2007
@@ -40,7 +40,6 @@
}
-
/**
* Creates a new SCA node.
*
@@ -51,26 +50,52 @@
* used to locate the domain manager on the network
* @return a new SCA node.
*/
- public SCANode createSCANode(String nodeURI, String domainURI) throws
NodeException {
- return new SCANodeImpl(nodeURI, domainURI, null);
+ public SCANode createSCANode(String physicalNodeURI, String domainURI)
throws NodeException {
+ return new SCANodeImpl(physicalNodeURI, domainURI, null);
}
/**
- * Creates a new SCA node as part of a node group. Groups of nodes are
used in load balancing
+ * Creates a new SCA node. Many physical nodes may share the same logical
URL in load balancing
* and failover scenarios where each node in the group runs the same
contribution and
* active composites
*
- * @param nodeURI the URI of the node, this URI is used to provide the
default
+ * @param physicalNodeURI the URI of the node, this URI is used to provide
the default
* host and port information for the runtime for situations when
bindings
- * do provide this information
+ * don't provide this information
* @param domainURI the URI of the domain that the node belongs to. This
URI is
* used to locate the domain manager on the network
- * @param nodeGroupURI the uri of the node group. This is the enpoint URI
of the head of the
- * group of nodes. For example, in load balancing scnearios this will be
the loaded balancer itself
+ * @param logicalNodeURI the uri of the node to be used in situations
where more than one node
+ * are grouped together for failover or load balancing scenarios.
The logicalNodeURI
+ * will typically identify the logical node where requests are sent
* @return a new SCA node.
*/
- public SCANode createSCANode(String nodeURI, String domainURI, String
nodeGroupURI) throws NodeException {
- return new SCANodeImpl(nodeURI, domainURI, nodeGroupURI);
+ public SCANode createSCANode(String physicalNodeURI, String domainURI,
String logicalNodeURI) throws NodeException {
+ return new SCANodeImpl(physicalNodeURI, domainURI, logicalNodeURI);
}
-
+
+ /**
+ * Creates a new SCA node. Many physical nodes may share the same logical
URL in load balancing
+ * and failover scenarios where each node in the group runs the same
contribution and
+ * active composites. Also allows a class loaded to b specified. This is
the
+ * classloader that will be used to load the management application used
by the
+ * node to talk to the domain
+ *
+ * @param physicalNodeURI the URI of the node, this URI is used to provide
the default
+ * host and port information for the runtime for situations when
bindings
+ * don't provide this information
+ * @param domainURI the URI of the domain that the node belongs to. This
URI is
+ * used to locate the domain manager on the network
+ * @param logicalNodeURI the uri of the node to be used in situations
where more than one node
+ * are grouped together for failover or load balancing scenarios.
The logicalNodeURI
+ * will typically identify the logical node where requests are
sent. If null is provided
+ * no logicalNodeURI is set.
+ * @param classLoader the class loader to use by default when loading
contributions. If null is provided
+ * the classloader the dervied automatically.
+ * @return a new SCA node.
+ */
+ public SCANode createSCANode(String physicalNodeURI, String domainURI,
String logicalNodeURI, ClassLoader classLoader) throws NodeException {
+ return new SCANodeImpl(physicalNodeURI, domainURI, logicalNodeURI,
classLoader);
+ }
+
+
}
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=601789&r1=601788&r2=601789&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 Dec 6 09:10:23 2007
@@ -202,7 +202,7 @@
nodeRuntime.getCompositeActivator().setDomainComposite(nodeComposite);
// create a link to the domain
- scaDomain = new SCADomainProxyImpl(domainURI);
+ scaDomain = new SCADomainProxyImpl(domainURI, nodeClassLoader);
// add the node URI to the domain
((SCADomainProxyImpl)scaDomain).addNode(this);
@@ -504,12 +504,17 @@
public void addToDomainLevelComposite(String compositePath) throws
NodeException {
if (compositePath == null){
- throw new NodeException("Composite path cannot be null");
+ addToDomainLevelComposite((QName)null);
+ } else {
+ Composite composite = compositeFiles.get(compositePath);
+
+ if (composite != null){
+ addToDomainLevelComposite(composite.getName());
+ } else {
+ throw new NodeException("Composite " + compositePath + " not
found" );
+ }
+
}
-
- Composite composite = compositeFiles.get(compositePath);
-
- addToDomainLevelComposite(composite.getName());
}
/**
@@ -670,8 +675,9 @@
String uriString = binding.getURI();
if (uriString != null) {
- String serviceName = null;
+ String serviceName = component.getURI() + '/' +
binding.getName();
+ /*
if (component != null) {
serviceName = component.getURI();
if (component.getServices().size() > 1){
@@ -680,7 +686,7 @@
} else {
serviceName = service.getName();
}
-
+ */
try {
((SCADomainEventService)scaDomain).registerServiceEndpoint(domainURI,
nodeURI,
@@ -703,22 +709,31 @@
private void resolveRemoteReferences(Composite composite){
// Loop through all reference binding URIs. Any that are not resolved
// should be looked up in the domain
+/*
for (Reference reference: composite.getReferences()) {
for (Binding binding: reference.getBindings()) {
resolveRemoteReferenceBinding(reference, binding);
}
}
+*/
for (Component component: composite.getComponents()) {
for (ComponentReference reference: component.getReferences()) {
+ for ( ComponentService service : reference.getTargets()){
+ for (Binding binding: service.getBindings()) {
+ resolveRemoteReferenceBinding(reference, service,
binding);
+ }
+ }
+/*
for (Binding binding: reference.getBindings()) {
resolveRemoteReferenceBinding(reference, binding);
}
+*/
}
}
}
- private void resolveRemoteReferenceBinding(Reference reference, Binding
binding){
+ private void resolveRemoteReferenceBinding(Reference reference, Service
service, Binding binding){
if (binding.isUnresolved()) {
// find the right endpoint for this reference/binding. This relies
on looking
// up every binding URI. If a response is returned then it's set
back into the
@@ -727,7 +742,7 @@
try {
uri =
((SCADomainEventService)scaDomain).findServiceEndpoint(domainURI,
-
binding.getURI(),
+
service.getName(),
binding.getClass().getName());
} catch(Exception ex) {
logger.log(Level.WARNING,
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=601789&r1=601788&r2=601789&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 Dec 6 09:10:23 2007
@@ -69,11 +69,11 @@
</service>
</component>
- <component name="node">
+ <!--component name="node">
<t:implementation.resource location="webroot"/>
<service name="Resource">
<t:binding.http/>
</service>
- </component>
+ </component-->
</composite>
Modified:
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java
(original)
+++
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java
Thu Dec 6 09:10:23 2007
@@ -1,5 +1,6 @@
package client;
+import java.net.URI;
import java.util.Hashtable;
import java.util.Properties;
@@ -19,11 +20,15 @@
try {
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
- //properties.setProperty(Context.PROVIDER_URL,
"ejbd://localhost:4201");
properties.setProperty(Context.PROVIDER_URL,
"ejbd://localhost:4201");
InitialContext context = new InitialContext(properties);
- //Catalog catalog =
(Catalog)context.lookup("EJBModule/org.apache.tuscany.sca/tutorial-catalog-ejb/1.1-incubating-SNAPSHOT/jar/SessionBeans/VegetablesCatalogImpl");
- Catalog catalog =
(Catalog)context.lookup("VegetablesCatalogImplRemote");
+
+ URI uri =
URI.create("JEEVegetablesCatalog/").resolve("java:VegetablesCatalogImplRemote");
+ System.out.println(uri.toString());
+
+ Catalog catalog =
(Catalog)context.lookup("java:VegetablesCatalogImplRemote");
+ //Catalog catalog =
(Catalog)context.lookup("java:JEEVegetablesCatalog/VegetablesCatalogImplRemote");
+
Item items[] = catalog.get();
System.out.println(items[0].getName());
Modified:
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java
(original)
+++
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java
Thu Dec 6 09:10:23 2007
@@ -25,7 +25,8 @@
import javax.ejb.Init;
import javax.ejb.Stateless;
[EMAIL PROTECTED]
[EMAIL PROTECTED](name="VegetablesCatalogImpl")
+//@Stateless
public class VegetablesCatalogImpl implements Catalog {
private List<Item> catalog = new ArrayList<Item>();
Added:
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/CatalogEJB.componentType
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/CatalogEJB.componentType?rev=601789&view=auto
==============================================================================
---
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/CatalogEJB.componentType
(added)
+++
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/CatalogEJB.componentType
Thu Dec 6 09:10:23 2007
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://store">
+
+ <service name="Catalog">
+ <interface.java interface="services.Catalog"/>
+ </service>
+
+</componentType>
Added:
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/catalog-jee.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/catalog-jee.composite?rev=601789&view=auto
==============================================================================
---
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/catalog-jee.composite
(added)
+++
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/catalog-jee.composite
Thu Dec 6 09:10:23 2007
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://store"
+ name="catalog-jee">
+
+ <component name="JEEVegetablesCatalog">
+ <implementation.ejb ejb-link="catalog-ejb.jar#CatalogEJB"/>
+ <service name="Catalog">
+ <binding.ejb uri="java:VegetablesCatalogImplRemote"/>
+ </service>
+ </component>
+
+</composite>
Modified: incubator/tuscany/java/sca/tutorial/catalog-jee/catalog-jee.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-jee/catalog-jee.composite?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/catalog-jee/catalog-jee.composite
(original)
+++ incubator/tuscany/java/sca/tutorial/catalog-jee/catalog-jee.composite Thu
Dec 6 09:10:23 2007
@@ -24,7 +24,7 @@
<component name="JEEVegetablesCatalog">
<implementation.ejb ejb-link="catalog-ejb.jar#CatalogEJB"/>
<service name="Catalog">
- <binding.ejb uri="CatalogEJB"/>
+ <binding.ejb uri="VegetablesCatalogImplRemote"/>
</service>
</component>
Modified: incubator/tuscany/java/sca/tutorial/cloud/launch/LaunchCloud.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/cloud/launch/LaunchCloud.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/cloud/launch/LaunchCloud.java (original)
+++ incubator/tuscany/java/sca/tutorial/cloud/launch/LaunchCloud.java Thu Dec
6 09:10:23 2007
@@ -25,6 +25,7 @@
import org.apache.tuscany.sca.domain.SCADomain;
import org.apache.tuscany.sca.domain.SCADomainFactory;
+import org.apache.tuscany.sca.domain.impl.SCADomainImpl;
import org.apache.tuscany.sca.node.SCANode;
import org.apache.tuscany.sca.node.SCANodeFactory;
import org.apache.tuscany.sca.node.util.SCAContributionUtil;
@@ -52,6 +53,16 @@
currencyNode.addToDomainLevelComposite(new QName("http://cloud",
"currency"));
currencyNode.start();
System.out.println("currency.composite ready for big business !!!");
+
+
+ // a hack to find out where the jar is
+ URL contribution =
SCAContributionUtil.findContributionFromResource(LaunchCloud.class.getClassLoader(),
"tutorial-catalog-ejb-1.1-incubating-SNAPSHOT.jar" );
+
+ if (contribution != null) {
+ contribution = new URL(contribution.toString() +
"tutorial-catalog-ejb-1.1-incubating-SNAPSHOT.jar" );
+ ((SCADomainImpl)domain).importContribution("vegetablescatalog",
contribution);
+ }
+
System.in.read();
System.out.println("Stopping ...");
Modified: incubator/tuscany/java/sca/tutorial/cloud/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/cloud/pom.xml?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/cloud/pom.xml (original)
+++ incubator/tuscany/java/sca/tutorial/cloud/pom.xml Thu Dec 6 09:10:23 2007
@@ -75,6 +75,13 @@
<version>1.1-incubating-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-ejb-xml</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
@@ -82,6 +89,13 @@
<version>1.1-incubating-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ejb</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
Added:
incubator/tuscany/java/sca/tutorial/cloud/tutorial-catalog-ejb-1.1-incubating-SNAPSHOT.jar
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/cloud/tutorial-catalog-ejb-1.1-incubating-SNAPSHOT.jar?rev=601789&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
incubator/tuscany/java/sca/tutorial/cloud/tutorial-catalog-ejb-1.1-incubating-SNAPSHOT.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java (original)
+++ incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java Thu Dec
6 09:10:23 2007
@@ -31,7 +31,7 @@
public static void main(String[] args) throws Exception {
System.out.println("Starting ...");
SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- SCANode node = nodeFactory.createSCANode(null,
"http://localhost:9999");
+ SCANode node = nodeFactory.createSCANode(null,
"http://localhost:9998");
URL contribution =
SCAContributionUtil.findContributionFromClass(LaunchStore.class);
node.addContribution("http://store", contribution);
Modified: incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDB.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDB.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDB.java
(original)
+++ incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDB.java Thu Dec
6 09:10:23 2007
@@ -31,7 +31,7 @@
public static void main(String[] args) throws Exception {
System.out.println("Starting ...");
SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- SCANode node = nodeFactory.createSCANode(null,
"http://localhost:9999");
+ SCANode node = nodeFactory.createSCANode(null,
"http://localhost:9998");
URL contribution =
SCAContributionUtil.findContributionFromClass(LaunchStoreDB.class);
node.addContribution("http://store", contribution);
Modified:
incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
---
incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java
(original)
+++
incubator/tuscany/java/sca/tutorial/store/launch/LaunchStoreDistributed.java
Thu Dec 6 09:10:23 2007
@@ -23,6 +23,8 @@
import javax.xml.namespace.QName;
+import org.apache.tuscany.sca.domain.SCADomain;
+import org.apache.tuscany.sca.node.SCADomainFinder;
import org.apache.tuscany.sca.node.SCANode;
import org.apache.tuscany.sca.node.SCANodeFactory;
import org.apache.tuscany.sca.node.util.SCAContributionUtil;
@@ -33,13 +35,13 @@
System.setProperty("java.naming.provider.url",
"ejbd://localhost:4201");
System.setProperty("managed", "false");
- System.out.println("Starting ...");
+ System.out.println("Starting ...");
+
SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
SCANode node = nodeFactory.createSCANode("http://localhost:8101",
"http://localhost:9998");
URL contribution =
SCAContributionUtil.findContributionFromClass(LaunchStoreDistributed.class);
node.addContribution("http://store", contribution);
-
node.addToDomainLevelComposite(new QName("http://store",
"store-distributed"));
node.start();
Modified: incubator/tuscany/java/sca/tutorial/store/store-distributed.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/store-distributed.composite?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/store-distributed.composite
(original)
+++ incubator/tuscany/java/sca/tutorial/store/store-distributed.composite Thu
Dec 6 09:10:23 2007
@@ -46,10 +46,11 @@
<binding.ws uri="/CatalogWebService"/>
</service>
<reference name="fruitsCatalog" target="CloudFruitsCatalog"/>
- <!--reference name="fruitsCatalog"
target="JSEFruitsCatalog"/-->
+ <!--reference name="fruitsCatalog" target="JSEFruitsCatalog"-->
<!--reference name="vegetablesCatalog"
target="CloudVegetablesCatalog"-->
- <reference name="vegetablesCatalog">
- <binding.ejb uri="VegetablesCatalogImplRemote"/>
+ <reference name="vegetablesCatalog"
target="JEEVegetablesCatalog">
+ <!--binding.ejb uri="VegetablesCatalogImplRemote"-->
+ <binding.ejb/>
</reference>
<reference name="currencyConverter"
target="CurrencyConverter"/>
</component>
Modified: incubator/tuscany/java/sca/tutorial/store/store-merger.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/store-merger.composite?rev=601789&r1=601788&r2=601789&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/store-merger.composite (original)
+++ incubator/tuscany/java/sca/tutorial/store/store-merger.composite Thu Dec 6
09:10:23 2007
@@ -25,7 +25,7 @@
<component name="Store">
<t:implementation.widget location="uiservices/store.html"/>
<service name="Widget">
- <t:binding.http uri="http://localhost:8101/ui"/>
+ <t:binding.http uri="/ui"/>
</service>
<reference name="catalog" target="Catalog">
<t:binding.jsonrpc/>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]