summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/core-spi
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-10-09 19:59:43 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-10-09 19:59:43 +0000
commit681e195552e16021ebba42fcf56bad2aa6fddc67 (patch)
tree156e2714fa1584ff3e3a989359b78b51f2ff78ea /java/sca/modules/core-spi
parente2a82e1954ef1ac97c26d4f6bca4184494b541b9 (diff)
Refactor the runtime build logic into EndpointReferenceBinder
Refactor the endpoint-wrapper into domainRegistryFactory that delegates to endpoint registry implementations by the scheme Improve/workaround the monitor so that it can be shared by multiple nodes (We need a better design for this) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@823672 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/core-spi')
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java7
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java12
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java46
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java42
4 files changed, 103 insertions, 4 deletions
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 942f3bca78..a805985a11 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
@@ -21,6 +21,7 @@ package org.apache.tuscany.sca.context;
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.invocation.Message;
import org.apache.tuscany.sca.runtime.EndpointRegistry;
@@ -66,6 +67,12 @@ public abstract class CompositeContext {
* @param runtimeComponent
*/
public abstract void bindComponent(RuntimeComponent runtimeComponent);
+
+ /**
+ *
+ * @param endpointReference
+ */
+ public abstract void bindEndpointReference(EndpointReference endpointReference);
/**
* Get the ExtensionPointRegistry for this node
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java
index 3631684a54..f4e18f60cc 100644
--- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java
+++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java
@@ -31,30 +31,34 @@ import org.apache.tuscany.sca.context.CompositeContext;
public interface CompositeActivator {
/**
* Activate a composite
+ * @param compositeContext The context of the Node
* @param composite
*/
- void activate(Composite composite) throws ActivationException;
+ 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(RuntimeComponent component, RuntimeComponentReference 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(RuntimeComponent component, RuntimeComponentReference 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(RuntimeComponent component, RuntimeComponentService service);
+ void activate(CompositeContext compositeContext, RuntimeComponent component, RuntimeComponentService service);
/**
* De-activate a component reference
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java
new file mode 100644
index 0000000000..7b71406ac6
--- /dev/null
+++ b/java/sca/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/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java
new file mode 100644
index 0000000000..78a0e19f10
--- /dev/null
+++ b/java/sca/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);
+}