diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-25 23:00:57 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-25 23:00:57 +0000 |
commit | d7c15da034109074d717d3f9f0c3325a54b597dd (patch) | |
tree | 553365305a3bad892346fb83cf92187b24ca0288 /sca-java-2.x/trunk/modules/core | |
parent | f026711cd4af3326d8e40a428954f822f65e4c80 (diff) |
Add the check for local-by-reference, local-by-value and remote invocations for binding.sca
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@916483 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core')
3 files changed, 16 insertions, 4 deletions
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 940155d613..ff290ee150 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 @@ -71,7 +71,6 @@ import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; import org.apache.tuscany.sca.runtime.RuntimeWireProcessor; import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint; import org.apache.tuscany.sca.work.WorkScheduler; -import org.oasisopen.sca.SCARuntimeException; import org.oasisopen.sca.ServiceRuntimeException; /** @@ -304,7 +303,7 @@ public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implemen boolean ok = eprBinder.bindRunTime(endpointRegistry, this); if (!ok) { - throw new SCARuntimeException("Unable to bind " + this); + throw new ServiceRuntimeException("Unable to bind " + this); } // start the binding provider diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImpl.java index 60914f799b..8569af0de8 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImpl.java @@ -86,6 +86,19 @@ public class InvocationChainImpl implements InvocationChain { public Invoker getHeadInvoker() { return nodes.isEmpty() ? null : nodes.get(0).getInvoker(); } + + public Invoker getHeadInvoker(String phase) { + int index = phaseManager.getAllPhases().indexOf(phase); + if (index == -1) { + throw new IllegalArgumentException("Invalid phase name: " + phase); + } + for (Node node : nodes) { + if (index <= node.getPhaseIndex()) { + return node.getInvoker(); + } + } + return null; + } /** * @return the sourceOperation diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManager.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManager.java index 1649eade87..85ef79b5d7 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManager.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManager.java @@ -69,7 +69,7 @@ public class PhaseManager { public static final String STAGE_IMPLEMENTATION = "implementation"; private static final String[] SYSTEM_REFERENCE_PHASES = - {REFERENCE, REFERENCE_INTERFACE, REFERENCE_POLICY, REFERENCE_BINDING}; + {REFERENCE, REFERENCE_POLICY, REFERENCE_INTERFACE, REFERENCE_BINDING}; private static final String[] SYSTEM_REFERENCE_BINDING_PHASES = {REFERENCE_BINDING_WIREFORMAT, REFERENCE_BINDING_POLICY, REFERENCE_BINDING_TRANSPORT}; @@ -78,7 +78,7 @@ public class PhaseManager { {SERVICE_BINDING_TRANSPORT, SERVICE_BINDING_OPERATION_SELECTOR, SERVICE_BINDING_WIREFORMAT, SERVICE_BINDING_POLICY}; private static final String[] SYSTEM_SERVICE_PHASES = - {SERVICE_BINDING, SERVICE_POLICY, SERVICE_INTERFACE, SERVICE}; + {SERVICE_BINDING, SERVICE_INTERFACE, SERVICE_POLICY, SERVICE}; private static final String[] SYSTEM_IMPLEMENTATION_PHASES = {IMPLEMENTATION_POLICY, IMPLEMENTATION}; |