summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/endpoint/src/main
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-17 16:14:58 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-17 16:14:58 +0000
commitd88b2af71307638c59e819285efaa91b8a1bd495 (patch)
tree30ee0e56a8b25e9e21a7b1d497cbdf9b57457669 /java/sca/modules/endpoint/src/main
parenta1c9138328d18948c1249d2853b3a15c171363fc (diff)
Add a LifeCycleListener interface so that extension points or extension can be called back upon the start/stop of the extension point registry
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@785699 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/endpoint/src/main')
-rw-r--r--java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointReferenceBuilderImpl.java48
1 files changed, 26 insertions, 22 deletions
diff --git a/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointReferenceBuilderImpl.java b/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointReferenceBuilderImpl.java
index e963848c7f..ccb70b6a21 100644
--- a/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointReferenceBuilderImpl.java
+++ b/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointReferenceBuilderImpl.java
@@ -234,32 +234,36 @@ public class EndpointReferenceBuilderImpl implements CompositeBuilder, EndpointR
if ((endpointReference.getReference().getBindings().size() == 0) ||
((endpointReference.getReference().getBindings().size() == 1) &&
(endpointReference.getReference().getBindings().get(0) instanceof SCABinding))){
- // OAISIS - choose a binding from the service side
+ // OAISIS - choose a binding from the service side
// (could have been specified as part of the target string)
// last part of this test that is looking for binding SCA is
// bogus. Just a temporary fix until we get rid of the OSOA
- // style reference side bindings.
-
- // retrieve the user specified binding name.
+ // style reference side bindings.
+
+ // retrieve the user specified binding name.
// TODO - EPR - we don't support this yet
-
+
// otherwise pick the first binding from the service
- endpointReference.setTargetEndpoint(endpoint.getService().getEndpoints().get(0));
+ if (local) {
+ endpointReference.setTargetEndpoint(endpoint.getService().getEndpoints().get(0));
+ } else {
+ endpointReference.setTargetEndpoint(endpoint);
+ }
endpointReference.setBinding(endpointReference.getTargetEndpoint().getBinding());
endpointReference.setUnresolved(false);
return;
-
+
} else {
- // OAISIS - this is an error
+ // OAISIS - this is an error
// (for now let it match bindings while we rewrite OSOA tests)
for (Binding referenceBinding : endpointReference.getReference().getBindings()) {
if (local) {
for (Endpoint serviceEndpoint : endpoint.getService().getEndpoints()) {
-
+
if (referenceBinding.getClass() == serviceEndpoint.getBinding().getClass() && hasCompatiblePolicySets(referenceBinding,
serviceEndpoint
.getBinding())) {
-
+
matchedReferenceBinding.add(referenceBinding);
matchedServiceEndpoint.add(serviceEndpoint);
}
@@ -269,10 +273,10 @@ public class EndpointReferenceBuilderImpl implements CompositeBuilder, EndpointR
if (referenceBinding.getClass() == serviceEndpoint.getBinding().getClass() && hasCompatiblePolicySets(referenceBinding,
serviceEndpoint
.getBinding())) {
-
+
matchedReferenceBinding.add(referenceBinding);
matchedServiceEndpoint.add(serviceEndpoint);
-
+
}
}
}
@@ -353,39 +357,39 @@ public class EndpointReferenceBuilderImpl implements CompositeBuilder, EndpointR
List<EndpointReference> callbackEndpointReferences = endpoint.getCallbackEndpointReferences();
List<Endpoint> matchedEndpoint = new ArrayList<Endpoint>();
-
+
// Find the corresponding bindings from callback service side
if ((callbackEndpointReferences.get(0).getReference().getBindings().size() == 0) ||
((callbackEndpointReferences.get(0).getReference().getBindings().size() == 1) &&
(callbackEndpointReferences.get(0).getReference().getBindings().get(0) instanceof SCABinding))){
- // OAISIS - choose a binding from the service side
+ // OAISIS - choose a binding from the service side
// (could have been specified as part of the target string)
// last part of this test that is looking for binding SCA is
// bogus. Just a temporary fix until we get rid of the OSOA
- // style reference side bindings.
-
- // retrieve the user specified binding name.
+ // style reference side bindings.
+
+ // retrieve the user specified binding name.
// TODO - EPR - we don't support this yet
-
+
// otherwise pick the first binding from the service
//endpointReference.setTargetEndpoint(endpoint.getService().getEndpoints().get(0));
//endpointReference.setBinding(endpointReference.getTargetEndpoint().getBinding());
endpointReference.setCallbackEndpoint(callbackEndpoints.get(0));
endpointReference.setUnresolved(false);
return;
-
+
} else {
- // OAISIS - this is an error
+ // OAISIS - this is an error
// (for now let it match bindings while we rewrite OSOA tests)
if ((callbackEndpoints != null) && (callbackEndpointReferences != null)){
// Find the corresponding bindings from the service side
for (EndpointReference epr : callbackEndpointReferences) {
for (Endpoint ep : callbackEndpoints) {
-
+
if (epr.getBinding().getClass() == ep.getBinding().getClass() &&
hasCompatiblePolicySets(epr.getBinding(), ep.getBinding())) {
-
+
matchedEndpoint.add(ep);
}
}