From bde31d46c8dc12f71950edad9066868d85f91435 Mon Sep 17 00:00:00 2001 From: slaws Date: Thu, 23 Dec 2010 13:07:30 +0000 Subject: Bring the unknown endpoint plugin into play at build and run time. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1052258 13f79535-47bb-0310-9956-ffa450edef68 --- .../runtime/impl/EndpointReferenceBinderImpl.java | 42 +++++++++++++--------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'sca-java-2.x/trunk/modules/core') 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 47c0ca4fc5..068f13f953 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 @@ -279,21 +279,9 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { endpointReference.getTargetEndpoint().setBinding(endpointReference.getBinding()); endpointReference.setStatus(EndpointReference.Status.RESOLVED_BINDING); } else { - Binding b = null; - if (unknownEndpointHandler != null) { - b = unknownEndpointHandler.handleUnknownEndpoint(endpointReference); - } - if (b != null) { - Endpoint matchedEndpoint = new RuntimeEndpointImpl(extensionPoints); - matchedEndpoint.setBinding(b); - matchedEndpoint.setRemote(true); - endpointReference.setTargetEndpoint(matchedEndpoint); - endpointReference.setBinding(b); - endpointReference.setUnresolved(false); - endpointReference.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED); - matchAudit.append("Match because the UnknownEndpointHandler provided a binding: " + b.getType() + " uri: " + b.getURI()); - matchAudit.appendSeperator(); - } else { + processUnknownEndpoint(endpointReference, matchAudit); + + if (!endpointReference.getStatus().equals(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED)){ Monitor.error(monitor, this, "endpoint-validation-messages", @@ -303,7 +291,11 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { monitor.getLastProblem().toString()); } } - } + } else { + // it's build time so just give the UnknownEndpoint code a chance + // without regard for the result + processUnknownEndpoint(endpointReference, matchAudit); + } } logger.fine(matchAudit.toString()); @@ -366,6 +358,24 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { // System.out.println("MATCH AUDIT:" + matchAudit.toString()); } + + private void processUnknownEndpoint(EndpointReference endpointReference, Audit matchAudit){ + Binding b = null; + if (unknownEndpointHandler != null) { + b = unknownEndpointHandler.handleUnknownEndpoint(endpointReference); + } + if (b != null) { + Endpoint matchedEndpoint = new RuntimeEndpointImpl(extensionPoints); + matchedEndpoint.setBinding(b); + matchedEndpoint.setRemote(true); + endpointReference.setTargetEndpoint(matchedEndpoint); + endpointReference.setBinding(b); + endpointReference.setUnresolved(false); + endpointReference.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED); + matchAudit.append("Match because the UnknownEndpointHandler provided a binding: " + b.getType() + " uri: " + b.getURI()); + matchAudit.appendSeperator(); + } + } /** * Returns true if the reference has a callback -- cgit v1.2.3