summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core/src/main/java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-02-26 18:23:06 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-02-26 18:23:06 +0000
commit3566e4b599bcc88382ad81433229b6f2cccdb899 (patch)
tree067b84f33391c785780b8ab30066651d8bec9e7b /sca-java-2.x/trunk/modules/core/src/main/java
parentb4f0e720cda98d4bdaa351f4509d6486537a60f6 (diff)
Clean up the remote flag for endpoint and change the endpoint reference status to an enum
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@916778 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core/src/main/java')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java1
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java5
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java2
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java30
4 files changed, 17 insertions, 21 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java
index 3cc6b61782..4e5275058e 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java
@@ -84,7 +84,6 @@ public class EndpointSerializerImpl implements EndpointSerializer {
try {
XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml));
EndpointReference result = refProcessor.read(reader, new ProcessorContext(registry));
- result.setRemote(true);
reader.close();
return result;
} catch (Exception e) {
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
index ff290ee150..156d73c82e 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
@@ -130,7 +130,6 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen
this.policySets = copy.policySets;
this.uri = copy.uri;
- this.remote = copy.remote;
this.unresolved = copy.unresolved;
this.status = copy.status;
@@ -350,8 +349,8 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen
// source interface contract for local wires
this.chains = null;
- if (getStatus() == EndpointReference.WIRED_TARGET_FOUND_AND_MATCHED){
- setStatus(EndpointReference.NOT_CONFIGURED);
+ if (getStatus() == EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED){
+ setStatus(EndpointReference.Status.NOT_CONFIGURED);
}
// TODO - cheating here as I fixed the RuntimeComponentService code
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
index c968599d36..fc2c6bbdfb 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
@@ -383,7 +383,7 @@ public class ComponentContextImpl implements RuntimeComponentContext {
endpointReference.setReference(componentReference);
endpointReference.setBinding(endpoint.getBinding());
endpointReference.setUnresolved(false);
- endpointReference.setStatus(EndpointReference.WIRED_TARGET_FOUND_READY_FOR_MATCHING);
+ endpointReference.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_READY_FOR_MATCHING);
endpointReference.setTargetEndpoint(endpoint);
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
index d50554a777..dc007c6a07 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
@@ -42,7 +42,6 @@ import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.PolicySet;
import org.apache.tuscany.sca.runtime.EndpointReferenceBinder;
@@ -124,7 +123,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
// This logic does post build autowire matching but isn't actually used at the moment
// as problems with dependencies mean we still do this during build
- if (endpointReference.getStatus() == EndpointReference.AUTOWIRE_PLACEHOLDER){
+ if (endpointReference.getStatus() == EndpointReference.Status.AUTOWIRE_PLACEHOLDER){
// do autowire matching
// will only be called at build time at the moment
@@ -167,7 +166,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
autowireEndpointRefrence.setTargetEndpoint(endpoint);
autowireEndpointRefrence.setBinding(endpoint.getBinding());
- autowireEndpointRefrence.setStatus(EndpointReference.WIRED_TARGET_FOUND_AND_MATCHED);
+ autowireEndpointRefrence.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
endpointReference.getReference().getEndpointReferences().add(autowireEndpointRefrence);
}
}
@@ -187,8 +186,8 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
setSingleAutoWireTarget(endpointReference.getReference());
- } else if ( endpointReference.getStatus() == EndpointReference.WIRED_TARGET_FOUND_AND_MATCHED||
- endpointReference.getStatus() == EndpointReference.RESOLVED_BINDING ) {
+ } else if ( endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED||
+ endpointReference.getStatus() == EndpointReference.Status.RESOLVED_BINDING ) {
// The endpoint reference is already resolved to either
// a service endpoint local to this composite or it has
// a remote binding
@@ -201,7 +200,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
endpointReference.getReference().getCallbackService().getEndpoints(),
matchAudit);
}
- } else if (endpointReference.getStatus() == EndpointReference.WIRED_TARGET_FOUND_READY_FOR_MATCHING ){
+ } else if (endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_FOUND_READY_FOR_MATCHING ){
// The endpoint reference is already resolved to either
// a service endpoint but no binding was specified in the
// target URL and/or the policies have yet to be matched.
@@ -216,9 +215,9 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
endpointReference.getReference().getCallbackService().getEndpoints(),
matchAudit);
}
- } else if (endpointReference.getStatus() == EndpointReference.WIRED_TARGET_IN_BINDING_URI ||
- endpointReference.getStatus() == EndpointReference.WIRED_TARGET_NOT_FOUND ||
- endpointReference.getStatus() == EndpointReference.NOT_CONFIGURED){
+ } else if (endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_IN_BINDING_URI ||
+ endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_NOT_FOUND ||
+ endpointReference.getStatus() == EndpointReference.Status.NOT_CONFIGURED){
// The reference is not yet matched to a service
// find the service in the endpoint registry
@@ -231,10 +230,9 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
// in the builder that pulls the URI out of the binding if there are no targets
// on the reference. have to wait until here to see if the binding uri matches any
// available services. If not we assume here that it's a resolved binding
- if (endpointReference.getStatus() == EndpointReference.WIRED_TARGET_IN_BINDING_URI){
+ if (endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_IN_BINDING_URI){
endpointReference.getTargetEndpoint().setBinding(endpointReference.getBinding());
- endpointReference.setRemote(true);
- endpointReference.setStatus(EndpointReference.RESOLVED_BINDING);
+ endpointReference.setStatus(EndpointReference.Status.RESOLVED_BINDING);
} else {
Monitor.error(monitor,
this,
@@ -258,8 +256,8 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
logger.fine(matchAudit.toString());
- if (endpointReference.getStatus() != EndpointReference.WIRED_TARGET_FOUND_AND_MATCHED &&
- endpointReference.getStatus() != EndpointReference.RESOLVED_BINDING){
+ if (endpointReference.getStatus() != EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED &&
+ endpointReference.getStatus() != EndpointReference.Status.RESOLVED_BINDING){
if (runtime){
Monitor.error(monitor,
@@ -324,7 +322,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
} else {
endpointReference.setTargetEndpoint(matchedEndpoint);
endpointReference.setBinding(endpointReference.getTargetEndpoint().getBinding());
- endpointReference.setStatus(EndpointReference.WIRED_TARGET_FOUND_AND_MATCHED);
+ endpointReference.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
endpointReference.setUnresolved(false);
}
}
@@ -617,7 +615,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
Endpoint te = endpointReference.getTargetEndpoint();
if (te != null && !te.isUnresolved()
&& te.getURI() != null
- && endpointReference.getStatus() != EndpointReference.RESOLVED_BINDING) {
+ && endpointReference.getStatus() != EndpointReference.Status.RESOLVED_BINDING) {
List<Endpoint> endpoints = endpointRegistry.findEndpoint(endpointReference);
return ! endpoints.contains(endpointReference.getTargetEndpoint());
}