From 4dcff7533534e4b634b349a1105c7862d1655405 Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 13 Nov 2009 21:49:15 +0000 Subject: Replace RuntimeWire with RuntimeEnpoint/RuntimeEndpointReference as the owner of invocaiton chains (http://www.mail-archive.com/dev@tuscany.apache.org/msg07856.html) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@836009 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/context/CompositeContext.java | 46 +++++-- .../tuscany/sca/provider/BasePolicyProvider.java | 31 +++-- .../sca/provider/BindingPolicyProvider.java | 37 ++++++ .../sca/provider/BindingProviderFactory.java | 8 +- .../DefaultProviderFactoryExtensionPoint.java | 33 ++--- .../tuscany/sca/provider/EndpointProvider.java | 35 ++++++ .../sca/provider/EndpointReferenceProvider.java | 36 ++++++ .../provider/OperationSelectorProviderFactory.java | 22 +--- .../tuscany/sca/provider/PolicyProviderRRB.java | 37 ------ .../sca/provider/ReferenceBindingProviderRRB.java | 35 ------ .../sca/provider/ServiceBindingProviderRRB.java | 35 ------ .../sca/provider/WireFormatProviderFactory.java | 22 +--- .../org/apache/tuscany/sca/runtime/Invocable.java | 136 +++++++++++++++++++++ .../sca/runtime/RuntimeComponentContext.java | 25 +--- .../sca/runtime/RuntimeComponentReference.java | 71 ----------- .../sca/runtime/RuntimeComponentService.java | 106 ---------------- .../tuscany/sca/runtime/RuntimeEndpoint.java | 76 +++--------- .../sca/runtime/RuntimeEndpointReference.java | 78 +++--------- .../apache/tuscany/sca/runtime/RuntimeWire.java | 114 ----------------- .../tuscany/sca/runtime/RuntimeWireProcessor.java | 15 ++- 20 files changed, 366 insertions(+), 632 deletions(-) create mode 100644 java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingPolicyProvider.java create mode 100644 java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointProvider.java create mode 100644 java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceProvider.java delete mode 100644 java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java delete mode 100644 java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java delete mode 100644 java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java create mode 100644 java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java delete mode 100644 java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java (limited to 'java/sca/modules/core-spi/src/main') diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java index a805985a11..a55de8f20e 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java @@ -33,7 +33,24 @@ import org.apache.tuscany.sca.runtime.RuntimeComponentContext; * * @version $Rev$ $Date$ */ -public abstract class CompositeContext { +public class CompositeContext { + protected ExtensionPointRegistry extensionPointRegistry; + protected EndpointRegistry endpointRegistry; + protected ComponentContextFactory componentContextFactory; + protected Composite domainComposite; + + public CompositeContext(ExtensionPointRegistry registry, EndpointRegistry endpointRegistry, Composite domainComposite) { + this.extensionPointRegistry = registry; + this.endpointRegistry = endpointRegistry; + ContextFactoryExtensionPoint contextFactories = registry.getExtensionPoint(ContextFactoryExtensionPoint.class); + this.componentContextFactory = contextFactories.getFactory(ComponentContextFactory.class); + this.domainComposite = domainComposite; + } + + public CompositeContext(ExtensionPointRegistry registry, EndpointRegistry endpointRegistry) { + this(registry, endpointRegistry, null); + } + /** * @return */ @@ -62,30 +79,37 @@ public abstract class CompositeContext { return null; } - /** - * Attach a component context to the component - * @param runtimeComponent - */ - public abstract void bindComponent(RuntimeComponent runtimeComponent); - + public void bindComponent(RuntimeComponent runtimeComponent) { + RuntimeComponentContext componentContext = + (RuntimeComponentContext)componentContextFactory.createComponentContext(this, runtimeComponent); + runtimeComponent.setComponentContext(componentContext); + } /** * * @param endpointReference */ - public abstract void bindEndpointReference(EndpointReference endpointReference); + public void bindEndpointReference(EndpointReference endpointReference) { + + } /** * Get the ExtensionPointRegistry for this node * @return The ExtensionPointRegistry */ - public abstract ExtensionPointRegistry getExtensionPointRegistry(); + public ExtensionPointRegistry getExtensionPointRegistry() { + return extensionPointRegistry; + } /** * Get the EndpointRegistry * @return The EndpointRegistry for this node */ - public abstract EndpointRegistry getEndpointRegistry(); + public EndpointRegistry getEndpointRegistry() { + return endpointRegistry; + } - public abstract Composite getDomainComposite(); + public Composite getDomainComposite() { + return domainComposite; + } } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java index 785ac70271..8f93476c85 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java @@ -32,9 +32,10 @@ import org.apache.tuscany.sca.invocation.PhasedInterceptor; import org.apache.tuscany.sca.policy.PolicyExpression; import org.apache.tuscany.sca.policy.PolicySet; import org.apache.tuscany.sca.policy.PolicySubject; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; +import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentService; -import org.apache.tuscany.sca.runtime.RuntimeWire; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; +import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; /** * Abstract base class for policy providers @@ -129,30 +130,26 @@ public abstract class BasePolicyProvider implements PolicyProvider { return null; } - private InvocationChain getInvocationChain() { - if (subject instanceof Endpoint) { - Endpoint endpoint = (Endpoint)subject; - RuntimeComponentService service = (RuntimeComponentService)endpoint.getService(); - RuntimeWire wire = service.getRuntimeWire(endpoint.getBinding()); - List chains = wire.getInvocationChains(); + protected InvocationChain getInvocationChain() { + if (subject instanceof RuntimeEndpoint) { + RuntimeEndpoint endpoint = (RuntimeEndpoint)subject; + List chains = endpoint.getInvocationChains(); for (InvocationChain chain : chains) { configure(chain, chain.getTargetOperation()); } - } else if (subject instanceof EndpointReference) { - EndpointReference endpointReference = (EndpointReference)subject; - RuntimeComponentReference reference = (RuntimeComponentReference)endpointReference.getReference(); - RuntimeWire wire = reference.getRuntimeWire(endpointReference.getBinding()); - List chains = wire.getInvocationChains(); + } else if (subject instanceof RuntimeEndpointReference) { + RuntimeEndpointReference endpointReference = (RuntimeEndpointReference)subject; + List chains = endpointReference.getInvocationChains(); for (InvocationChain chain : chains) { configure(chain, chain.getSourceOperation()); } - } else if (subject instanceof Component) { - Component component = (Component)subject; + } else if (subject instanceof RuntimeComponent) { + RuntimeComponent component = (RuntimeComponent)subject; for (ComponentService s : component.getServices()) { RuntimeComponentService service = (RuntimeComponentService)s; - for (RuntimeWire wire : service.getRuntimeWires()) { - List chains = wire.getInvocationChains(); + for (Endpoint ep : service.getEndpoints()) { + List chains = ((RuntimeEndpoint)ep).getInvocationChains(); for (InvocationChain chain : chains) { configure(chain, chain.getTargetOperation()); } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingPolicyProvider.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingPolicyProvider.java new file mode 100644 index 0000000000..5f2e6bd315 --- /dev/null +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingPolicyProvider.java @@ -0,0 +1,37 @@ +/* + * 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.provider; + +import org.apache.tuscany.sca.invocation.PhasedInterceptor; + +/** + * TODO RRB experiment + * This is an experiment extension to try out the request response + * binding function + * @version $Rev$ $Date$ + */ +public interface BindingPolicyProvider extends PolicyProvider { + /** + * Create a binding interceptor + * @return An interceptor that realize the policySet + */ + PhasedInterceptor createBindingInterceptor(); + +} diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java index 0e94a28d98..5fa8454b95 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java @@ -20,8 +20,8 @@ package org.apache.tuscany.sca.provider; import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; +import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; /** * A factory for creating the runtime artifacts that represent bindings. @@ -36,7 +36,7 @@ public interface BindingProviderFactory extends ProviderFacto * @param endpointReference defines the component/reference/binding against which to create the provider * @return The binding provider */ - ReferenceBindingProvider createReferenceBindingProvider(EndpointReference endpointReference); + ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpointReference); /** * Creates a new service binding provider for the given component and @@ -45,6 +45,6 @@ public interface BindingProviderFactory extends ProviderFacto * @param endpoint defines the component/service/binding against which to create the provider * @return The binding provider */ - ServiceBindingProvider createServiceBindingProvider(Endpoint endpoint); + ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint); } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java index 2ee058a14d..8621baca2e 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java @@ -26,7 +26,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.assembly.Implementation; @@ -34,8 +33,8 @@ import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.extensibility.ServiceDeclaration; import org.apache.tuscany.sca.extensibility.ServiceDiscovery; import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; +import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; /** * Default implementation of a provider factory extension point. @@ -237,12 +236,12 @@ public class DefaultProviderFactoryExtensionPoint implements ProviderFactoryExte } @SuppressWarnings("unchecked") - public ReferenceBindingProvider createReferenceBindingProvider(EndpointReference endpointReference) { + public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpointReference) { return getFactory().createReferenceBindingProvider(endpointReference); } @SuppressWarnings("unchecked") - public ServiceBindingProvider createServiceBindingProvider(Endpoint endpoint) { + public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) { return getFactory().createServiceBindingProvider(endpoint); } @@ -409,16 +408,12 @@ public class DefaultProviderFactoryExtensionPoint implements ProviderFactoryExte return factory; } - public WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding){ - return getFactory().createReferenceWireFormatProvider(component, reference, binding); + public WireFormatProvider createReferenceWireFormatProvider(RuntimeEndpointReference endpointReference){ + return getFactory().createReferenceWireFormatProvider(endpointReference); } - public WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding){ - return getFactory().createServiceWireFormatProvider(component, service, binding); + public WireFormatProvider createServiceWireFormatProvider(RuntimeEndpoint endpoint){ + return getFactory().createServiceWireFormatProvider(endpoint); } public Class getModelType() { @@ -470,16 +465,12 @@ public class DefaultProviderFactoryExtensionPoint implements ProviderFactoryExte return factory; } - public OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding){ - return getFactory().createReferenceOperationSelectorProvider(component, reference, binding); + public OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeEndpointReference endpointReference){ + return getFactory().createReferenceOperationSelectorProvider(endpointReference); } - public OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding){ - return getFactory().createServiceOperationSelectorProvider(component, service, binding); + public OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeEndpoint endpoint){ + return getFactory().createServiceOperationSelectorProvider(endpoint); } public Class getModelType() { diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointProvider.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointProvider.java new file mode 100644 index 0000000000..2672c31304 --- /dev/null +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointProvider.java @@ -0,0 +1,35 @@ +/* + * 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.provider; + + +/** + * TODO RRB experiment + * This is an experiment extension to try out the request response + * binding function + * + * @version $Rev$ $Date$ + */ +public interface EndpointProvider extends ServiceBindingProvider { + /** + * Configure the binding invocation chain + */ + void configure(); +} diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceProvider.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceProvider.java new file mode 100644 index 0000000000..6430fe4d34 --- /dev/null +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/EndpointReferenceProvider.java @@ -0,0 +1,36 @@ +/* + * 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.provider; + + +/** + * TODO RRB experiment + * This is an experiment extension to try out the request response + * binding function + * + * @version $Rev$ $Date$ + */ +public interface EndpointReferenceProvider extends ReferenceBindingProvider { + /** + * Configure the binding invocation chain + */ + void configure(); + +} diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java index 183b38cb33..4aca3e04e0 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java @@ -19,11 +19,9 @@ package org.apache.tuscany.sca.provider; -import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; +import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; /** * @version $Rev$ $Date$ @@ -31,23 +29,15 @@ import org.apache.tuscany.sca.runtime.RuntimeComponentService; public interface OperationSelectorProviderFactory extends ProviderFactory { /** * Create wire format provider for a given reference binding - * @param component - * @param reference - * @param binding + * @param endpointReference TODO * @return */ - OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding); + OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeEndpointReference endpointReference); /** * Create policy provider for a given service binding - * @param component - * @param service - * @param binding + * @param endpoint TODO * @return */ - OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding); + OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeEndpoint endpoint); } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java deleted file mode 100644 index 6e7f2bd554..0000000000 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.invocation.PhasedInterceptor; - -/** - * TODO RRB experiment - * This is an experiment extension to try out the request response - * binding function - * @version $Rev$ $Date$ - */ -public interface PolicyProviderRRB extends PolicyProvider { - /** - * Create a binding interceptor - * @return An interceptor that realize the policySet - */ - PhasedInterceptor createBindingInterceptor(); - -} diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java deleted file mode 100644 index 3ea9d0ac3c..0000000000 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * TODO RRB experiment - * This is an experiment extension to try out the request response - * binding function - * - * @version $Rev$ $Date$ - */ -public interface ReferenceBindingProviderRRB extends ReferenceBindingProvider { - - void configureBindingChain(RuntimeWire runtimeWire); - -} diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java deleted file mode 100644 index 278bb23e0a..0000000000 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * TODO RRB experiment - * This is an experiment extension to try out the request response - * binding function - * - * @version $Rev$ $Date$ - */ -public interface ServiceBindingProviderRRB extends ServiceBindingProvider { - - void configureBindingChain(RuntimeWire runtimeWire); - -} diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java index fd748df6ca..1033ce8951 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java @@ -19,11 +19,9 @@ package org.apache.tuscany.sca.provider; -import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.WireFormat; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; +import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; /** * @version $Rev$ $Date$ @@ -31,23 +29,15 @@ import org.apache.tuscany.sca.runtime.RuntimeComponentService; public interface WireFormatProviderFactory extends ProviderFactory { /** * Create wire format provider for a given reference binding - * @param component - * @param reference - * @param binding + * @param endpointReference The endpoint reference * @return */ - WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding); + WireFormatProvider createReferenceWireFormatProvider(RuntimeEndpointReference endpointReference); /** * Create policy provider for a given service binding - * @param component - * @param service - * @param binding + * @param endpoint TODO * @return */ - WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding); + WireFormatProvider createServiceWireFormatProvider(RuntimeEndpoint endpoint); } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java new file mode 100644 index 0000000000..4e0128c49a --- /dev/null +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java @@ -0,0 +1,136 @@ +/* + * 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.runtime; + +import java.lang.reflect.InvocationTargetException; +import java.util.List; + +import org.apache.tuscany.sca.assembly.Binding; +import org.apache.tuscany.sca.assembly.Component; +import org.apache.tuscany.sca.assembly.Contract; +import org.apache.tuscany.sca.context.CompositeContext; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.interfacedef.Operation; +import org.apache.tuscany.sca.invocation.InvocationChain; +import org.apache.tuscany.sca.invocation.Message; +import org.apache.tuscany.sca.provider.PolicyProvider; + +/** + * The abstraction of an invocable model that contains invocation chains + */ +public interface Invocable { + /** + * Bind the invocable to the composite context + * @param context + */ + void bind(CompositeContext context); + + /** + * Bind the invocable to the extension point registry and endpoint registry. This is typically + * called after the endpoint or endpoint reference is deserialized + * @param registry + * @param endpointRegistry + */ + void bind(ExtensionPointRegistry registry, EndpointRegistry endpointRegistry); + + /** + * Get the associated composite context + * @return + */ + CompositeContext getCompositeContext(); + + /** + * Unbind the invocable from the composite context + */ + void unbind(); + + /** + * Get the component + * @return + */ + Component getComponent(); + + /** + * Get the service or reference (contract) + * @return + */ + Contract getContract(); + + /** + * Get the binding + * @return + */ + Binding getBinding(); + + /** + * Returns the invocation chains for service operations associated with the + * wire + * + * @return the invocation chains for service operations associated with the + * wire + */ + List getInvocationChains(); + + /** + * Lookup the invocation chain by operation + * @param operation The operation + * @return The invocation chain for the given operation + */ + InvocationChain getInvocationChain(Operation operation); + + /** + * Get the invocation chain for the binding-specific handling + * @return The binding invocation chain + */ + InvocationChain getBindingInvocationChain(); + + /** + * This invoke method assumes that the binding invocation chain is in force + * and that there will be an operation selector element there to + * determine which operation to call + * @param msg The request message + * @return The response message + */ + Message invoke(Message msg); + + /** + * Invoke an operation with given arguments + * @param operation The operation + * @param args The arguments + * @return The result + * @throws InvocationTargetException + */ + Object invoke(Operation operation, Object[] args) throws InvocationTargetException; + + /** + * Invoke an operation with a context message + * @param operation The operation + * @param msg The request message + * @return The response message + * @throws InvocationTargetException + */ + Message invoke(Operation operation, Message msg); + + /** + * Get a list of policy providers + * @return + */ + List getPolicyProviders(); +} diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java index 5f9ff4fa7e..861ca2d6f9 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java @@ -20,7 +20,6 @@ package org.apache.tuscany.sca.runtime; import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.context.CompositeContext; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.oasisopen.sca.ComponentContext; @@ -40,27 +39,12 @@ public interface RuntimeComponentContext extends ComponentContext { * Get the CallableReference for a given component reference * @param * @param businessInterface The business interface - * @param reference The reference to be wired * @param endpointReference The endpointReference to be used * @return A service reference representing the wire */ ServiceReference getServiceReference(Class businessInterface, - RuntimeComponentReference reference, - EndpointReference endpointReference); + RuntimeEndpointReference endpointReference); - /** - * Bind the reference to a target component/componentService - * @param - * @param businessInterface The business interface - * @param reference The reference to be wired - * @param component The target component - * @param service The target component service - * @return A service reference representing the wire - */ - ServiceReference getServiceReference(Class businessInterface, - RuntimeComponentReference reference, - RuntimeComponent component, - RuntimeComponentService service); /** * Create a CallableReference for the given component service @@ -70,9 +54,7 @@ public interface RuntimeComponentContext extends ComponentContext { * @param service * @return */ - ServiceReference getCallableReference(Class businessInterface, - RuntimeComponent component, - RuntimeComponentService service); + ServiceReference getServiceReference(Class businessInterface, RuntimeEndpoint endpoint); /** * @param @@ -81,7 +63,8 @@ public interface RuntimeComponentContext extends ComponentContext { * @return */ ServiceReference createSelfReference(Class businessInterface, ComponentService service); - + ExtensionPointRegistry getExtensionPointRegistry(); + CompositeContext getCompositeContext(); } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java index 0105abd6e4..c0f393c827 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java @@ -19,15 +19,7 @@ package org.apache.tuscany.sca.runtime; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.PolicyProvider; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; /** * The runtime component reference. Provides the bridge between the @@ -37,69 +29,6 @@ import org.apache.tuscany.sca.provider.ReferenceBindingProvider; * @version $Rev$ $Date$ */ public interface RuntimeComponentReference extends ComponentReference { - - /** - * Get a list of runtime wires to the reference - * - * @return The list of wires - */ - List getRuntimeWires(); - - /** - * Get the runtime wire for the given binding - * @param binding The assembly model binding - * @return The runtime wire - */ - RuntimeWire getRuntimeWire(Binding binding); - - /** - * Get the runtime wire for the given endpoint reference - * @param endpointReference The assembly model endpoint reference - * @return The runtime wire - */ - RuntimeWire getRuntimeWire(EndpointReference endpointReference); - - /** - * Returns the reference binding provider associated with this - * component reference and the given binding. - * - * @param binding The assembly model binding - * @return The runtime reference binding provider - */ - ReferenceBindingProvider getBindingProvider(Binding binding); - - /** - * Sets the reference binding provider associated with this - * component reference and the given binding. - * - * @param binding The assembly model binding - * @param bindingProvider The runtime reference binding provider - */ - void setBindingProvider(Binding binding, ReferenceBindingProvider bindingProvider); - - - /** - * Add a policy provider for the given binding to the reference - * @param binding The assembly model binding - * @param policyProvider The policy handler - */ - void addPolicyProvider(Binding binding, PolicyProvider policyProvider); - - /** - * Get a list of policy providers for the given binding - * @param binding The assembly model binding - * @return A list of policy providers for the given binding - */ - List getPolicyProviders(Binding binding); - - /** - * Get the invoker for the given binding and operation - * @param binding The assembly model binding - * @param operation The assembly model operation - * @return The runtime Invoker - */ - Invoker getInvoker(Binding binding, Operation operation); - /** * Set the owning component * @param component diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java index 982724d798..28dd97756a 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java @@ -19,16 +19,7 @@ package org.apache.tuscany.sca.runtime; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.PolicyProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; /** * The runtime component service. Provides the bridge between the @@ -38,101 +29,4 @@ import org.apache.tuscany.sca.provider.ServiceBindingProvider; * @version $Rev$ $Date$ */ public interface RuntimeComponentService extends ComponentService { - - /** - * Get a list of runtime wires to the service - * - * @return The list of wires - */ - List getRuntimeWires(); - /** - * Get the runtime wire for the given binding - * @param binding The assembly model binding - * @return The runtime wire - */ - RuntimeWire getRuntimeWire(Binding binding); - - /** - * Get the callback wires associated with this service - * - * @return The list of runtime callback wires - */ - List getCallbackWires(); - - /** - * Returns the service binding provider associated with this - * component service and the given binding. - * - * @param binding The assembly model binding - * @return The runtime service binding provider - */ - ServiceBindingProvider getBindingProvider(Binding binding); - - /** - * Returns the service binding provider associated with this - * component service and the given binding. - * - * @param binding - * @param interfaceContract - * @return - */ - RuntimeWire getRuntimeWire(Binding binding, InterfaceContract interfaceContract); - - /** - * Sets the service binding provider associated with this - * component service and the given binding. - * - * @param binding The assembly model binding - * @param bindingProvider The runtime service binding provider - */ - void setBindingProvider(Binding binding, ServiceBindingProvider bindingProvider); - - /** - * Get the invoker for the given binding and operation - * @param binding The assembly model binding - * @param operation The assembly model operation - * @return The runtime invoker - */ - Invoker getInvoker(Binding binding, Operation operation); - - /** - * Get the invoker for the given binding and operation - * @param binding The assembly model binding - * @param interfaceContract the client interface contract - * @param operation The assembly model operation - * @return The runtime invoker - */ - Invoker getInvoker(Binding binding, InterfaceContract interfaceContract, Operation operation); - - /** - * Get the invocation chain for the given binding and operation - * @param binding The assembly model binding - * @param operation The assembly model operation - * @return The runtime invocation chain - */ - InvocationChain getInvocationChain(Binding binding, Operation operation); - - /** - * Get the invocation chain for the given binding and operation - * @param binding The assembly model binding - * @param operation The assembly model operation - * @param interfaceContract the client interface contract - * @return The runtime invocation chain - */ - InvocationChain getInvocationChain(Binding binding, InterfaceContract interfaceContract, Operation operation); - - /** - * Add a policy provider for the given binding to the service - * @param binding The assembly model binding - * @param policyProvider The policy handler - */ - void addPolicyProvider(Binding binding, PolicyProvider policyProvider); - - /** - * Get a list of policy providers for the given binding - * @param binding The assembly model binding - * @return A list of policy providers for the given binding - */ - List getPolicyProviders(Binding binding); - } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java index 7000da9093..2a4cf4fc84 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java @@ -20,70 +20,15 @@ package org.apache.tuscany.sca.runtime; import java.io.Serializable; -import java.lang.reflect.InvocationTargetException; -import java.util.List; import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.provider.PolicyProvider; +import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.provider.ServiceBindingProvider; /** * The runtime representation of a service endpoint */ -public interface RuntimeEndpoint extends Endpoint, Serializable { - /** - * Returns the invocation chains for service operations associated with the - * wire - * - * @return the invocation chains for service operations associated with the - * wire - */ - List getInvocationChains(); - - /** - * Lookup the invocation chain by operation - * @param operation The operation - * @return The invocation chain for the given operation - */ - InvocationChain getInvocationChain(Operation operation); - - /** - * Get the invocation chain for the binding-specific handling - * @return The binding invocation chain - */ - InvocationChain getBindingInvocationChain(); - - /** - * This invoke method assumes that the binding invocation chain is in force - * and that there will be an operation selector element there to - * determine which operation to call - * @param msg The message - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Message msg) throws InvocationTargetException; - - /** - * Invoke an operation with given arguments - * @param operation The operation - * @param args The arguments - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Operation operation, Object[] args) throws InvocationTargetException; - - /** - * Invoke an operation with a context message - * @param operation The operation - * @param msg The message - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Operation operation, Message msg) throws InvocationTargetException; - +public interface RuntimeEndpoint extends Endpoint, Invocable, Serializable { /** * Attach the service binding provider * @param provider @@ -95,10 +40,19 @@ public interface RuntimeEndpoint extends Endpoint, Serializable { * @return */ ServiceBindingProvider getBindingProvider(); - + /** - * Get a list of policy providers - * @return + * Get the interface contract for the binding. This represents the data types that the binding + * protocol stack can process. + * @return The binding interface contract + */ + InterfaceContract getBindingInterfaceContract(); + + /** + * Get the interface contract of the service of the target component type, i.e., the + * componentType.service.interfaceContract. This represents the data types that the implementation + * code can process. + * @return The target component type service interface contract */ - List getPolicyProviders(); + InterfaceContract getServiceInterfaceContract(); } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java index 86c808c0fb..d6f8431d48 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java @@ -20,70 +20,15 @@ package org.apache.tuscany.sca.runtime; import java.io.Serializable; -import java.lang.reflect.InvocationTargetException; -import java.util.List; import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.provider.PolicyProvider; +import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.provider.ReferenceBindingProvider; /** * The runtime representation of an endpoint reference */ -public interface RuntimeEndpointReference extends EndpointReference, Serializable { - /** - * Returns the invocation chains for service operations associated with the - * wire - * - * @return the invocation chains for service operations associated with the - * wire - */ - List getInvocationChains(); - - /** - * Lookup the invocation chain by operation - * @param operation The operation - * @return The invocation chain for the given operation - */ - InvocationChain getInvocationChain(Operation operation); - - /** - * Get the invocation chain for the binding-specific handling - * @return The binding invocation chain - */ - InvocationChain getBindingInvocationChain(); - - /** - * This invoke method assumes that the binding invocation chain is in force - * and that there will be an operation selector element there to - * determine which operation to call - * @param msg The message - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Message msg) throws InvocationTargetException; - - /** - * Invoke an operation with given arguments - * @param operation The operation - * @param args The arguments - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Operation operation, Object[] args) throws InvocationTargetException; - - /** - * Invoke an operation with a context message - * @param operation The operation - * @param msg The message - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Operation operation, Message msg) throws InvocationTargetException; - +public interface RuntimeEndpointReference extends EndpointReference, Invocable, Serializable { /** * Set the reference binding provider for the endpoint reference * @param provider The binding provider @@ -95,10 +40,21 @@ public interface RuntimeEndpointReference extends EndpointReference, Serializabl * @return The binding provider */ ReferenceBindingProvider getBindingProvider(); - /** - * Get the list of policy providers for the endpoint reference - * @return A list of policy providers for the endpoint reference + * Get the interface contract for the binding. This represents the data types that the binding + * protocol stack can process. + * @return The binding interface contract */ - List getPolicyProviders(); + InterfaceContract getBindingInterfaceContract(); + + /** + * Get the interface contract of the reference of the source component type, i.e., the + * componentType.reference.interfaceContract. This represents the data types that the + * implementation code uses to make the outbound call. + * @return The source component type reference interface contract + */ + InterfaceContract getReferenceInterfaceContract(); + boolean isOutOfDate(); + void rebuild(); + } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java deleted file mode 100644 index c0150c6138..0000000000 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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.runtime; - -import java.lang.reflect.InvocationTargetException; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Message; - -/** - * The runtime wire interface that connects a component reference to a - * component service (or an external service) over the selected binding - * - * @version $Rev$ $Date$ - */ -public interface RuntimeWire extends Cloneable { - /** - * return the endpoint reference that configured this wire - * - * @return the endpoint reference that configured this wire - */ - EndpointReference getEndpointReference(); - - /** - * return the endpoint that configured this wire - * - * @return the endpoint that configured this wire - */ - Endpoint getEndpoint(); - - /** - * Force the invocation chains to be rebuilt - */ - void rebuild(); - - /** - * Returns the invocation chains for service operations associated with the - * wire - * - * @return the invocation chains for service operations associated with the - * wire - */ - List getInvocationChains(); - - /** - * Lookup the invocation chain by operation - * @param operation The operation - * @return The invocation chain for the given operation - */ - InvocationChain getInvocationChain(Operation operation); - - /** - * Get the invocation chain for the binding-specific handling - * @return - */ - InvocationChain getBindingInvocationChain(); - - /** - * This invoke method assumes that the binding invocation chain is in force - * and that there will be an operation selector element there to - * determine which operation to call - * @param msg The message - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Message msg) throws InvocationTargetException; - - /** - * Invoke an operation with given arguments - * @param operation The operation - * @param args The arguments - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Operation operation, Object[] args) throws InvocationTargetException; - - /** - * Invoke an operation with a context message - * @param operation The operation - * @param msg The message - * @return The result - * @throws InvocationTargetException - */ - Object invoke(Operation operation, Message msg) throws InvocationTargetException; - - /** - * @return a clone of the runtime wire - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - - boolean isOutOfDate(); -} diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java index fbb7aae467..06db5b10af 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java @@ -24,12 +24,15 @@ package org.apache.tuscany.sca.runtime; * @version $Rev$ $Date$ */ public interface RuntimeWireProcessor { - /** - * Process the runtime wire to add interceptors - * - * @param wire + * Configure the runtime endpoint + * @param endpoint */ - void process(RuntimeWire wire); - + void process(RuntimeEndpoint endpoint); + + /** + * Configure the runtime endpoint reference + * @param endpointReference + */ + void process(RuntimeEndpointReference endpointReference); } -- cgit v1.2.3