summaryrefslogtreecommitdiffstats
path: root/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime')
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActivationException.java37
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java107
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java127
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java46
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java46
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java42
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java48
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java38
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java59
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java83
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java87
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java108
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java138
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java104
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java104
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java114
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java35
-rw-r--r--tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java53
18 files changed, 1376 insertions, 0 deletions
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActivationException.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActivationException.java
new file mode 100644
index 0000000000..b015891e93
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ActivationException.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.runtime;
+
+
+/**
+ * Denotes an error starting the runtime
+ *
+ * @version $Rev$ $Date$
+ */
+public class ActivationException extends Exception {
+ private static final long serialVersionUID = 8612661660934426123L;
+
+ public ActivationException(String message) {
+ super(message);
+ }
+
+ public ActivationException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java
new file mode 100644
index 0000000000..f4e18f60cc
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java
@@ -0,0 +1,107 @@
+/*
+ * 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 org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.context.CompositeContext;
+
+/**
+ * Start/stop a composite
+ *
+ * @version $Rev$ $Date$
+ */
+public interface CompositeActivator {
+ /**
+ * Activate a composite
+ * @param compositeContext The context of the Node
+ * @param composite
+ */
+ void activate(CompositeContext compositeContext, Composite composite) throws ActivationException;
+
+ /**
+ * Activate a component reference
+ * @param compositeContext The context of the Node
+ * @param component
+ * @param ref
+ */
+ void start(CompositeContext compositeContext, RuntimeComponent component, RuntimeComponentReference ref);
+
+ /**
+ * Activate a component reference
+ * @param compositeContext The context of the Node
+ * @param component
+ * @param ref
+ */
+ void activate(CompositeContext compositeContext, RuntimeComponent component, RuntimeComponentReference ref);
+
+ /**
+ * Activate a component reference
+ * @param compositeContext The context of the Node
+ * @param component
+ * @param ref
+ */
+ void activate(CompositeContext compositeContext, RuntimeComponent component, RuntimeComponentService service);
+
+ /**
+ * De-activate a component reference
+ * @param component
+ * @param ref
+ */
+ void deactivate(RuntimeComponent component, RuntimeComponentReference ref);
+
+ /**
+ * De-activate a component reference
+ * @param component
+ * @param ref
+ */
+ void deactivate(RuntimeComponent component, RuntimeComponentService service);
+
+ /**
+ * Stop a composite
+ * @param composite
+ */
+ void deactivate(Composite composite) throws ActivationException;
+
+ /**
+ * Start a component
+ * @param component
+ */
+ void start(CompositeContext compositeContext, Component component) throws ActivationException;
+
+ /**
+ * Stop a component
+ * @param component
+ */
+ void stop(CompositeContext compositeContext, Component component) throws ActivationException;
+
+ /**
+ * Start components in a composite
+ * @param composite
+ */
+ void start(CompositeContext compositeContext, Composite composite) throws ActivationException;
+
+ /**
+ * Stop components in a composite
+ * @param composite
+ */
+ void stop(CompositeContext compositeContext, Composite composite) throws ActivationException;
+
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java
new file mode 100644
index 0000000000..283d1d1a8b
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java
@@ -0,0 +1,127 @@
+/*
+ * 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.Constructor;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.LifeCycleListener;
+import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
+import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
+
+/**
+ * The default implementation of a <code>WireProcessorExtensionPoint</code>
+ *
+ * @version $Rev$ $Date$
+ */
+public class DefaultWireProcessorExtensionPoint implements RuntimeWireProcessorExtensionPoint, LifeCycleListener {
+ private ExtensionPointRegistry registry;
+ private boolean loaded;
+
+ /**
+ * @param registry
+ */
+ public DefaultWireProcessorExtensionPoint(ExtensionPointRegistry registry) {
+ super();
+ this.registry = registry;
+ }
+
+ /**
+ * The list of WireProcessors available to the runtime
+ */
+ private final List<RuntimeWireProcessor> processors = new ArrayList<RuntimeWireProcessor>();
+
+ /**
+ * Registers a wire-processor in the runtime
+ *
+ * @param processor The processor to register
+ */
+ public void addWireProcessor(RuntimeWireProcessor processor) {
+ processors.add(processor);
+ if (processor instanceof LifeCycleListener) {
+ ((LifeCycleListener)processor).start();
+ }
+ }
+
+ /**
+ * De-registers a wire-processor in the runtime
+ *
+ * @param processor The processor to de-register
+ */
+ public void removeWireProcessor(RuntimeWireProcessor processor) {
+ boolean found = processors.remove(processor);
+ if (found && (processor instanceof LifeCycleListener)) {
+ ((LifeCycleListener)processor).stop();
+ }
+ }
+
+ /**
+ * Returns a list of registered wire-processors.
+ *
+ * @return The list of wire processors
+ */
+ public List<RuntimeWireProcessor> getWireProcessors() {
+ loadWireProcessors();
+ return processors;
+ }
+
+ private synchronized void loadWireProcessors() {
+ if (loaded) {
+ return;
+ }
+ try {
+ Collection<ServiceDeclaration> sds =
+ registry.getServiceDiscovery().getServiceDeclarations(RuntimeWireProcessor.class, true);
+ for (ServiceDeclaration sd : sds) {
+ Class type = sd.loadClass();
+ Constructor constructor = null;
+ RuntimeWireProcessor processor = null;
+ try {
+ constructor = type.getConstructor(ExtensionPointRegistry.class);
+ processor = (RuntimeWireProcessor)constructor.newInstance(registry);
+
+ } catch (NoSuchMethodException e) {
+ constructor = type.getConstructor();
+ processor = (RuntimeWireProcessor)constructor.newInstance();
+ }
+ if (processor != null) {
+ addWireProcessor(processor);
+ }
+ }
+ loaded = true;
+ } catch (Throwable e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public void start() {
+ }
+
+ public void stop() {
+ for (RuntimeWireProcessor processor : processors) {
+ if ((processor instanceof LifeCycleListener)) {
+ ((LifeCycleListener)processor).stop();
+ }
+ }
+ processors.clear();
+ }
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java
new file mode 100644
index 0000000000..7b71406ac6
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java
@@ -0,0 +1,46 @@
+/*
+ * 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.util.Collection;
+import java.util.List;
+
+/**
+ *
+ */
+public interface DomainRegistryFactory {
+ /**
+ * Get the EndpointRegistry for the given registry URI and domain URI
+ * @param endpointRegistryURI A URI can be used to connect to the registry, such as vm://localhost
+ * or multicast://200.0.100.200:50000/...
+ * @param domainURI The domain URI
+ * @return
+ */
+ EndpointRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI);
+
+ /**
+ * Return all active endpoint registries
+ * @return
+ */
+ Collection<EndpointRegistry> getEndpointRegistries();
+ void addListener(EndpointListener listener);
+ void removeListener(EndpointListener listener);
+ List<EndpointListener> getListeners();
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java
new file mode 100644
index 0000000000..13d193c464
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java
@@ -0,0 +1,46 @@
+/*
+ * 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.util.EventListener;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+
+/**
+ * A listener for endpoint events
+ */
+public interface EndpointListener extends EventListener {
+ /**
+ * The method is invoked when a new endpoint is added to the registry
+ * @param endpoint
+ */
+ void endpointAdded(Endpoint endpoint);
+ /**
+ * The method is invoked when an endpoint is removed the registry
+ * @param endpoint
+ */
+ void endpointRemoved(Endpoint endpoint);
+ /**
+ * The method is invoked when an endpoint is updated in the registry
+ * @param oldEndpoint
+ * @param newEndpoint
+ */
+ void endpointUpdated(Endpoint oldEndpoint, Endpoint newEndpoint);
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java
new file mode 100644
index 0000000000..78a0e19f10
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java
@@ -0,0 +1,42 @@
+/*
+ * 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 org.apache.tuscany.sca.assembly.EndpointReference;
+
+/**
+ * A utility responsible for resolving the endpoint reference against a matching endpoint published
+ * to the EndpointRegistry
+ */
+public interface EndpointReferenceBinder {
+ /**
+ * @param endpointRegistry
+ * @param endpointReference
+ * @return
+ */
+ boolean bind(EndpointRegistry endpointRegistry, EndpointReference endpointReference);
+ /**
+ *
+ * @param endpointRegistry
+ * @param endpointReference
+ * @return
+ */
+ boolean isOutOfDate(EndpointRegistry endpointRegistry, EndpointReference endpointReference);
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
new file mode 100644
index 0000000000..09f4a4d78d
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
@@ -0,0 +1,48 @@
+/*
+ * 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.util.List;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+
+/**
+ * The EndpointRegistry holds the active service endpoints for the SCA domain
+ */
+public interface EndpointRegistry {
+ void addEndpoint(Endpoint endpoint);
+ void removeEndpoint(Endpoint endpoint);
+
+ Endpoint getEndpoint(String uri);
+ void updateEndpoint(String uri, Endpoint endpoint);
+ List<Endpoint> findEndpoint(EndpointReference endpointReference);
+ List<Endpoint> getEndpoints();
+
+ void addEndpointReference(EndpointReference endpointReference);
+ void removeEndpointReference(EndpointReference endpointReference);
+ List<EndpointReference> findEndpointReference(Endpoint endpoint);
+ List<EndpointReference> getEndpointRefereneces();
+
+ void addListener(EndpointListener listener);
+ void removeListener(EndpointListener listener);
+ List<EndpointListener> getListeners();
+
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java
new file mode 100644
index 0000000000..c56869170a
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java
@@ -0,0 +1,38 @@
+/*
+ * 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.io.IOException;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+
+/**
+ * A utility to seralize/deserialize Endpoint/EndpointReference objects
+ */
+public interface EndpointSerializer {
+ void read(Endpoint endpoint, String xml) throws IOException;
+
+ String write(Endpoint endpoint) throws IOException;
+
+ void read(EndpointReference endpointReference, String xml) throws IOException;
+
+ String write(EndpointReference endpointReference) throws IOException;
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java
new file mode 100644
index 0000000000..928c77fd04
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java
@@ -0,0 +1,59 @@
+/*
+ * 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 org.apache.tuscany.sca.assembly.EndpointReference;
+
+/**
+ * Parameters for the EndPointReference
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ReferenceParameters extends Cloneable {
+ /**
+ * Get the callback ID
+ * @return the callbackID
+ */
+ Object getCallbackID();
+
+ /**
+ * Set the callback ID
+ * @param callbackID the callbackID to set
+ */
+ void setCallbackID(Object callbackID);
+
+ /**
+ * Get the ID for the non-ServiceReference callback object
+ * @return
+ */
+ Object getCallbackObjectID();
+
+ /**
+ * Set the ID for the non-ServiceReference callback object
+ * @param callbackObjectID
+ */
+ void setCallbackObjectID(Object callbackObjectID);
+
+ EndpointReference getCallbackReference();
+
+ void setCallbackReference(EndpointReference callback);
+
+ Object clone() throws CloneNotSupportedException;
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java
new file mode 100644
index 0000000000..30bba78a40
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java
@@ -0,0 +1,83 @@
+/*
+ * 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.util.List;
+
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.PolicyProvider;
+
+/**
+ * The runtime component interface. Provides the bridge between the
+ * assembly model representation of a component and its runtime
+ * realization.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface RuntimeComponent extends Component {
+ /**
+ * Set the implementation-specific configuration for this component
+ * @param implementationProvider The object that manages the component implementation
+ */
+ void setImplementationProvider(ImplementationProvider implementationProvider);
+
+ /**
+ * Get the implementation-specific configuration for this component
+ * @return The implementation provider for this component
+ */
+ ImplementationProvider getImplementationProvider();
+
+ /**
+ * Get the associated component context
+ * @return
+ */
+ RuntimeComponentContext getComponentContext();
+
+ /**
+ * Set the associated component context
+ * @param context
+ */
+ void setComponentContext(RuntimeComponentContext context);
+
+ /**
+ * Tests if the RuntimeComponent is started
+ * @return true if the RuntimeComponent is started otherwise false
+ */
+ boolean isStarted();
+
+ /**
+ * Sets the RuntimeComponent started state
+ * @param started the state to set
+ */
+ void setStarted(boolean started);
+
+ /**
+ * Add a policy provider to the component
+ * @param policyProvider
+ */
+ void addPolicyProvider(PolicyProvider policyProvider);
+
+ /**
+ * Get a list of policy providers configured for this component
+ * @return
+ */
+ List<PolicyProvider> getPolicyProviders();
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java
new file mode 100644
index 0000000000..5f9ff4fa7e
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java
@@ -0,0 +1,87 @@
+/*
+ * 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 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;
+import org.oasisopen.sca.ServiceReference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface RuntimeComponentContext extends ComponentContext {
+ /**
+ * Activate the reference (creating runtime wires)
+ * @param reference
+ */
+ void start(RuntimeComponentReference reference);
+
+ /**
+ * Get the CallableReference for a given component reference
+ * @param <B>
+ * @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
+ */
+ <B> ServiceReference<B> getServiceReference(Class<B> businessInterface,
+ RuntimeComponentReference reference,
+ EndpointReference endpointReference);
+
+ /**
+ * Bind the reference to a target component/componentService
+ * @param <B>
+ * @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
+ */
+ <B> ServiceReference<B> getServiceReference(Class<B> businessInterface,
+ RuntimeComponentReference reference,
+ RuntimeComponent component,
+ RuntimeComponentService service);
+
+ /**
+ * Create a CallableReference for the given component service
+ * @param <B>
+ * @param businessInterface
+ * @param component
+ * @param service
+ * @return
+ */
+ <B> ServiceReference<B> getCallableReference(Class<B> businessInterface,
+ RuntimeComponent component,
+ RuntimeComponentService service);
+
+ /**
+ * @param <B>
+ * @param businessInterface
+ * @param service
+ * @return
+ */
+ <B> ServiceReference<B> createSelfReference(Class<B> businessInterface, ComponentService service);
+
+ ExtensionPointRegistry getExtensionPointRegistry();
+ CompositeContext getCompositeContext();
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java
new file mode 100644
index 0000000000..0105abd6e4
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java
@@ -0,0 +1,108 @@
+/*
+ * 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.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
+ * assembly model representation of a component reference and its runtime
+ * realization
+ *
+ * @version $Rev$ $Date$
+ */
+public interface RuntimeComponentReference extends ComponentReference {
+
+ /**
+ * Get a list of runtime wires to the reference
+ *
+ * @return The list of wires
+ */
+ List<RuntimeWire> 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<PolicyProvider> 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
+ */
+ void setComponent(RuntimeComponent component);
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java
new file mode 100644
index 0000000000..982724d798
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java
@@ -0,0 +1,138 @@
+/*
+ * 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.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
+ * assembly model representation of a component service and its runtime
+ * realization
+ *
+ * @version $Rev$ $Date$
+ */
+public interface RuntimeComponentService extends ComponentService {
+
+ /**
+ * Get a list of runtime wires to the service
+ *
+ * @return The list of wires
+ */
+ List<RuntimeWire> 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<RuntimeWire> 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<PolicyProvider> getPolicyProviders(Binding binding);
+
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java
new file mode 100644
index 0000000000..7000da9093
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java
@@ -0,0 +1,104 @@
+/*
+ * 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.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.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<InvocationChain> 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;
+
+ /**
+ * Attach the service binding provider
+ * @param provider
+ */
+ void setBindingProvider(ServiceBindingProvider provider);
+
+ /**
+ * Get the service binding provider
+ * @return
+ */
+ ServiceBindingProvider getBindingProvider();
+
+ /**
+ * Get a list of policy providers
+ * @return
+ */
+ List<PolicyProvider> getPolicyProviders();
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java
new file mode 100644
index 0000000000..86c808c0fb
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java
@@ -0,0 +1,104 @@
+/*
+ * 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.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.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<InvocationChain> 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;
+
+ /**
+ * Set the reference binding provider for the endpoint reference
+ * @param provider The binding provider
+ */
+ void setBindingProvider(ReferenceBindingProvider provider);
+
+ /**
+ * Get the reference binding provider for the endpoint reference
+ * @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
+ */
+ List<PolicyProvider> getPolicyProviders();
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java
new file mode 100644
index 0000000000..c0150c6138
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java
@@ -0,0 +1,114 @@
+/*
+ * 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<InvocationChain> 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/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java
new file mode 100644
index 0000000000..fbb7aae467
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.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.runtime;
+
+/**
+ * Implementations are called after wires are decorated with policy and before they are connected.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface RuntimeWireProcessor {
+
+ /**
+ * Process the runtime wire to add interceptors
+ *
+ * @param wire
+ */
+ void process(RuntimeWire wire);
+
+}
diff --git a/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java
new file mode 100644
index 0000000000..4b2c71b397
--- /dev/null
+++ b/tags/java/sca/2.0-M4-RC3/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java
@@ -0,0 +1,53 @@
+/*
+ * 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.util.List;
+
+/**
+ * Acts as a delegating <code>WireProcessorExtensionPoint</code>, delegating
+ * processing of wires after policies have been applied and source and targets
+ * have been connected.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface RuntimeWireProcessorExtensionPoint {
+
+ /**
+ * Registers a wire-processor in the runtime
+ *
+ * @param processor The processor to register
+ */
+ void addWireProcessor(RuntimeWireProcessor processor);
+
+ /**
+ * De-registers a wire-processor in the runtime
+ *
+ * @param processor The processor to de-register
+ */
+ void removeWireProcessor(RuntimeWireProcessor processor);
+
+ /**
+ * Returns a list of registered wire-processors.
+ *
+ * @return The list of wire processors
+ */
+ List<RuntimeWireProcessor> getWireProcessors();
+
+}