diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:26:33 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:26:33 +0000 |
commit | a40e527938d76ba71f211da7e327adb50384ba69 (patch) | |
tree | cb8f99f1727122b040a3f0fbb6649292b6a74302 /sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main | |
parent | 968721109881107520d7aefa91d7fcc0519d7739 (diff) |
Moving 1.x tags
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835157 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main')
9 files changed, 518 insertions, 0 deletions
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/domain/DistributedSCADomain.java b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/domain/DistributedSCADomain.java new file mode 100644 index 0000000000..8ebaac82e1 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/domain/DistributedSCADomain.java @@ -0,0 +1,70 @@ +/*
+ * 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.distributed.domain;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.distributed.management.ServiceDiscovery;
+
+
+/**
+ * A local representation of the sca domain distributed across a number
+ * of separate nodes. This provides access to various information relating
+ * to the distributed domain
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+public abstract interface DistributedSCADomain {
+
+ /**
+ * Returns the name of the node that this part of the
+ * distributed domain is running on
+ *
+ * @return the node name
+ */
+ public abstract String getNodeName();
+ public abstract void setNodeName(String nodeName);
+
+ /**
+ * Returns the name of the distributed domain that this node
+ * is part of.
+ *
+ * @return the domain name
+ */
+ public abstract String getDomainName();
+ public abstract void setDomainName(String domainName);
+
+ /**
+ * Associates this distributed domain representation to all of the
+ * sca binding objects within a composite. The sca binding uses this
+ * distributed domain representation for domain level operations like
+ * find the enpoints of remote services.
+ *
+ * @param composite the composite that this object will be added to
+ */
+ public void addDistributedDomainToBindings(Composite composite);
+
+ /**
+ * Return an interface for registering and looking up remote services
+ *
+ * @return The service discovery interface
+ */
+ public abstract ServiceDiscovery getServiceDiscovery();
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/BaseUriMap.java b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/BaseUriMap.java new file mode 100644 index 0000000000..01d81df6d4 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/BaseUriMap.java @@ -0,0 +1,51 @@ +/*
+ * 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.distributed.management;
+
+
+/**
+ * Represents the mapping between protocols and baseuris for a given domain
+ * on a node
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+public interface BaseUriMap {
+
+ /**
+ * Sets the name of the node that is responsible for running
+ * the named component
+ *
+ * @param domainUri the string uri for the parent domain
+ * @param nodeUri the string uri for the node where the component will run
+ * @Param protocol the protocol that the uri represent, e.g. http or https
+ */
+ public void setBaseUri(String domainUri, String nodeUri, String protocol, String uri);
+
+ /**
+ * Sets the name of the node that is responsible for running
+ * the named component
+ *
+ * @param domainUri the string uri for the parent domain
+ * @param nodeUri the string uri for the node where the component will run
+ * @Param protocol the protocol that the uri represent, e.g. http or https
+ */
+ public String getBaseUri(String domainUri, String nodeUri, String protocol);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ComponentManager.java b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ComponentManager.java new file mode 100644 index 0000000000..e86f20badf --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ComponentManager.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.distributed.management;
+
+
+/**
+ * A management interface for components in the distributed domain
+ *
+ * TODO - a minimum interface and closely related to
+ * o.a.t.s.host.embedded.management.ComponentManager
+ * so we need to see how this works out
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+public interface ComponentManager {
+
+ /**
+ * Starts a named component
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the node
+ * @param componentName the name of the component to be started
+ */
+ public void startComponent(String domainUri, String nodeUri, String componentName);
+
+
+ /**
+ * Stops a named component
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the node
+ * @param componentName the name of the component to be started
+ */
+ public void stopComponent(String domainUri, String nodeUri, String componentName);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ComponentMap.java b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ComponentMap.java new file mode 100644 index 0000000000..a7b6b72b42 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ComponentMap.java @@ -0,0 +1,60 @@ +/*
+ * 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.distributed.management;
+
+import java.util.List;
+
+
+/**
+ * Represents the mapping between components and runtime nodes.
+ *
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+public interface ComponentMap {
+
+ /**
+ * Sets the name of the node that is responsible for running
+ * the named component
+ *
+ * @param domainUri the string uri for the parent domain
+ * @param nodeUri the string uri for the node where the component will run
+ * @param componentName the string name for the component of interest
+ */
+ public void addComponent(String domainUri, String nodeUri, String componentName );
+
+ /**
+ * Removes the named component from the map
+ *
+ * @param domainUri the string uri for the parent domain
+ * @param nodeUri the string uri for the node where the component will run
+ * @param componentName the string name for the component of interest
+ */
+ public void removeComponent(String domainUri, String nodeUri, String componentName);
+
+ /**
+ * Return the names of all components that will run on the specified node
+ *
+ * @param domainUri the string uri for the parent domain
+ * @param nodeUri the string uri for the node where the component will run
+ * @return
+ */
+ public List<String> getComponentsForNode(String domainUri, String nodeUri);
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ContributionManager.java b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ContributionManager.java new file mode 100644 index 0000000000..374f8a046b --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ContributionManager.java @@ -0,0 +1,51 @@ +/*
+ * 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.distributed.management;
+
+
+/**
+ * A management interface for contributions in the distributed domain
+ *
+ * TODO - it's not clear what the level of granularity of contribution updates
+ * will be finaly in Tuscany as this aspect is still being implemented
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+public interface ContributionManager {
+
+ /**
+ * Accepts a new contribution and passes it onto the domain implementation
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the node
+ * @param contributionUri the string uri for the contribution to be added
+ */
+ public void addContribution(String domainUri, String nodeUri, String contributionUri);
+
+ /**
+ * Removes the specified contribution from the domain
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the node
+ * @param contributionUri the string uri for the contribution to be removed
+ */
+ public void removeContribution(String domainUri, String nodeUri, String contributionUri);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/DistributedDomainManager.java b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/DistributedDomainManager.java new file mode 100644 index 0000000000..aa3c472c9e --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/DistributedDomainManager.java @@ -0,0 +1,60 @@ +/*
+ * 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.distributed.management;
+
+import org.osoa.sca.annotations.Remotable;
+
+
+/**
+ * The management interface for distributed domain. This is resposible for
+ * creating appropriate configuration on all the nodes that are running
+ * domain nodes for the distributed domain.
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+@Remotable
+public interface DistributedDomainManager {
+
+ /**
+ * A node registers with the distributed domain manager. The mechanism whereby this
+ * registration interface is discovered is not defined. For example, JMS, JINI
+ * or a hard coded configuration could all be candidates in the java world.
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the current node
+ * @param nodeManagementUrl the endpoint for the nodes management service
+ */
+ public void registerNode(String domainUri, String nodeUri, String nodeManagementUrl);
+
+ /**
+ * Retrieve the configuration for the specified node. The return type is interesting
+ * here. There are many ways in which all of the information that comprises a
+ * configuration can be provisioned onto a node, for example, shared file system,
+ * ftp, http. The return value is the url of where to look for the configuration
+ * information. From a management point of view it is convenient to maintain all
+ * current and previous node configurations. This can easily be achieved by providing
+ * a different URL each time the configuration is changed.
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the current node
+ * @return the URL from where the configuration can be retrieved
+ */
+ public String getDomainNodeConfiguration(String domainUri, String nodeUri);
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/DomainNodeManager.java b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/DomainNodeManager.java new file mode 100644 index 0000000000..9654ba7914 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/DomainNodeManager.java @@ -0,0 +1,56 @@ +/*
+ * 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.distributed.management;
+
+
+/**
+ * The management interface for the part of the distributed domain that
+ * runs on a node
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+public interface DomainNodeManager {
+
+ /**
+ * Creates the internal structures to represent the distributed domain on this
+ * node
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the current node
+ */
+ public void createDomainNode(String domainUri, String nodeUri);
+
+ /**
+ * Starts the domain running on the current node
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the current node
+ */
+ public void startDomainNode(String domainUri, String nodeUri);
+
+ /**
+ * Stops the running domain on the current node
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the current node
+ */
+ public void stopDomainNode(String domainUri, String nodeUri);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/NodeManager.java b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/NodeManager.java new file mode 100644 index 0000000000..44abb3ad21 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/NodeManager.java @@ -0,0 +1,61 @@ +/*
+ * 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.distributed.management;
+
+
+/**
+ * The management interface for a node
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+public interface NodeManager {
+
+ /**
+ * Starts the node and assigns a uri to the node. For covenience this
+ * uri should be the URL of the service that provides this interface
+ *
+ * @param nodeUri the string uri for the current node
+ */
+ public void start(String nodeUri);
+
+ /**
+ * Starts the node running
+ *
+ */
+ public void stop();
+
+ /**
+ * The node joins the distributed domain specified by the
+ * domainUri.
+ *
+ * @param domainUri the string uri for the distributed domain
+ */
+ public void joinDomain(String domainUri);
+
+ /**
+ * The configuration of a domain running on this node has changed.
+ * It is the responsibility of the node to respond to this and retrieve
+ * any relevent configuration changes
+ *
+ * @param domainUri the string uri for the distributed domain
+ */
+ public void domainNodeConfigurationChange(String domainUri);
+
+}
diff --git a/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ServiceDiscovery.java b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ServiceDiscovery.java new file mode 100644 index 0000000000..b2a9e6fa57 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/distributed/src/main/java/org/apache/tuscany/sca/distributed/management/ServiceDiscovery.java @@ -0,0 +1,56 @@ +/*
+ * 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.distributed.management;
+
+import org.osoa.sca.annotations.Remotable;
+
+
+/**
+ * Provides a mechanism whereby service enoints can be shared amongst the
+ * nodes of a distributed domain.
+ *
+ * @version $Rev: 552343 $ $Date: 2007-07-01 18:43:40 +0100 (Sun, 01 Jul 2007) $
+ */
+@Remotable
+public interface ServiceDiscovery {
+
+ /**
+ * Accepts information about a service endpoint and holds onto it
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the current node
+ * @param serviceName the name of the service that is exposed and the provided endpoint
+ * @param bindingName the remote binding that is providing the endpoint
+ * @param url the enpoint url
+ * @return TBD - information about the registration
+ */
+ public String registerServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName, String URL);
+
+ /**
+ * Locates information about a service endpoint
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param serviceName the name of the service that is exposed and the provided endpoint
+ * @param bindingName the remote binding that we want to find an endpoint for
+ * @return url the endpoint url
+ */
+ public String findServiceEndpoint(String domainUri, String serviceName, String bindingName);
+
+}
|