summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-03-04 15:21:01 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-03-04 15:21:01 +0000
commit01ffb77060cd182ff375340057802957085f65c6 (patch)
tree2ed071aa88fbaed06abb04a93f1aef7f41583934
parent0c40f33551e17e5a1fb891f3714873c3ec225e70 (diff)
TUSCANY-2809 Start adding Endpoint and EndpoitReference structures. Named with a 2 at the end so that I can develop in parallel with what is already there. I intend to carry on adding endpoint function but only actually enable if locally until we get to the point where it can replace function that people are already relying on to develop other parts of the code base. At them moment there is some builder support but no activators so the Endpoint structures don't do anything useful yet.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@750047 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java13
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java104
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java131
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java13
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java14
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseBuilderImpl.java50
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java10
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceEndpointReferenceBuilderImpl.java392
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceEndpointBuilderImpl.java124
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java4
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java9
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java102
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java121
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java9
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java6
15 files changed, 1097 insertions, 5 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java
index 7a972f36f9..7963f05a0a 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java
@@ -145,6 +145,17 @@ public interface AssemblyFactory {
*/
Wire createWire();
- // Extension createExtension();
+ /**
+ * Create a new endpoint
+ *
+ * @return a new endpoint
+ */
+ Endpoint2 createEndpoint();
+ /**
+ * Create a new endpoint reference
+ *
+ * @return a new endpoint reference
+ */
+ EndpointReference2 createEndpointReference();
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java
new file mode 100644
index 0000000000..bcc5adf30a
--- /dev/null
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java
@@ -0,0 +1,104 @@
+/*
+ * 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.assembly;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+
+/**
+ * Represents a service endpoint which is what results from having a configured
+ * binding applied to a component service. In a deployed application an endpoint
+ * will relate directly to a physical endpoint, for example, a HTTP URL or a
+ * JMS destination.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Endpoint2 extends Base, Cloneable {
+
+ /**
+ * Get the component model object
+ *
+ * @return component
+ */
+ Component getComponent();
+
+ /**
+ * Set the component model object
+ *
+ * @param component
+ */
+ void setComponent(Component component);
+
+ /**
+ * Get the service model object
+ *
+ * @return service
+ */
+ ComponentService getService();
+
+ /**
+ * Set the service model object
+ *
+ * @param service
+ */
+ void setService(ComponentService service);
+
+ /**
+ * Get the resolved target binding
+ *
+ * @return target binding
+ */
+ Binding getBinding();
+
+ /**
+ * Set the binding
+ *
+ * @param binding
+ */
+ void setBinding(Binding binding);
+
+ /**
+ * Returns the interface contract defining the interface
+ *
+ * @return the interface contract
+ */
+ InterfaceContract getInterfaceContract();
+
+ /**
+ * Sets the interface contract defining the interface
+ *
+ * @param interfaceContract the interface contract
+ */
+ void setInterfaceContract(InterfaceContract interfaceContract);
+
+ /**
+ * Returns the binding specific URI for this endpoint.
+ *
+ * @return uri the binding specific URI
+ */
+ String getURI();
+
+ /**
+ * Sets the binding specific URI for this endpoint.
+ *
+ * @param uri the binding specific URI
+ */
+ void setURI(String uri);
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java
new file mode 100644
index 0000000000..d43274ad6c
--- /dev/null
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java
@@ -0,0 +1,131 @@
+/*
+ * 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.assembly;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+
+/**
+ * Represents an endpoint reference. An SCA reference can reference service enpoints in a
+ * number of ways. Target names, autowire, configured bindings. The endpoint reference
+ * captures the result of specifying one of these things.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface EndpointReference2 extends Base, Cloneable {
+
+ /**
+ * Get the name of the target service that this endpoint reference refers to
+ *
+ * @return target service name
+ */
+ String getTargetName();
+
+ /**
+ * Set the name of the target service that this endpoint reference refers to
+ *
+ * @param targetName
+ */
+ void setTargetName(String targetName);
+
+ /**
+ * Get the component model object
+ *
+ * @return component
+ */
+ Component getComponent();
+
+ /**
+ * Set the component model object
+ *
+ * @param component the component for the endpoint
+ */
+ void setComponent(Component component);
+
+ /**
+ * Get the source component reference model object
+ *
+ * @return reference the source component reference for the endpoint
+ */
+ ComponentReference getReference();
+
+ /**
+ * Set the source component reference model object
+ *
+ * @param reference
+ */
+ void setReference(ComponentReference reference);
+
+ /**
+ * Get the resolved reference binding
+ *
+ * @return binding the resolved reference binding
+ */
+ Binding getBinding();
+
+ /**
+ * Set the resolved reference binding
+ *
+ * @param binding the resolved reference binding
+ */
+ void setBinding(Binding binding);
+
+ /**
+ * Get the target endpoint
+ *
+ * @return endpoint the target endpoint
+ */
+ Endpoint2 getEndpoint();
+
+ /**
+ * Set the target endpoint model object
+ *
+ * @param endpoint the target endpoint
+ */
+ void setEndpoint(Endpoint2 endpoint);
+
+ /**
+ * Returns the interface contract defining the interface
+ *
+ * @return the interface contract
+ */
+ InterfaceContract getInterfaceContract();
+
+ /**
+ * Sets the interface contract defining the interface
+ *
+ * @param interfaceContract the interface contract
+ */
+ void setInterfaceContract(InterfaceContract interfaceContract);
+
+ /**
+ * Returns the binding specific target URI for this endpoint reference.
+ *
+ * @return uri the binding specific target URI
+ */
+ String getURI();
+
+ /**
+ * Sets the binding specific target URI for this endpoint reference.
+ *
+ * @param uri the binding specific target URI
+ */
+ void setURI(String uri);
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java
index 2eb1bf21b0..34b2607b30 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java
@@ -70,5 +70,18 @@ public interface Reference extends AbstractReference, Contract {
* @return the targets of this reference.
*/
List<ComponentService> getTargets();
+
+ /**
+ * Returns the endpoint references implied by this reference.
+ *
+ * Endpoint references are used to represent:
+ *
+ * - manually specified reference targets
+ * - reference targets determined by autowire
+ * - manually configured remote bindings
+ *
+ * @return the endpoint references implied by this reference
+ */
+ List<EndpointReference2> getEndpointReferences();
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java
index 020870cd34..88ef8c5d6e 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java
@@ -18,6 +18,8 @@
*/
package org.apache.tuscany.sca.assembly;
+import java.util.List;
+
/**
* Represents a service. Services are used to publish services provided by
* implementations, so that they are addressable by other components.
@@ -25,5 +27,15 @@ package org.apache.tuscany.sca.assembly;
* @version $Rev$ $Date$
*/
public interface Service extends AbstractService, Contract {
-
+ /**
+ * Returns the endpoints implied by this service.
+ *
+ * Endpoints represent configured bindings for a service. Hence a service
+ * with two bindings will expose two Endpoints. Where a promoted service has
+ * new binding configuration applied by a promoting component Endpoints are
+ * introduced to represent these new bindings.
+ *
+ * @return the endpoints implied by this service
+ */
+ List<Endpoint2> getEndpoints();
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseBuilderImpl.java
index 996adf7ecc..2473704539 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseBuilderImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseBuilderImpl.java
@@ -120,7 +120,57 @@ public abstract class BaseBuilderImpl implements CompositeBuilder {
problem = monitor.createProblem(this.getClass().getName(), "assembly-validation-messages", Severity.ERROR, model, message, ex);
monitor.problem(problem);
}
+ }
+
+
+ /**
+ * Index components inside a composite
+ *
+ * @param composite
+ * @param componentServices
+
+ */
+ protected void indexComponents(Composite composite,
+ Map<String, Component> components) {
+ for (Component component : composite.getComponents()) {
+ // Index components by name
+ components.put(component.getName(), component);
+ }
+ }
+
+ /**
+ * Index services inside a composite
+ *
+ * @param composite
+ * @param componentServices
+ */
+ protected void indexServices(Composite composite,
+ Map<String, ComponentService> componentServices) {
+ ComponentService nonCallbackService = null;
+ int nonCallbackServiceCount = 0;
+ for (Component component : composite.getComponents()) {
+ for (ComponentService componentService : component.getServices()) {
+ // Index component services by component name / service name
+ String uri = component.getName() + '/' + componentService.getName();
+ componentServices.put(uri, componentService);
+
+ // count how many non-callback there are
+ if (!componentService.isCallback()) {
+
+ if (nonCallbackServiceCount == 0) {
+ nonCallbackService = componentService;
+ }
+ nonCallbackServiceCount++;
+ }
+ }
+ if (nonCallbackServiceCount == 1) {
+ // If we have a single non callback service, index it by
+ // component name as well
+ componentServices.put(component.getName(), nonCallbackService);
+ }
+ }
}
+
/**
* Index components, services and references inside a composite.
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
index b608bc336c..e15183e65d 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
@@ -60,6 +60,9 @@ public class CompositeBuilderImpl implements CompositeBuilder {
private CompositeBuilder componentServiceBindingBuilder;
private CompositeBuilder componentReferenceBindingBuilder;
+ private CompositeBuilder compositeReferenceEndpointReferenceBuilder;
+ private CompositeBuilder compositeServiceEndpointBuilder;
+
public CompositeBuilderImpl(FactoryExtensionPoint factories, InterfaceContractMapper mapper) {
this(factories.getFactory(AssemblyFactory.class),
factories.getFactory(EndpointFactory.class),
@@ -170,6 +173,9 @@ public class CompositeBuilderImpl implements CompositeBuilder {
compositePolicyBuilder = new CompositePolicyBuilderImpl(assemblyFactory, endpointFactory, interfaceContractMapper);
componentServiceBindingBuilder = new ComponentServiceBindingBuilderImpl();
componentReferenceBindingBuilder = new ComponentReferenceBindingBuilderImpl();
+
+ compositeReferenceEndpointReferenceBuilder = new CompositeReferenceEndpointReferenceBuilderImpl(assemblyFactory, interfaceContractMapper);
+ compositeServiceEndpointBuilder = new CompositeServiceEndpointBuilderImpl(assemblyFactory);
}
public String getID() {
@@ -198,6 +204,10 @@ public class CompositeBuilderImpl implements CompositeBuilder {
// Configure composite references
compositeReferenceConfigurationBuilder.build(composite, definitions, monitor);
+
+ // TODO - temporarily add endpoint builders
+ compositeServiceEndpointBuilder.build(composite, definitions, monitor);
+ compositeReferenceEndpointReferenceBuilder.build(composite, definitions, monitor);
// Configure binding URIs
compositeBindingURIBuilder.build(composite, definitions, monitor);
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceEndpointReferenceBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceEndpointReferenceBuilderImpl.java
new file mode 100644
index 0000000000..da21f6e635
--- /dev/null
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceEndpointReferenceBuilderImpl.java
@@ -0,0 +1,392 @@
+/*
+ * 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.assembly.builder.impl;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.CompositeReference;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointFactory;
+import org.apache.tuscany.sca.assembly.EndpointReference2;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.assembly.Multiplicity;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.SCABinding;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
+import org.apache.tuscany.sca.assembly.builder.DefaultEndpointBuilder;
+import org.apache.tuscany.sca.definitions.Definitions;
+import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ * A composite builder that creates endpoint reference models.
+ *
+ * @version $Rev$ $Date$
+ */
+public class CompositeReferenceEndpointReferenceBuilderImpl extends BaseBuilderImpl implements CompositeBuilder {
+
+
+ public CompositeReferenceEndpointReferenceBuilderImpl(AssemblyFactory assemblyFactory, InterfaceContractMapper interfaceContractMapper) {
+ super(assemblyFactory, null, null, null, interfaceContractMapper);
+ }
+
+ public String getID() {
+ return "org.apache.tuscany.sca.assembly.builder.ComponentReferenceEndpointReferenceBuilder";
+ }
+
+ /**
+ * Create endpoint references for all component references.
+ *
+ * @param composite
+ */
+ public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException
+ {
+ // process top level composite references
+ // TODO - I don't think OASIS allows for these
+ //
+ //processCompositeReferences(composite);
+
+ // process component services
+ processComponentReferences(composite, monitor);
+ }
+
+ private void processCompositeReferences(Composite composite) {
+ // TODO do we need this for OASIS?
+ }
+
+ private void processComponentReferences(Composite composite, Monitor monitor) {
+
+ // index all of the services in the composite
+ Map<String, Component> components = new HashMap<String, Component>();
+ indexComponents(composite, components);
+
+ // index all of the services in the composite
+ Map<String, ComponentService> componentServices = new HashMap<String, ComponentService>();
+ indexServices(composite, componentServices);
+
+ // create endpoint references for each component's references
+ for (Component component : composite.getComponents()) {
+ // recurse for composite implementations
+ Implementation implementation = component.getImplementation();
+ if (implementation instanceof Composite) {
+ processComponentReferences((Composite)implementation, monitor);
+ }
+
+ // create endpoint references to represent the component reference
+ for (ComponentReference reference : component.getReferences()) {
+ createReferenceEndpointReferences(composite, component, reference, components, componentServices, monitor);
+ }
+ }
+ }
+
+ private void createReferenceEndpointReferences(Composite composite,
+ Component component,
+ ComponentReference reference,
+ Map<String, Component> components,
+ Map<String, ComponentService> componentServices,
+ Monitor monitor)
+ {
+ if (reference.getAutowire() == Boolean.TRUE &&
+ reference.getTargets().isEmpty()) {
+
+ // Find suitable targets in the current composite for an
+ // autowired reference
+ Multiplicity multiplicity = reference.getMultiplicity();
+ for (Component targetComponent : composite.getComponents()) {
+
+ // prevent autowire connecting to self
+ boolean skipSelf = false;
+ for (ComponentReference targetComponentReference : targetComponent.getReferences()) {
+ if (reference == targetComponentReference) {
+ skipSelf = true;
+ }
+ }
+
+ if (!skipSelf) {
+ for (ComponentService targetComponentService : targetComponent.getServices()) {
+ if (reference.getInterfaceContract() == null ||
+ interfaceContractMapper.isCompatible(reference.getInterfaceContract(),
+ targetComponentService.getInterfaceContract())) {
+
+ EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
+ endpointRef.setComponent(component);
+ endpointRef.setReference(reference);
+ endpointRef.setInterfaceContract(reference.getInterfaceContract());
+ endpointRef.setTargetName(targetComponentService.getName());
+ endpointRef.setUnresolved(false);
+
+ // TODO binding is chosen at endpoint resolution when
+ // endpoint reference is matched with endpoint
+ //endpointRef.setBinding(binding);
+ //endpointRef.setEndpoint(endpoint);
+
+ reference.getEndpointReferences().add(endpointRef);
+
+ if (multiplicity == Multiplicity.ZERO_ONE ||
+ multiplicity == Multiplicity.ONE_ONE) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if (multiplicity == Multiplicity.ONE_N ||
+ multiplicity == Multiplicity.ONE_ONE) {
+ if (reference.getEndpointReferences().size() == 0) {
+ warning(monitor,
+ "NoComponentReferenceTarget",
+ reference,
+ reference.getName());
+ }
+ }
+
+ } else if (!reference.getTargets().isEmpty()) {
+
+ // Check that the component reference does not mix the use of
+ // endpoint references specified via the target attribute with
+ // the presence of binding elements
+ if (reference.getBindings().size() > 0) {
+ warning(monitor, "ReferenceEndPointMixWithTarget",
+ composite, reference.getName());
+ }
+
+ // Resolve targets specified on the component reference
+ for (ComponentService target : reference.getTargets()) {
+
+ String targetName = target.getName();
+ ComponentService targetComponentService = componentServices.get(targetName);
+
+ Component targetComponent;
+ int s = targetName.indexOf('/');
+ if (s == -1) {
+ targetComponent = components.get(targetName);
+ } else {
+ targetComponent = components.get(targetName.substring(0, s));
+ }
+
+ if (targetComponentService != null) {
+
+ // Check that the target component service provides
+ // a superset of the component reference interface
+ if (reference.getInterfaceContract() == null ||
+ interfaceContractMapper.isCompatible(reference.getInterfaceContract(),
+ targetComponentService.getInterfaceContract())) {
+
+ EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
+ endpointRef.setComponent(component);
+ endpointRef.setReference(reference);
+ endpointRef.setInterfaceContract(reference.getInterfaceContract());
+ endpointRef.setTargetName(targetComponentService.getName());
+ endpointRef.setUnresolved(false);
+
+ // TODO binding is chosen at endpoint resolution when
+ // endpoint reference is matched with endpoint
+ //endpointRef.setBinding(binding);
+ //endpointRef.setEndpoint(endpoint);
+
+ reference.getEndpointReferences().add(endpointRef);
+ } else {
+ warning(monitor,
+ "ReferenceIncompatibleInterface",
+ composite,
+ composite.getName().toString(),
+ reference.getName(),
+ targetName);
+ }
+ } else {
+ // add an unresolved endpoint
+ EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
+ endpointRef.setComponent(component);
+ endpointRef.setReference(reference);
+ endpointRef.setInterfaceContract(reference.getInterfaceContract());
+ endpointRef.setTargetName(targetName);
+ endpointRef.setUnresolved(true);
+
+ warning(monitor,
+ "ComponentReferenceTargetNotFound",
+ composite,
+ composite.getName().toString(),
+ targetName);
+ }
+ }
+ } else if ((reference.getReference() != null)
+ && (!reference.getReference().getTargets().isEmpty())) {
+
+ // Resolve targets from the corresponding reference in the
+ // componentType
+ for (ComponentService target : reference.getReference().getTargets()) {
+
+ String targetName = target.getName();
+ ComponentService targetComponentService = componentServices.get(targetName);
+
+ Component targetComponent;
+ int s = targetName.indexOf('/');
+ if (s == -1) {
+ targetComponent = components.get(targetName);
+ } else {
+ targetComponent = components.get(targetName.substring(0, s));
+ }
+
+ if (targetComponentService != null) {
+
+ // Check that the target component service provides
+ // a superset of the component reference interface
+ if (reference.getInterfaceContract() == null ||
+ interfaceContractMapper.isCompatible(reference.getInterfaceContract(),
+ targetComponentService.getInterfaceContract())) {
+
+ EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
+ endpointRef.setComponent(component);
+ endpointRef.setReference(reference);
+ endpointRef.setInterfaceContract(reference.getInterfaceContract());
+ endpointRef.setTargetName(targetComponentService.getName());
+ endpointRef.setUnresolved(false);
+
+ // TODO binding is chosen at endpoint resolution when
+ // endpoint reference is matched with endpoint
+ //endpointRef.setBinding(binding);
+ //endpointRef.setEndpoint(endpoint);
+
+ reference.getEndpointReferences().add(endpointRef);
+ } else {
+ warning(monitor,
+ "ReferenceIncompatibleInterface",
+ composite,
+ composite.getName().toString(),
+ reference.getName(),
+ targetName);
+ }
+ } else {
+ // add an unresolved endpoint
+ EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
+ endpointRef.setComponent(component);
+ endpointRef.setReference(reference);
+ endpointRef.setInterfaceContract(reference.getInterfaceContract());
+ endpointRef.setTargetName(targetName);
+ endpointRef.setUnresolved(true);
+
+ warning(monitor,
+ "ComponentReferenceTargetNotFound",
+ composite,
+ composite.getName().toString(),
+ targetName);
+ }
+ }
+ }
+
+
+ // if no endpoints have found so far the bindings become targets.
+ if (reference.getEndpointReferences().isEmpty()) {
+ for (Binding binding : reference.getBindings()) {
+
+ String uri = binding.getURI();
+
+ // user hasn't put a uri on the binding so it's not a target
+ // name
+ if (uri == null) {
+ continue;
+ }
+
+ // user might have put a local target name in the uri so get
+ // the path part and see if it refers to a target we know about
+ // - if it does the reference binding will be matched with a
+ // service binding
+ // - if it doesn't it is assumed to be an external reference
+ Component targetComponent = null;
+ ComponentService targetComponentService = null;
+ String path = null;
+
+ try {
+ path = URI.create(uri).getPath();
+ } catch (Exception ex) {
+ // just assume that no target is identified if
+ // a URI related exception is thrown
+ }
+
+ if (path != null) {
+ if (path.startsWith("/")) {
+ path = path.substring(1);
+ }
+
+ // Resolve the target component and service
+ targetComponentService = componentServices.get(path);
+ int s = path.indexOf('/');
+ if (s == -1) {
+ targetComponent = components.get(path);
+ } else {
+ targetComponent = components.get(path.substring(0, s));
+ }
+ }
+
+ // if the path of the binding URI matches a component in the
+ // composite then configure an endpoint reference with this component as
+ // the target
+ // if not then the binding URI will be assumed to reference an
+ // external service
+ if (targetComponentService != null) {
+
+ // Check that the target component service provides
+ // a superset of the component reference interface
+ if (reference.getInterfaceContract() == null ||
+ interfaceContractMapper.isCompatible(reference.getInterfaceContract(),
+ targetComponentService.getInterfaceContract())) {
+ EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
+ endpointRef.setComponent(component);
+ endpointRef.setReference(reference);
+ endpointRef.setBinding(binding);
+ endpointRef.setInterfaceContract(reference.getInterfaceContract());
+ endpointRef.setTargetName(targetComponentService.getName());
+ endpointRef.setUnresolved(false);
+ reference.getEndpointReferences().add(endpointRef);
+ } else {
+ warning(monitor,
+ "ReferenceIncompatibleInterface",
+ composite,
+ composite.getName().toString(),
+ reference.getName(),
+ uri);
+ }
+ } else {
+ // create endpoint reference for manually configured bindings
+ EndpointReference2 endpointRef = assemblyFactory.createEndpointReference();
+ endpointRef.setComponent(component);
+ endpointRef.setReference(reference);
+ endpointRef.setBinding(binding);
+ endpointRef.setInterfaceContract(reference.getInterfaceContract());
+ endpointRef.setTargetName(uri);
+ endpointRef.setUnresolved(false);
+ reference.getEndpointReferences().add(endpointRef);
+ }
+ }
+ }
+ }
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceEndpointBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceEndpointBuilderImpl.java
new file mode 100644
index 0000000000..a933fd6991
--- /dev/null
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceEndpointBuilderImpl.java
@@ -0,0 +1,124 @@
+/*
+ * 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.assembly.builder.impl;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.CompositeReference;
+import org.apache.tuscany.sca.assembly.CompositeService;
+import org.apache.tuscany.sca.assembly.Endpoint2;
+import org.apache.tuscany.sca.assembly.EndpointFactory;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.SCABinding;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
+import org.apache.tuscany.sca.definitions.Definitions;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ * A composite builder that creates endpoint models for component services.
+ *
+ * @version $Rev$ $Date$
+ */
+public class CompositeServiceEndpointBuilderImpl implements CompositeBuilder {
+ private AssemblyFactory assemblyFactory;
+
+ public CompositeServiceEndpointBuilderImpl(AssemblyFactory assemblyFactory) {
+ this.assemblyFactory = assemblyFactory;
+ }
+
+ public String getID() {
+ return "org.apache.tuscany.sca.assembly.builder.ComponentReferenceEndpointReferenceBuilder";
+ }
+
+ /**
+ * Create endpoint models for all component services.
+ *
+ * @param composite
+ */
+ public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
+
+ // process top level composite services
+ // TODO - I don't think OASIS spec doesn't allows composite references in the domain composite
+ //
+ // processCompositeServices(composite);
+
+ // process component services
+ processComponentServices(composite);
+
+ }
+
+ private void processCompositeServices(Composite composite) {
+ // top level services are treated slightly differently
+ // as no component will use these top level services
+ // as part of its component type. In this case we push down
+ // the service configuration to create a new endpoint on the
+ // component from which the service is promoted
+ for (Service service : composite.getServices()) {
+
+ Component promotedComponent = ((CompositeService)service).getPromotedComponent();
+ ComponentService promotedService = ((CompositeService)service).getPromotedService();
+
+ if (promotedService != null) {
+ for (Binding binding : service.getBindings()){
+ Endpoint2 endpoint = assemblyFactory.createEndpoint();
+ endpoint.setComponent(promotedComponent);
+ endpoint.setService(promotedService);
+ endpoint.setBinding(binding);
+ endpoint.setUnresolved(false);
+ promotedService.getEndpoints().add(endpoint);
+ }
+ }
+ }
+ }
+
+ private void processComponentServices(Composite composite) {
+
+ for (Component component : composite.getComponents()) {
+
+ // recurse for composite implementations
+ Implementation implementation = component.getImplementation();
+ if (implementation instanceof Composite) {
+ processComponentServices((Composite)implementation);
+ }
+
+ // create an endpoint for each component service binding
+ for (ComponentService service : component.getServices()) {
+ for (Binding binding : service.getBindings()){
+ Endpoint2 endpoint = assemblyFactory.createEndpoint();
+ endpoint.setComponent(component);
+ endpoint.setService(service);
+ endpoint.setBinding(binding);
+ endpoint.setUnresolved(false);
+ service.getEndpoints().add(endpoint);
+ }
+ }
+ }
+ }
+
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
index a61108f3cb..aaface154b 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
@@ -165,9 +165,9 @@ public abstract class EndpointBuilderImpl implements EndpointBuilder {
//Customise the binding name to make it unique
// regardless of how many bindings or targets there are
if ( targetComponent != null){
- cloned.setName(binding.getName() + "#" + targetComponent.getName() + "/" + serviceBinding.getName());
+ cloned.setName(binding.getName());
} else {
- cloned.setName(binding.getName() + "#" + serviceBinding.getName());
+ cloned.setName(binding.getName());
}
// Set the binding URI to the URI of the target service
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java
index 003f5fa323..bd999d77c5 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java
@@ -33,6 +33,8 @@ import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.assembly.CompositeReference;
import org.apache.tuscany.sca.assembly.CompositeService;
import org.apache.tuscany.sca.assembly.ConstrainingType;
+import org.apache.tuscany.sca.assembly.Endpoint2;
+import org.apache.tuscany.sca.assembly.EndpointReference2;
import org.apache.tuscany.sca.assembly.Property;
import org.apache.tuscany.sca.assembly.Reference;
import org.apache.tuscany.sca.assembly.Service;
@@ -113,4 +115,11 @@ public abstract class AssemblyFactoryImpl implements AssemblyFactory {
return new WireImpl();
}
+ public Endpoint2 createEndpoint() {
+ return new Endpoint2Impl();
+ }
+
+ public EndpointReference2 createEndpointReference() {
+ return new EndpointReference2Impl();
+ }
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
new file mode 100644
index 0000000000..79b30793f0
--- /dev/null
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
@@ -0,0 +1,102 @@
+/*
+ * 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.assembly.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.Endpoint2;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+
+/**
+ * The assembly model object for an endpoint.
+ *
+ * @version $Rev$ $Date$
+ */
+public class Endpoint2Impl implements Endpoint2 {
+
+ private Component component;
+ private ComponentService service;
+ private Binding binding;
+ private Binding callbackBinding;
+ private InterfaceContract interfaceContract;
+ private String uri;
+
+ protected Endpoint2Impl() {
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+ public boolean isUnresolved() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ // TODO Auto-generated method stub
+ }
+
+ public Component getComponent() {
+ return component;
+ }
+
+ public void setComponent(Component component) {
+ this.component = component;
+ }
+
+ public ComponentService getService() {
+ return service;
+ }
+
+ public void setService(ComponentService service) {
+ this.service = service;
+ }
+
+ public Binding getBinding() {
+ return binding;
+ }
+
+ public void setBinding(Binding binding) {
+ this.binding = binding;
+ }
+
+ public InterfaceContract getInterfaceContract() {
+ return interfaceContract;
+ }
+
+ public void setInterfaceContract(InterfaceContract interfaceContract) {
+ this.interfaceContract = interfaceContract;
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java
new file mode 100644
index 0000000000..75ed86b8d4
--- /dev/null
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java
@@ -0,0 +1,121 @@
+/*
+ * 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.assembly.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.Endpoint2;
+import org.apache.tuscany.sca.assembly.EndpointReference2;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+
+/**
+ * The assembly model object for an endpoint.
+ *
+ * @version $Rev$ $Date$
+ */
+public class EndpointReference2Impl implements EndpointReference2 {
+
+ private String targetName;
+ private Component component;
+ private ComponentReference reference;
+ private Binding binding;
+ private Binding callbackBinding;
+ private Endpoint2 endpoint;
+ private InterfaceContract interfaceContract;
+ private String uri;
+
+ protected EndpointReference2Impl() {
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+ public boolean isUnresolved() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ // TODO Auto-generated method stub
+ }
+
+ public String getTargetName(){
+ return targetName;
+ }
+
+ public void setTargetName(String targetName){
+ this.targetName = targetName;
+ }
+
+ public Component getComponent() {
+ return component;
+ }
+
+ public void setComponent(Component component) {
+ this.component = component;
+ }
+
+ public ComponentReference getReference() {
+ return reference;
+ }
+
+ public void setReference(ComponentReference reference) {
+ this.reference = reference;
+ }
+
+ public Binding getBinding() {
+ return binding;
+ }
+
+ public void setBinding(Binding binding) {
+ this.binding = binding;
+ }
+
+ public Endpoint2 getEndpoint() {
+ return endpoint;
+ }
+
+ public void setEndpoint(Endpoint2 endpoint) {
+ this.endpoint = endpoint;
+ }
+
+ public InterfaceContract getInterfaceContract() {
+ return interfaceContract;
+ }
+
+ public void setInterfaceContract(InterfaceContract interfaceContract) {
+ this.interfaceContract = interfaceContract;
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
index 1800222bfb..455286a798 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
@@ -25,6 +25,8 @@ import java.util.List;
import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.assembly.Callback;
import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference2;
import org.apache.tuscany.sca.assembly.Reference;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.policy.PolicySet;
@@ -42,6 +44,7 @@ public class ReferenceImpl extends AbstractReferenceImpl implements Reference, C
private Callback callback;
private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
private boolean promotionOverride;
+ private List<EndpointReference2> endpointReferences = new ArrayList<EndpointReference2>();
public List<PolicySet> getApplicablePolicySets() {
return applicablePolicySets;
@@ -128,6 +131,10 @@ public class ReferenceImpl extends AbstractReferenceImpl implements Reference, C
*/
public InterfaceContract getInterfaceContract(Binding binding){
return getInterfaceContract();
- }
+ }
+
+ public List<EndpointReference2> getEndpointReferences() {
+ return endpointReferences;
+ }
}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
index 8d745cb7e1..28ea33cc81 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
@@ -24,6 +24,8 @@ import java.util.List;
import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.assembly.Callback;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.Endpoint2;
import org.apache.tuscany.sca.assembly.Service;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.policy.PolicySet;
@@ -38,6 +40,7 @@ public class ServiceImpl extends AbstractServiceImpl implements Service, Cloneab
private List<PolicySet> policySets = new ArrayList<PolicySet>();
private Callback callback;
private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
+ private List<Endpoint2> endpoints = new ArrayList<Endpoint2>();
public List<PolicySet> getApplicablePolicySets() {
return applicablePolicySets;
@@ -104,4 +107,7 @@ public class ServiceImpl extends AbstractServiceImpl implements Service, Cloneab
return getInterfaceContract();
}
+ public List<Endpoint2> getEndpoints() {
+ return endpoints;
+ }
}