You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/05/05 08:32:01 UTC
svn commit: r535457 - in /incubator/tuscany/java/sca/modules:
assembly/src/main/java/org/apache/tuscany/assembly/util/
contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/
contribution/src/main/java/org/apache/tuscany/contribut...
Author: jsdelfino
Date: Fri May 4 23:32:00 2007
New Revision: 535457
URL: http://svn.apache.org/viewvc?view=rev&rev=535457
Log:
Changed the runtime activator and domain facade to only include the specified composite in the domain. Changed Contribution service contribute method to return the model for the contribution. Fixed SCADomain.getService to work with composite services.
Modified:
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java
incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java
incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/service/ContributionService.java
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivator.java
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivatorImpl.java
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeComponentImpl.java
incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/DefaultSCADomain.java
incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/MiniRuntimeImpl.java
Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java?view=diff&rev=535457&r1=535456&r2=535457
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java Fri May 4 23:32:00 2007
@@ -18,16 +18,11 @@
*/
package org.apache.tuscany.assembly.util;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathExpressionException;
-
import org.apache.tuscany.assembly.AssemblyFactory;
import org.apache.tuscany.assembly.Base;
import org.apache.tuscany.assembly.Binding;
@@ -389,7 +384,8 @@
// Check that a type or element are specified
if (componentProperty.getXSDElement() == null && componentProperty.getXSDType() == null) {
- problems.add(componentProperty);
+ //FIXME tolerate this for now
+ //problems.add(componentProperty);
}
}
}
@@ -559,7 +555,9 @@
reconcileProperties(component, properties, componentProperties, problems);
// Create self references to the component's services
- createSelfReferences(component);
+ if (!(implementation instanceof Composite)) {
+ createSelfReferences(component);
+ }
}
}
@@ -929,12 +927,24 @@
ComponentService promotedService = getPromotedComponentService(compositeService);
if (promotedService != null) {
- // Add the component service to the innermost
- // promoted component
+ // Create a new component service to represent this composite
+ // service on the promoted component
SCABinding scaBinding = promotedService.getBinding(SCABinding.class);
if (scaBinding != null) {
Component promotedComponent = scaBinding.getComponent();
- promotedComponent.getServices().add(componentService);
+ ComponentService newComponentService = assemblyFactory.createComponentService();
+ newComponentService.setName("$promoted$." + compositeService.getName());
+ //newComponentService.setService(compositeService);
+ promotedComponent.getServices().add(newComponentService);
+ newComponentService.getBindings().add(scaBinding);
+ newComponentService.getBindings().addAll(compositeService.getBindings());
+ newComponentService.setInterfaceContract(compositeService.getInterfaceContract());
+ newComponentService.setCallback(compositeService.getCallback());
+
+ // Change the composite service to now promote the newly
+ // created component service directly
+ compositeService.setPromotedService(newComponentService);
+
} else {
problems.add(promotedService);
}
@@ -951,23 +961,21 @@
if (promotedService != null) {
// Create a new component service to represent this composite
- // service
- // on the promoted component
+ // service on the promoted component
SCABinding scaBinding = promotedService.getBinding(SCABinding.class);
if (scaBinding != null) {
- Component component = scaBinding.getComponent();
+ Component promotedComponent = scaBinding.getComponent();
ComponentService newComponentService = assemblyFactory.createComponentService();
- newComponentService.setName(null);
- newComponentService.setService(compositeService);
- component.getServices().add(newComponentService);
+ newComponentService.setName("$promoted$." + compositeService.getName());
+ //newComponentService.setService(compositeService);
+ promotedComponent.getServices().add(newComponentService);
newComponentService.getBindings().add(scaBinding);
newComponentService.getBindings().addAll(compositeService.getBindings());
newComponentService.setInterfaceContract(compositeService.getInterfaceContract());
newComponentService.setCallback(compositeService.getCallback());
// Change the composite service to now promote the newly
- // created
- // component service directly
+ // created component service directly
compositeService.setPromotedService(newComponentService);
} else {
problems.add(promotedService);
Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java?view=diff&rev=535457&r1=535456&r2=535457
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java Fri May 4 23:32:00 2007
@@ -34,15 +34,14 @@
import org.w3c.dom.Node;
/**
- * A simple print utility class to help print assembly model instances.
+ * A simple print utility class to help print model instances.
*
* @version $Rev$ $Date$
*/
public class PrintUtil {
- PrintWriter out;
- Set<Object> objects = new HashSet<Object>();
- int indent;
+ private PrintWriter out;
+ private int indent;
public PrintUtil(OutputStream out) {
this.out = new PrintWriter(new OutputStreamWriter(out), true);
@@ -55,21 +54,32 @@
}
/**
- * Print a model object.
+ * Print an object.
*
* @param object
*/
public void print(Object object) {
- if(true) {
+ Set<Integer> objects = new HashSet<Integer>();
+ print(object, objects);
+ }
+
+ /**
+ * Print an object.
+ *
+ * @param object
+ */
+ private void print(Object object, Set<Integer> printed) {
+ if (object == null) {
return;
}
- if (objects.contains(object)) {
+ int id = System.identityHashCode(object);
+ if (printed.contains(id)) {
// If we've already printed an object, print just it's hashcode
indent();
- out.println(object.getClass().getName() + "@" + System.identityHashCode(object));
+ out.println(object.getClass().getName() + "@" + id);
} else {
- objects.add(object);
+ printed.add(id);
try {
// Print the object class name
@@ -104,7 +114,7 @@
// Print each element, recursively
for (Object element : (List)value) {
indent++;
- print(element);
+ print(element, printed);
indent--;
}
indent();
@@ -139,7 +149,7 @@
indent();
out.println(propertyDescriptor.getName() + "= {");
indent++;
- print(value);
+ print(value, printed);
indent--;
indent();
out.println("}");
Modified: incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java?view=diff&rev=535457&r1=535456&r2=535457
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java Fri May 4 23:32:00 2007
@@ -55,43 +55,43 @@
/**
* Repository where contributions are stored. Usually set by injection.
*/
- protected ContributionRepository contributionRepository;
+ private ContributionRepository contributionRepository;
/**
* Registry of available package processors.
*/
- protected PackageProcessor packageProcessor;
+ private PackageProcessor packageProcessor;
/**
* Registry of available artifact processors
*/
- protected URLArtifactProcessor artifactProcessor;
+ private URLArtifactProcessor artifactProcessor;
/**
* Artifact Resolver
*/
- protected ArtifactResolver artifactResolver;
+ private ArtifactResolver artifactResolver;
/**
* xml factory used to create reader instance to load contribution metadata
*/
- protected XMLInputFactory xmlFactory;
+ private XMLInputFactory xmlFactory;
/**
* contribution metadata loader
*/
- protected ContributionMetadataLoaderImpl contributionLoader;
+ private ContributionMetadataLoaderImpl contributionLoader;
/**
* Contribution registry This is a registry of processed Contributios index by URI
*/
- protected Map<URI, Contribution> contributionRegistry = new HashMap<URI, Contribution>();
+ private Map<URI, Contribution> contributionRegistry = new HashMap<URI, Contribution>();
/**
* Contribution model facotry
*/
- protected ContributionFactory contributionFactory;
+ private ContributionFactory contributionFactory;
public ContributionServiceImpl(ContributionRepository repository,
@@ -112,7 +112,7 @@
this.contributionLoader = new ContributionMetadataLoaderImpl(assemblyFactory, contributionFactory);
}
- public void contribute(URI contributionURI, URL sourceURL, boolean storeInRepository) throws ContributionException,
+ public Contribution contribute(URI contributionURI, URL sourceURL, boolean storeInRepository) throws ContributionException,
IOException {
if (contributionURI == null) {
throw new IllegalArgumentException("URI for the contribution is null");
@@ -120,12 +120,12 @@
if (sourceURL == null) {
throw new IllegalArgumentException("Source URL for the contribution is null");
}
- addContribution(contributionURI, sourceURL, null, storeInRepository);
+ return addContribution(contributionURI, sourceURL, null, storeInRepository);
}
- public void contribute(URI contributionURI, URL sourceURL, InputStream input)
+ public Contribution contribute(URI contributionURI, URL sourceURL, InputStream input)
throws ContributionException, IOException {
- addContribution(contributionURI, sourceURL, input, true);
+ return addContribution(contributionURI, sourceURL, input, true);
}
private Contribution initializeContributionMetadata(URL sourceURL) throws ContributionException {
@@ -222,10 +222,11 @@
* @param contributionStream contribution content
* @param storeInRepository flag if we store the contribution into the
* repository or not
+ * @return the contribution model representing the contribution
* @throws IOException
* @throws DeploymentException
*/
- private void addContribution(URI contributionURI,
+ private Contribution addContribution(URI contributionURI,
URL sourceURL,
InputStream contributionStream,
boolean storeInRepository) throws IOException, ContributionException {
@@ -268,10 +269,11 @@
processReadPhase(contribution, contributionArtifacts);
processResolvePhase(contribution);
- processDeployables(contribution);
// store the contribution on the registry
this.contributionRegistry.put(URI.create(contribution.getURI()), contribution);
+
+ return contribution;
}
/**
@@ -286,7 +288,6 @@
private void processReadPhase(Contribution contribution, List<URI> artifacts) throws ContributionException,
MalformedURLException {
URL contributionURL = new URL(contribution.getLocation());
- URI contributionURI = URI.create(contribution.getURI());
for (URI a : artifacts) {
URL artifactURL = packageProcessor.getArtifactURL(new URL(contribution.getLocation()), a);
Object model = this.artifactProcessor.read(contributionURL, a, artifactURL);
@@ -294,9 +295,8 @@
if (model != null) {
artifactResolver.add(model);
- URI artifactURI = contributionURI.resolve(a);
DeployedArtifact artifact = this.contributionFactory.createDeplyedArtifact();
- artifact.setURI(artifactURI.toString());
+ artifact.setURI(a.toString());
artifact.setLocation(artifactURL.toString());
artifact.setModel(model);
contribution.getArtifacts().add(artifact);
@@ -311,6 +311,7 @@
* @param contribution
* @throws ContributionException
*/
+ @SuppressWarnings("unchecked")
private void processResolvePhase(Contribution contribution) throws ContributionException {
// for each artifact that was processed on the contribution
for (DeployedArtifact artifact : contribution.getArtifacts()) {
@@ -331,23 +332,4 @@
contribution.getDeployables().addAll(resolvedDeployables);
}
- /**
- * If there is no specific composite promoted as deployable in sca contribution metadata sidefile
- * All composites are promoted as deployables
- *
- * @param contribution
- * @throws ContributionException
- */
- private void processDeployables(Contribution contribution) throws ContributionException {
- if (contribution.getDeployables() == null || contribution.getDeployables().size() == 0) {
- //Contribution metadata not available with a list of deployables
- //Promote all composites to deployable
- for (DeployedArtifact deployedArtifact : contribution.getArtifacts()) {
- Object model = deployedArtifact.getModel();
- if (model instanceof Composite) {
- contribution.getDeployables().add((Composite) model);
- }
- }
- }
- }
}
Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/service/ContributionService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/service/ContributionService.java?view=diff&rev=535457&r1=535456&r2=535457
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/service/ContributionService.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/service/ContributionService.java Fri May 4 23:32:00 2007
@@ -44,10 +44,11 @@
* @param sourceURL the location of the resource containing the artifact
* @param storeInRepository flag that identifies if you want to copy the
* contribution to the repository
+ * @return the contribution model representing the contribution
* @throws DeploymentException if there was a problem with the contribution
* @throws IOException if there was a problem reading the resource
*/
- void contribute(URI contributionURI, URL sourceURL, boolean storeInRepository) throws ContributionException,
+ Contribution contribute(URI contributionURI, URL sourceURL, boolean storeInRepository) throws ContributionException,
IOException;
/**
@@ -60,10 +61,11 @@
* @param contributionContent a stream containing the resource being
* contributed; the stream will not be closed but the read
* position after the call is undefined
+ * @return the contribution model representing the contribution
* @throws DeploymentException if there was a problem with the contribution
* @throws IOException if there was a problem reading the stream
*/
- void contribute(URI contributionURI, URL sourceURL, InputStream contributionContent)
+ Contribution contribute(URI contributionURI, URL sourceURL, InputStream contributionContent)
throws ContributionException, IOException;
/**
Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivator.java?view=diff&rev=535457&r1=535456&r2=535457
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivator.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivator.java Fri May 4 23:32:00 2007
@@ -41,7 +41,7 @@
*/
void stop() throws ActivationException;
- void start(Contribution contribution) throws ActivationException;
+ void start(Contribution contribution, String deployable) throws ActivationException;
void stop(Contribution contribution) throws ActivationException;
/**
Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivatorImpl.java?view=diff&rev=535457&r1=535456&r2=535457
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivatorImpl.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeActivatorImpl.java Fri May 4 23:32:00 2007
@@ -38,6 +38,7 @@
import org.apache.tuscany.assembly.AssemblyFactory;
import org.apache.tuscany.assembly.Composite;
import org.apache.tuscany.contribution.Contribution;
+import org.apache.tuscany.contribution.DeployedArtifact;
import org.apache.tuscany.core.ExtensionPointRegistry;
import org.apache.tuscany.core.ModuleActivator;
import org.apache.tuscany.core.WireProcessorExtensionPoint;
@@ -287,10 +288,12 @@
throw new IllegalArgumentException("ComponentContext for component named: " + componentName + " not found in this domain");
}
- public void start(Contribution contribution) throws ActivationException {
+ public void start(Contribution contribution, String deployable) throws ActivationException {
// Add the deployable composites to the SCA domain by "include"
- for (Composite composite : contribution.getDeployables()) {
- domain.getIncludes().add(composite);
+ for (DeployedArtifact artifact : contribution.getArtifacts()) {
+ if (deployable.equals(artifact.getURI())) {
+ domain.getIncludes().add((Composite)artifact.getModel());
+ }
}
// Activate the SCA domain composite
Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeComponentImpl.java?view=diff&rev=535457&r1=535456&r2=535457
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeComponentImpl.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeComponentImpl.java Fri May 4 23:32:00 2007
@@ -89,11 +89,11 @@
}
public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) {
- List<ComponentReference> refs = getReferences();
- for (ComponentReference ref : refs) {
- if (ref.getName().equals(referenceName) || referenceName.equals("$self$.")
- && ref.getName().startsWith(referenceName)) {
- RuntimeComponentReference attachPoint = (RuntimeComponentReference)ref;
+ List<ComponentReference> references = getReferences();
+ for (ComponentReference reference : references) {
+ if (reference.getName().equals(referenceName) || referenceName.equals("$self$.")
+ && reference.getName().startsWith(referenceName)) {
+ RuntimeComponentReference attachPoint = (RuntimeComponentReference)reference;
RuntimeWire wire = attachPoint.getRuntimeWires().get(0);
WireObjectFactory<B> factory = new WireObjectFactory<B>(businessInterface, wire, proxyService);
return new ServiceReferenceImpl<B>(businessInterface, factory);
Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/DefaultSCADomain.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/DefaultSCADomain.java?view=diff&rev=535457&r1=535456&r2=535457
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/DefaultSCADomain.java (original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/DefaultSCADomain.java Fri May 4 23:32:00 2007
@@ -30,8 +30,12 @@
import org.apache.tuscany.assembly.AssemblyFactory;
import org.apache.tuscany.assembly.Component;
+import org.apache.tuscany.assembly.ComponentService;
import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.CompositeService;
+import org.apache.tuscany.assembly.SCABinding;
import org.apache.tuscany.contribution.Contribution;
+import org.apache.tuscany.contribution.DeployedArtifact;
import org.apache.tuscany.contribution.service.ContributionException;
import org.apache.tuscany.contribution.service.ContributionService;
import org.apache.tuscany.contribution.service.util.FileHelper;
@@ -58,7 +62,7 @@
private String[] composites;
private Composite domainComposite;
private Contribution contribution;
- private Map<String, ComponentContext> components = new HashMap<String, ComponentContext>();
+ private Map<String, Component> components = new HashMap<String, Component>();
private ReallySmallRuntime runtime;
/**
@@ -109,8 +113,18 @@
domainComposite.setName(new QName(Constants.SCA_NS, "domain"));
domainComposite.setURI(domainURI);
- // Add the deployable composites to the SCA domain by "include"
- for (Composite composite : contribution.getDeployables()) {
+ // Include all specified deployable composites in the SCA domain
+ Map<String, Composite> compositeArtifacts = new HashMap<String, Composite>();
+ for (DeployedArtifact artifact : contribution.getArtifacts()) {
+ if (artifact.getModel() instanceof Composite) {
+ compositeArtifacts.put(artifact.getURI(), (Composite)artifact.getModel());
+ }
+ }
+ for (String compositePath: composites) {
+ Composite composite = compositeArtifacts.get(compositePath);
+ if (composite == null) {
+ throw new ServiceRuntimeException("Composite not found: " + compositePath);
+ }
domainComposite.getIncludes().add(composite);
}
@@ -130,7 +144,7 @@
// Index the top level components
for (Component component: domainComposite.getComponents()) {
- components.put(component.getName(), (ComponentContext)component);
+ components.put(component.getName(), component);
}
}
@@ -226,21 +240,59 @@
}
@Override
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String serviceName) {
+ public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String name) {
+
+ // Extract the component name
String componentName;
- int i = serviceName.indexOf('/');
+ String serviceName;
+ int i = name.indexOf('/');
if (i != -1) {
- componentName = serviceName.substring(0, i);
- serviceName = serviceName.substring(i+1);
+ componentName = name.substring(0, i);
+ serviceName = name.substring(i+1);
} else {
- componentName = serviceName;
+ componentName = name;
serviceName = null;
}
- ComponentContext componentContext = components.get(componentName);
- if (componentContext == null) {
+
+ // Lookup the component in the domain
+ Component component = components.get(componentName);
+ if (component == null) {
throw new ServiceRuntimeException("Component not found: " + componentName);
}
+ ComponentContext componentContext = null;
+
+ // If the component is a composite, then we need to find the non-composite
+ // component that provides the requested service
+ if (component.getImplementation() instanceof Composite) {
+ ComponentService promotedService = null;
+ for (ComponentService componentService: component.getServices()) {
+ if (serviceName == null || serviceName.equals(componentService.getName())) {
+
+ CompositeService compositeService = (CompositeService)componentService.getService();
+ if (compositeService != null) {
+ promotedService = compositeService.getPromotedService();
+ SCABinding scaBinding = promotedService.getBinding(SCABinding.class);
+ if (scaBinding != null) {
+ Component promotedComponent = scaBinding.getComponent();
+ if (serviceName != null) {
+ serviceName = "$promoted$." + serviceName;
+ }
+ componentContext = (ComponentContext)promotedComponent;
+ }
+ }
+ break;
+ }
+ }
+ if (componentContext == null) {
+ if (component == null) {
+ throw new ServiceRuntimeException("Composite service not found: " + name);
+ }
+ }
+ } else {
+ componentContext = (ComponentContext)component;
+ }
+
ServiceReference<B> serviceReference;
if (serviceName != null) {
serviceReference = componentContext.createSelfReference(businessInterface, serviceName);
@@ -256,4 +308,4 @@
return domainURI;
}
-}
+}
\ No newline at end of file
Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/MiniRuntimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/MiniRuntimeImpl.java?view=diff&rev=535457&r1=535456&r2=535457
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/MiniRuntimeImpl.java (original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/MiniRuntimeImpl.java Fri May 4 23:32:00 2007
@@ -109,7 +109,7 @@
}
Contribution contribution = contributionService.getContribution(uri);
- super.start(contribution);
+ super.start(contribution, runtimeInfo.getCompositePath());
CompositeContext context = new SimpleCompositeContextImpl(this, domain);
CurrentCompositeContext.setContext(context);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org