summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core-spi/src/main/java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-02-09 21:20:45 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-02-09 21:20:45 +0000
commit6c51c6d6f32b9972ed825f1444309212f9d99a21 (patch)
tree8acdefe3ff30f2336d73aafb59a2651e0dd4f026 /sca-java-2.x/trunk/modules/core-spi/src/main/java
parentbee47a62dc7805d7cfd71ee379ebc29519268c4e (diff)
Start to clean up the node-api (remove Node.destroy())
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@908233 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core-spi/src/main/java')
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java2
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java70
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java20
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactoryExtensionPoint.java13
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryURI.java (renamed from sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/TuscanyURI.java)4
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java2
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java2
7 files changed, 96 insertions, 17 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
index 8cea5e1423..d45631d576 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
@@ -199,7 +199,7 @@ public abstract class BaseEndpointRegistry implements EndpointRegistry, LifeCycl
listeners.remove(listener);
}
- public String getDomainName() {
+ public String getDomainURI() {
return domainURI;
}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java
index f4e18f60cc..d9bdc2b6f6 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/CompositeActivator.java
@@ -42,14 +42,6 @@ public interface CompositeActivator {
* @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);
/**
@@ -59,7 +51,7 @@ public interface CompositeActivator {
* @param ref
*/
void activate(CompositeContext compositeContext, RuntimeComponent component, RuntimeComponentService service);
-
+
/**
* De-activate a component reference
* @param component
@@ -81,6 +73,15 @@ public interface CompositeActivator {
void deactivate(Composite composite) throws ActivationException;
/**
+ * Start a component reference
+ * @param compositeContext The context of the Node
+ * @param component
+ * @param ref
+ */
+ void start(CompositeContext compositeContext, RuntimeComponent component, RuntimeComponentReference ref);
+
+
+ /**
* Start a component
* @param component
*/
@@ -104,4 +105,55 @@ public interface CompositeActivator {
*/
void stop(CompositeContext compositeContext, Composite composite) throws ActivationException;
+ /**
+ * Activate an endpoint
+ * @param compositeContext
+ * @param endpoint
+ */
+ void activate(CompositeContext compositeContext, RuntimeEndpoint endpoint);
+
+ /**
+ * Activate an endpoint reference
+ * @param compositeContext
+ * @param endpointReference
+ */
+ void activate(CompositeContext compositeContext, RuntimeEndpointReference endpointReference);
+
+ /**
+ * Deactivate an endpoint
+ * @param endpoint
+ */
+ void deactivate(RuntimeEndpoint endpoint);
+
+ /**
+ * Deactivate an endpoint reference
+ * @param endpointReference
+ */
+ void deactivate(RuntimeEndpointReference endpointReference);
+
+ /**
+ * Start an endpoint
+ * @param compositeContext
+ * @param endpoint
+ */
+ void start(CompositeContext compositeContext, RuntimeEndpoint endpoint);
+
+ /**
+ * Start an endpoint reference
+ * @param compositeContext
+ * @param endpointReference
+ */
+ void start(CompositeContext compositeContext, RuntimeEndpointReference endpointReference);
+
+ /**
+ * Stop an endpoint
+ * @param endpoint
+ */
+ void stop(RuntimeEndpoint endpoint);
+
+ /**
+ * Stop an endpoint reference
+ * @param endpointReference
+ */
+ void stop(RuntimeEndpointReference endpointReference);
}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java
index bd97a525c0..c79fab1f47 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactory.java
@@ -22,7 +22,8 @@ package org.apache.tuscany.sca.runtime;
import java.util.Collection;
/**
- *
+ * A DomainRegistryFactory is responsible for creating an instance of the DomainRegistry for a given
+ * registry URI and domain URI
*/
public interface DomainRegistryFactory {
/**
@@ -33,13 +34,28 @@ public interface DomainRegistryFactory {
* @return
*/
EndpointRegistry getEndpointRegistry(String endpointRegistryURI, String domainURI);
-
+
/**
* Return all active endpoint registries
* @return
*/
Collection<EndpointRegistry> getEndpointRegistries();
+
+ /**
+ * Add an EndpointListener
+ * @param listener
+ */
void addListener(EndpointListener listener);
+
+ /**
+ * Remove an EndpointListener
+ * @param listener
+ */
void removeListener(EndpointListener listener);
+
+ /**
+ * Return an array of schemes that this factory supports
+ * @return
+ */
String[] getSupportedSchemes();
}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactoryExtensionPoint.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactoryExtensionPoint.java
index 4b823c0e7d..a373402db4 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactoryExtensionPoint.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryFactoryExtensionPoint.java
@@ -22,12 +22,23 @@ package org.apache.tuscany.sca.runtime;
import java.util.List;
/**
- *
+ * Extension point for DomainRegistryFactory
*/
public interface DomainRegistryFactoryExtensionPoint {
+ /**
+ * Add a DomainRegistryFactory
+ * @param factory
+ */
void addDomainRegistryFactory(DomainRegistryFactory factory);
+ /**
+ * Remove a DomainRegistryFactory
+ * @param factory
+ */
void removeDomainRegistryFactory(DomainRegistryFactory factory);
+ /**
+ * @return A list of DomainRegistryFactory
+ */
List<DomainRegistryFactory> getDomainRegistryFactories();
}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/TuscanyURI.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryURI.java
index 2bb22ad634..74e5d431ca 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/TuscanyURI.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DomainRegistryURI.java
@@ -39,7 +39,7 @@ import java.util.Map;
* remotes - a list of ipAddress:port for remote nodes
*
*/
-public class TuscanyURI {
+public class DomainRegistryURI {
private String domainName = "default";
private String bindAddress = null; // null means all network adapters
@@ -51,7 +51,7 @@ public class TuscanyURI {
private List<String> remotes = new ArrayList<String>();
private String uri;
- public TuscanyURI(String uri) {
+ public DomainRegistryURI(String uri) {
this.uri = uri;
parseURI(uri);
}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
index 0c0c0f2b0e..43388c612a 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
@@ -66,5 +66,5 @@ public interface EndpointRegistry {
void addListener(EndpointListener listener);
void removeListener(EndpointListener listener);
- String getDomainName();
+ String getDomainURI();
}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java
index 62ba7cce8d..7b96903dae 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ExtensibleDomainRegistry.java
@@ -68,7 +68,7 @@ public class ExtensibleDomainRegistry implements DomainRegistryFactory {
// See if there is a previously created registry for that domain
for (DomainRegistryFactory factory : factories.getDomainRegistryFactories()) {
for (EndpointRegistry endpointRegistry : factory.getEndpointRegistries()) {
- if (endpointRegistry.getDomainName().equals(domainURI)) {
+ if (endpointRegistry.getDomainURI().equals(domainURI)) {
return endpointRegistry;
}
}