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/12/07 18:36:05 UTC
svn commit: r602164 - in /incubator/tuscany/java/sca:
modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/
modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/
modules/domain/src/main/java/org/apache/tuscany/s...
Author: slaws
Date: Fri Dec 7 09:35:56 2007
New Revision: 602164
URL: http://svn.apache.org/viewvc?rev=602164&view=rev
Log:
Some tidying for the distributed store sample and some related domain changes
Added:
incubator/tuscany/java/sca/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/provider/
incubator/tuscany/java/sca/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/provider/EJBImplementationProviderFactory.java
incubator/tuscany/java/sca/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
incubator/tuscany/java/sca/tutorial/cloud/CatalogEJB.componentType
incubator/tuscany/java/sca/tutorial/cloud/catalog-jee.composite
Removed:
incubator/tuscany/java/sca/tutorial/cloud/tutorial-catalog-ejb-1.1-incubating-SNAPSHOT.jar
Modified:
incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingProviderFactory.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/src/main/java/org/apache/tuscany/sca/domain/SCADomainSPI.java
incubator/tuscany/java/sca/modules/implementation-ejb/pom.xml
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/SCANodeImpl.java
incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java
incubator/tuscany/java/sca/tutorial/catalog-ejb/ (props changed)
incubator/tuscany/java/sca/tutorial/cloud/launch/LaunchCloud.java
incubator/tuscany/java/sca/tutorial/cloud/tuscany.properties
incubator/tuscany/java/sca/tutorial/store/store-distributed.composite
Modified: incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingProviderFactory.java?rev=602164&r1=602163&r2=602164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingProviderFactory.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingProviderFactory.java Fri Dec 7 09:35:56 2007
@@ -45,7 +45,8 @@
public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
RuntimeComponentService service,
EJBBinding binding) {
- throw new EJBBindingException("Service Binding not supported for EJB Binding");
+ return null;
+ //throw new EJBBindingException("Service Binding not supported for EJB Binding");
}
public Class<EJBBinding> getModelType() {
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=602164&r1=602163&r2=602164&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 Fri Dec 7 09:35:56 2007
@@ -258,11 +258,11 @@
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
- XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bos);
- processor.write(composite, writer);
- writer.flush();
- writer.close();
+ 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());
}
@@ -280,42 +280,33 @@
}
- private void registerRemoteServices(Composite composite){
+ public void registerRemoteServices(String nodeURI, 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);
+ registerRemoteServiceBinding(nodeURI, null, service, binding);
}
}
for (Component component: composite.getComponents()) {
for (ComponentService service: component.getServices()) {
for (Binding binding: service.getBindings()) {
- registerRemoteServiceBinding(component, service, binding);
+ registerRemoteServiceBinding(nodeURI, component, service, binding);
}
}
}
}
- private void registerRemoteServiceBinding(Component component, Service service, Binding binding ){
+ private void registerRemoteServiceBinding(String nodeURI, 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,
+ nodeURI,
serviceName,
binding.getClass().getName(),
uriString);
@@ -323,7 +314,7 @@
logger.log(Level.WARNING,
"Unable to register service: " +
domainModel.getDomainURI() + " " +
- IMPORTED + " " +
+ nodeURI + " " +
service.getName()+ " " +
binding.getClass().getName() + " " +
uriString);
@@ -684,40 +675,7 @@
public String getURI(){
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
Modified: incubator/tuscany/java/sca/modules/domain/src/main/java/org/apache/tuscany/sca/domain/SCADomainSPI.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain/src/main/java/org/apache/tuscany/sca/domain/SCADomainSPI.java?rev=602164&r1=602163&r2=602164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/domain/src/main/java/org/apache/tuscany/sca/domain/SCADomainSPI.java (original)
+++ incubator/tuscany/java/sca/modules/domain/src/main/java/org/apache/tuscany/sca/domain/SCADomainSPI.java Fri Dec 7 09:35:56 2007
@@ -21,6 +21,7 @@
import java.util.List;
+import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.domain.DomainException;
import org.apache.tuscany.sca.domain.SCADomain;
import org.apache.tuscany.sca.domain.model.DomainModel;
@@ -40,6 +41,13 @@
* @return
*/
public DomainModel getDomainModel();
+
+ /**
+ * Registers all of the services in the composite with the domain
+ *
+ * @param composite
+ */
+ public void registerRemoteServices(String nodeURI, Composite composite);
}
Modified: incubator/tuscany/java/sca/modules/implementation-ejb/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb/pom.xml?rev=602164&r1=602163&r2=602164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-ejb/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/implementation-ejb/pom.xml Fri Dec 7 09:35:56 2007
@@ -36,6 +36,19 @@
<artifactId>tuscany-assembly</artifactId>
<version>1.1-incubating-SNAPSHOT</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
Added: incubator/tuscany/java/sca/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/provider/EJBImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/provider/EJBImplementationProviderFactory.java?rev=602164&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/provider/EJBImplementationProviderFactory.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/provider/EJBImplementationProviderFactory.java Fri Dec 7 09:35:56 2007
@@ -0,0 +1,45 @@
+/*
+ * 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.implementation.ejb.provider;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.implementation.ejb.EJBImplementation;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * The model representing a resource implementation in an SCA assembly model.
+ */
+public class EJBImplementationProviderFactory implements ImplementationProviderFactory<EJBImplementation> {
+
+ /**
+ * Constructs a resource implementation.
+ */
+ public EJBImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
+ }
+
+ public ImplementationProvider createImplementationProvider(RuntimeComponent component, EJBImplementation implementation) {
+ return null;
+ }
+
+ public Class<EJBImplementation> getModelType() {
+ return EJBImplementation.class;
+ }
+}
Added: incubator/tuscany/java/sca/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory?rev=602164&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory (added)
+++ incubator/tuscany/java/sca/modules/implementation-ejb/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory Fri Dec 7 09:35:56 2007
@@ -0,0 +1,19 @@
+# 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.
+
+# Implementation class for the implementation extension
+org.apache.tuscany.sca.implementation.ejb.provider.EJBImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.ejb.EJBImplementation
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=602164&r1=602163&r2=602164&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 Dec 7 09:35:56 2007
@@ -19,6 +19,7 @@
package org.apache.tuscany.sca.node.impl;
+import java.io.ByteArrayOutputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.URI;
@@ -27,6 +28,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;
@@ -36,7 +39,10 @@
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.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
import org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.assembly.ActivationException;
import org.apache.tuscany.sca.core.context.CallableReferenceImpl;
import org.apache.tuscany.sca.domain.DomainException;
@@ -44,6 +50,7 @@
import org.apache.tuscany.sca.domain.SCADomainEventService;
import org.apache.tuscany.sca.domain.impl.SCADomainImpl;
import org.apache.tuscany.sca.domain.impl.SCADummyNodeImpl;
+import org.apache.tuscany.sca.domain.model.CompositeModel;
import org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime;
import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
@@ -287,6 +294,43 @@
} catch(Exception ex) {
throw new DomainException(ex);
}
+ }
+
+
+ public String getComposite(QName compositeQName){
+
+ Composite composite = null;
+ for(Composite tmpComposite : domainManagementComposite.getIncludes()){
+ if (tmpComposite.getName().equals(compositeQName)){
+ composite = tmpComposite;
+ }
+ }
+
+ String compositeString = null;
+
+ if (composite != null){
+ 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());
+ }
+
+ compositeString = bos.toString();
+ }
+
+ return compositeString;
}
// SCADomainEventService methods
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=602164&r1=602163&r2=602164&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 Dec 7 09:35:56 2007
@@ -78,7 +78,6 @@
private String logicalNodeURI;
private String domainURI;
-
// The tuscany runtime that does the hard work
private ReallySmallRuntime nodeRuntime;
@@ -86,7 +85,7 @@
private Composite nodeComposite;
// the domain that the node belongs to. This object acts as a proxy to the domain
- private SCADomain scaDomain;
+ private SCADomainProxyImpl scaDomain;
// the started status of the node
private boolean nodeStarted = false;
@@ -205,7 +204,7 @@
scaDomain = new SCADomainProxyImpl(domainURI, nodeClassLoader);
// add the node URI to the domain
- ((SCADomainProxyImpl)scaDomain).addNode(this);
+ scaDomain.addNode(this);
} catch(NodeException ex) {
throw ex;
@@ -286,8 +285,8 @@
factories.removeFactory(nodeFactory);
nodeFactory.setNode(null);
- ((SCADomainProxyImpl)scaDomain).removeNode(this);
- ((SCADomainProxyImpl)scaDomain).destroy();
+ scaDomain.removeNode(this);
+ scaDomain.destroy();
// node runtime is stopped by the domain proxy once it has
// removed the management components
@@ -365,7 +364,7 @@
// add the contribution to the domain. It will generally already be there
// unless the contribution has been added to the node itself.
- ((SCADomainProxyImpl)scaDomain).registerContribution(nodeURI, contributionURI, contributionURL.toExternalForm());
+ scaDomain.registerContribution(nodeURI, contributionURI, contributionURL.toExternalForm());
} catch (Exception ex) {
throw new NodeException(ex);
@@ -412,7 +411,7 @@
// 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);
+ scaDomain.unregisterContribution(nodeURI, contributionURI);
} catch (Exception ex) {
throw new NodeException(ex);
@@ -466,7 +465,7 @@
try {
// register the composite with the domain
- ((SCADomainProxyImpl)scaDomain).registerDomainLevelComposite(nodeURI, composite.getName().toString());
+ scaDomain.registerDomainLevelComposite(nodeURI, composite.getName().toString());
} catch (Exception ex) {
throw new NodeException(ex);
@@ -492,7 +491,7 @@
try {
// register the composite with the domain
- ((SCADomainProxyImpl)scaDomain).registerDomainLevelComposite(nodeURI, composite.getName().toString());
+ scaDomain.registerDomainLevelComposite(nodeURI, composite.getName().toString());
} catch (Exception ex) {
throw new NodeException(ex);
@@ -619,7 +618,7 @@
nodeRuntime.getCompositeActivator().activate(composite);
// tell the domain where all the service endpoints are
- registerRemoteServices(composite);
+ scaDomain.registerRemoteServices(nodeURI, composite);
// get up to date with where all services we depend on are
resolveRemoteReferences(composite);
@@ -653,69 +652,18 @@
nodeRuntime.getCompositeActivator().deactivate(composite);
}
- 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 {
- ((SCADomainEventService)scaDomain).registerServiceEndpoint(domainURI,
- nodeURI,
- serviceName,
- binding.getClass().getName(),
- uriString);
- } catch(Exception ex) {
- logger.log(Level.WARNING,
- "Unable to register service: " +
- domainURI + " " +
- nodeURI + " " +
- service.getName()+ " " +
- binding.getClass().getName() + " " +
- uriString);
- }
- }
- }
- }
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 ( ComponentService service : reference.getTargets()){
+ for (Binding binding: service.getBindings()) {
+ resolveRemoteReferenceBinding(reference, service, binding);
+ }
+ }
+ }
for (Component component: composite.getComponents()) {
for (ComponentReference reference: component.getReferences()) {
@@ -723,12 +671,7 @@
for (Binding binding: service.getBindings()) {
resolveRemoteReferenceBinding(reference, service, binding);
}
- }
-/*
- for (Binding binding: reference.getBindings()) {
- resolveRemoteReferenceBinding(reference, binding);
- }
-*/
+ }
}
}
}
@@ -759,7 +702,6 @@
}
}
}
-
public void setReferenceEndpoint(String referenceName, String bindingClassName, String serviceURI) throws NodeException {
// find the named reference and binding and update the uri from this message
@@ -773,7 +715,6 @@
}
}
}
-
}
private Reference findReference(String referenceName){
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=602164&r1=602163&r2=602164&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 Dec 7 09:35:56 2007
@@ -26,6 +26,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.SCADomainFinder;
import org.apache.tuscany.sca.node.SCANode;
import org.apache.tuscany.sca.node.SCANodeFactory;
@@ -133,6 +134,8 @@
public void testDomain() throws Exception {
// the domain itself
addServiceBDomain = domain.getService(AddService.class, "AddServiceComponentB");
+
+ System.out.println(((SCADomainProxyImpl)nodeA.getDomain()).getComposite(new QName("http://sample", "CalculatorA")));
Assert.assertEquals(addServiceBDomain.add(3, 2), 5.0);
}
Propchange: incubator/tuscany/java/sca/tutorial/catalog-ejb/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 7 09:35:56 2007
@@ -1,3 +1,4 @@
.classpath
.project
.settings
+target
Added: incubator/tuscany/java/sca/tutorial/cloud/CatalogEJB.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/cloud/CatalogEJB.componentType?rev=602164&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tutorial/cloud/CatalogEJB.componentType (added)
+++ incubator/tuscany/java/sca/tutorial/cloud/CatalogEJB.componentType Fri Dec 7 09:35:56 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/cloud/catalog-jee.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/cloud/catalog-jee.composite?rev=602164&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tutorial/cloud/catalog-jee.composite (added)
+++ incubator/tuscany/java/sca/tutorial/cloud/catalog-jee.composite Fri Dec 7 09:35:56 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/cloud/launch/LaunchCloud.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/cloud/launch/LaunchCloud.java?rev=602164&r1=602163&r2=602164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/cloud/launch/LaunchCloud.java (original)
+++ incubator/tuscany/java/sca/tutorial/cloud/launch/LaunchCloud.java Fri Dec 7 09:35:56 2007
@@ -44,6 +44,9 @@
URL catalogsContribution = SCAContributionUtil.findContributionFromClass(LaunchCloud.class);
catalogsNode.addContribution("http://cloud", catalogsContribution);
catalogsNode.addToDomainLevelComposite(new QName("http://cloud", "catalogs"));
+ // the ejb component simply provides the meta data required to locate the
+ // EJB running in Geronimo
+ catalogsNode.addToDomainLevelComposite(new QName("http://store", "catalog-jee"));
catalogsNode.start();
System.out.println("catalogs.composite ready for big business !!!");
@@ -52,18 +55,8 @@
currencyNode.addContribution("http://cloud", currencyContribution);
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.out.println("currency.composite ready for big business !!!");
+
System.in.read();
System.out.println("Stopping ...");
currencyNode.destroy();
Modified: incubator/tuscany/java/sca/tutorial/cloud/tuscany.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/cloud/tuscany.properties?rev=602164&r1=602163&r2=602164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/cloud/tuscany.properties (original)
+++ incubator/tuscany/java/sca/tutorial/cloud/tuscany.properties Fri Dec 7 09:35:56 2007
@@ -1,3 +1,3 @@
-nodeName=http://localhost:8080/tuscany/
+nodeName=http://localhost:8081/tuscany/
domainName=http://localhost:9998
hotDeployInterval=10000
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=602164&r1=602163&r2=602164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/store-distributed.composite (original)
+++ incubator/tuscany/java/sca/tutorial/store/store-distributed.composite Fri Dec 7 09:35:56 2007
@@ -45,8 +45,8 @@
<t:binding.jsonrpc/>
<binding.ws uri="/CatalogWebService"/>
</service>
- <reference name="fruitsCatalog" target="CloudFruitsCatalog"/>
- <!--reference name="fruitsCatalog" target="JSEFruitsCatalog"-->
+ <!--reference name="fruitsCatalog" target="CloudFruitsCatalog"-->
+ <reference name="fruitsCatalog" target="JSEFruitsCatalog"/>
<!--reference name="vegetablesCatalog" target="CloudVegetablesCatalog"-->
<reference name="vegetablesCatalog" target="JEEVegetablesCatalog">
<!--binding.ejb uri="VegetablesCatalogImplRemote"-->
@@ -67,6 +67,6 @@
<component name="CurrencyConverter">
<implementation.java class="services.CurrencyConverterImpl"/>
- </component>
+ </component>
</composite>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org