diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-19 00:08:11 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-19 00:08:11 +0000 |
commit | 994c753d4c4f224e7b93fa8dc6ae807367317678 (patch) | |
tree | ea4ce5ea2cdb66ffc4d60b1bf1d7786eb8c731f5 /java/sca/samples | |
parent | 400713c5c4c89dfcc7e77f502003af63e1098c15 (diff) |
Add SCANodeFactory/SCANode and rename the artifact ids from node2-xxx to node-xxx
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@686901 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/samples')
16 files changed, 49 insertions, 46 deletions
diff --git a/java/sca/samples/calculator-distributed/pom.xml b/java/sca/samples/calculator-distributed/pom.xml index 2ca8407957..a0f04d4a1a 100644 --- a/java/sca/samples/calculator-distributed/pom.xml +++ b/java/sca/samples/calculator-distributed/pom.xml @@ -39,13 +39,13 @@ <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node2-api</artifactId> + <artifactId>tuscany-node-api</artifactId> <version>1.4-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node2-launcher</artifactId> + <artifactId>tuscany-node-launcher</artifactId> <version>1.4-SNAPSHOT</version> </dependency> diff --git a/java/sca/samples/calculator-distributed/src/main/java/node/LaunchCalculatorNodeA.java b/java/sca/samples/calculator-distributed/src/main/java/node/LaunchCalculatorNodeA.java index 0025c85f79..3ff6c8969a 100644 --- a/java/sca/samples/calculator-distributed/src/main/java/node/LaunchCalculatorNodeA.java +++ b/java/sca/samples/calculator-distributed/src/main/java/node/LaunchCalculatorNodeA.java @@ -20,7 +20,7 @@ package node; import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode; import org.apache.tuscany.sca.node.launcher.NodeLauncher; import org.osoa.sca.ServiceRuntimeException; @@ -29,7 +29,7 @@ import calculator.CalculatorService; public class LaunchCalculatorNodeA { public static void main(String[] args) throws Exception { - SCANode2 node = null; + SCANode node = null; try { NodeLauncher nodeLauncher = NodeLauncher.newInstance(); diff --git a/java/sca/samples/calculator-distributed/src/test/java/calculator/CalculatorDistributedTestCase.java b/java/sca/samples/calculator-distributed/src/test/java/calculator/CalculatorDistributedTestCase.java index 9c3f06ee53..2a6f3af002 100644 --- a/java/sca/samples/calculator-distributed/src/test/java/calculator/CalculatorDistributedTestCase.java +++ b/java/sca/samples/calculator-distributed/src/test/java/calculator/CalculatorDistributedTestCase.java @@ -22,8 +22,8 @@ package calculator; import junit.framework.Assert;
import org.apache.tuscany.sca.node.SCAClient;
-import org.apache.tuscany.sca.node.SCANode2;
-import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
import org.apache.tuscany.sca.node.launcher.DomainManagerLauncher;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -35,10 +35,10 @@ import org.junit.Test; */
public class CalculatorDistributedTestCase {
- private static SCANode2 manager;
- private static SCANode2 nodeA;
- private static SCANode2 nodeB;
- private static SCANode2 nodeC;
+ private static SCANode manager;
+ private static SCANode nodeA;
+ private static SCANode nodeB;
+ private static SCANode nodeC;
private static CalculatorService calculatorService;
@@ -53,7 +53,7 @@ public class CalculatorDistributedTestCase { manager = managerLauncher.createDomainManager();
manager.start();
- SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
nodeC = nodeFactory.createSCANodeFromURL("http://localhost:9990/node-config/NodeC");
nodeB = nodeFactory.createSCANodeFromURL("http://localhost:9990/node-config/NodeB");
nodeA = nodeFactory.createSCANodeFromURL("http://localhost:9990/node-config/NodeA");
diff --git a/java/sca/samples/calculator/pom.xml b/java/sca/samples/calculator/pom.xml index df2f8d93dd..4a2216c2e9 100644 --- a/java/sca/samples/calculator/pom.xml +++ b/java/sca/samples/calculator/pom.xml @@ -38,13 +38,13 @@ <dependencies> <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node2-api</artifactId> + <artifactId>tuscany-node-api</artifactId> <version>1.4-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node2-impl</artifactId> + <artifactId>tuscany-node-impl</artifactId> <version>1.4-SNAPSHOT</version> <scope>runtime</scope> </dependency> diff --git a/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java index 6dc2cbbe6f..3b2966e96d 100644 --- a/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java +++ b/java/sca/samples/calculator/src/main/java/calculator/CalculatorClient.java @@ -20,8 +20,8 @@ package calculator; import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCANode2; -import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; /** * This client program shows how to create an SCA runtime, start it, @@ -30,8 +30,8 @@ import org.apache.tuscany.sca.node.SCANode2Factory; public class CalculatorClient { public static void main(String[] args) throws Exception { - SCANode2Factory factory = SCANode2Factory.newInstance(); - SCANode2 node = factory.createSCANodeFromClassLoader("Calculator.composite", CalculatorClient.class.getClassLoader()); + SCANodeFactory factory = SCANodeFactory.newInstance(); + SCANode node = factory.createSCANodeFromClassLoader("Calculator.composite", CalculatorClient.class.getClassLoader()); node.start(); CalculatorService calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); diff --git a/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java b/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java index a723af10c6..1b7476534a 100644 --- a/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java +++ b/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java @@ -21,8 +21,8 @@ package calculator; import junit.framework.TestCase; import org.apache.tuscany.sca.node.SCAClient; -import org.apache.tuscany.sca.node.SCANode2; -import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; /** * This shows how to test the Calculator service component. @@ -30,11 +30,11 @@ import org.apache.tuscany.sca.node.SCANode2Factory; public class CalculatorTestCase extends TestCase { private CalculatorService calculatorService; - private SCANode2 node; + private SCANode node; @Override protected void setUp() throws Exception { - SCANode2Factory factory = SCANode2Factory.newInstance(); + SCANodeFactory factory = SCANodeFactory.newInstance(); node = factory.createSCANodeFromClassLoader("Calculator.composite", getClass().getClassLoader()); node.start(); diff --git a/java/sca/samples/callback-ws-client/pom.xml b/java/sca/samples/callback-ws-client/pom.xml index 594ad10221..c45691febb 100644 --- a/java/sca/samples/callback-ws-client/pom.xml +++ b/java/sca/samples/callback-ws-client/pom.xml @@ -38,7 +38,7 @@ <dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node2-impl</artifactId>
+ <artifactId>tuscany-node-impl</artifactId>
<version>1.4-SNAPSHOT</version>
</dependency>
diff --git a/java/sca/samples/callback-ws-client/src/main/java/myapp/MyClientImpl.java b/java/sca/samples/callback-ws-client/src/main/java/myapp/MyClientImpl.java index 3d94973880..ece769236c 100644 --- a/java/sca/samples/callback-ws-client/src/main/java/myapp/MyClientImpl.java +++ b/java/sca/samples/callback-ws-client/src/main/java/myapp/MyClientImpl.java @@ -22,8 +22,8 @@ import myserver.MyService; import myserver.MyServiceCallback;
import org.apache.tuscany.sca.node.SCAClient;
-import org.apache.tuscany.sca.node.SCANode2;
-import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Scope;
import org.osoa.sca.annotations.Service;
@@ -49,14 +49,14 @@ public class MyClientImpl implements MyClient, MyServiceCallback { }
public static void main(String[] args) throws Exception {
- SCANode2 node = SCANode2Factory.newInstance().createSCANodeFromClassLoader("myapp.composite", MyClientImpl.class.getClassLoader());
+ SCANode node = SCANodeFactory.newInstance().createSCANodeFromClassLoader("myapp.composite", MyClientImpl.class.getClassLoader());
node.start();
run(node);
System.out.println("Closing the domain");
node.stop();
}
- public static void run(SCANode2 node) throws InterruptedException {
+ public static void run(SCANode node) throws InterruptedException {
MyClient myClient = ((SCAClient)node).getService(MyClient.class, "MyClientComponent");
myClient.aClientMethod();
Thread.sleep(5000); // don't exit before callback arrives
diff --git a/java/sca/samples/callback-ws-client/src/test/java/myapp/CallbackClientTestCase.java b/java/sca/samples/callback-ws-client/src/test/java/myapp/CallbackClientTestCase.java index f11b0adfe4..fb2f6952c4 100644 --- a/java/sca/samples/callback-ws-client/src/test/java/myapp/CallbackClientTestCase.java +++ b/java/sca/samples/callback-ws-client/src/test/java/myapp/CallbackClientTestCase.java @@ -18,8 +18,8 @@ */
package myapp;
-import org.apache.tuscany.sca.node.SCANode2;
-import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -29,12 +29,12 @@ import org.junit.Test; */
public class CallbackClientTestCase {
- private SCANode2 node;
+ private SCANode node;
@Before
public void startServer() throws Exception {
try {
- node = SCANode2Factory.newInstance().createSCANodeFromClassLoader(null, getClass().getClassLoader());
+ node = SCANodeFactory.newInstance().createSCANodeFromClassLoader(null, getClass().getClassLoader());
node.start();
} catch (Exception ex) {
System.out.println(ex.toString());
diff --git a/java/sca/samples/callback-ws-service/pom.xml b/java/sca/samples/callback-ws-service/pom.xml index 4036b3237a..789f981d49 100644 --- a/java/sca/samples/callback-ws-service/pom.xml +++ b/java/sca/samples/callback-ws-service/pom.xml @@ -38,7 +38,7 @@ <dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node2-impl</artifactId>
+ <artifactId>tuscany-node-impl</artifactId>
<version>1.4-SNAPSHOT</version>
</dependency>
diff --git a/java/sca/samples/callback-ws-service/src/main/java/myserver/CallbackServer.java b/java/sca/samples/callback-ws-service/src/main/java/myserver/CallbackServer.java index 9dfead61db..75ef05bc48 100644 --- a/java/sca/samples/callback-ws-service/src/main/java/myserver/CallbackServer.java +++ b/java/sca/samples/callback-ws-service/src/main/java/myserver/CallbackServer.java @@ -20,8 +20,8 @@ package myserver; import java.io.IOException;
-import org.apache.tuscany.sca.node.SCANode2;
-import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
/**
* This server program shows how to create and start an SCA runtime that
@@ -31,7 +31,7 @@ public class CallbackServer { public static void main(String[] args) throws Exception {
- SCANode2 node = SCANode2Factory.newInstance().createSCANodeFromClassLoader("callbackws.composite", null);
+ SCANode node = SCANodeFactory.newInstance().createSCANodeFromClassLoader("callbackws.composite", null);
node.start();
try {
diff --git a/java/sca/samples/callback-ws-service/src/test/java/myserver/CallbackServerTestCase.java b/java/sca/samples/callback-ws-service/src/test/java/myserver/CallbackServerTestCase.java index 4208f7f6b5..e87667cc3e 100644 --- a/java/sca/samples/callback-ws-service/src/test/java/myserver/CallbackServerTestCase.java +++ b/java/sca/samples/callback-ws-service/src/test/java/myserver/CallbackServerTestCase.java @@ -21,8 +21,8 @@ package myserver; import java.io.IOException;
import java.net.Socket;
-import org.apache.tuscany.sca.node.SCANode2;
-import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -32,11 +32,11 @@ import org.junit.Test; */
public class CallbackServerTestCase {
- private SCANode2 node;
+ private SCANode node;
@Before
public void startServer() throws Exception {
- node = SCANode2Factory.newInstance().createSCANodeFromClassLoader("callbackws.composite", null);
+ node = SCANodeFactory.newInstance().createSCANodeFromClassLoader("callbackws.composite", null);
node.start();
}
diff --git a/java/sca/samples/customer-dojo/build-dependency.xml b/java/sca/samples/customer-dojo/build-dependency.xml index 8b59283e03..789fa97324 100644 --- a/java/sca/samples/customer-dojo/build-dependency.xml +++ b/java/sca/samples/customer-dojo/build-dependency.xml @@ -49,6 +49,7 @@ <include name="tuscany-implementation-java-1.4-SNAPSHOT.jar"/> <include name="tuscany-implementation-java-runtime-1.4-SNAPSHOT.jar"/> <include name="tuscany-implementation-java-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-node-1.4-SNAPSHOT.jar"/> <include name="tuscany-implementation-resource-1.4-SNAPSHOT.jar"/> <include name="tuscany-implementation-resource-runtime-1.4-SNAPSHOT.jar"/> <include name="tuscany-interface-1.4-SNAPSHOT.jar"/> @@ -56,6 +57,8 @@ <include name="tuscany-interface-java-jaxws-1.4-SNAPSHOT.jar"/> <include name="tuscany-interface-java-xml-1.4-SNAPSHOT.jar"/> <include name="tuscany-monitor-1.4-SNAPSHOT.jar"/> + <include name="tuscany-node2-api-1.4-SNAPSHOT.jar"/> + <include name="tuscany-node2-impl-1.4-SNAPSHOT.jar"/> <include name="tuscany-policy-1.4-SNAPSHOT.jar"/> <include name="tuscany-policy-xml-1.4-SNAPSHOT.jar"/> <include name="tuscany-sca-api-1.4-SNAPSHOT.jar"/> diff --git a/java/sca/samples/domain-management/pom.xml b/java/sca/samples/domain-management/pom.xml index d674decbce..781f77285a 100644 --- a/java/sca/samples/domain-management/pom.xml +++ b/java/sca/samples/domain-management/pom.xml @@ -86,13 +86,13 @@ <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node2-launcher</artifactId> + <artifactId>tuscany-node-launcher</artifactId> <version>1.4-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node2-api</artifactId> + <artifactId>tuscany-node-api</artifactId> <version>1.4-SNAPSHOT</version> </dependency> diff --git a/java/sca/samples/domain-management/src/main/java/manager/DistributeAndRunComponents.java b/java/sca/samples/domain-management/src/main/java/manager/DistributeAndRunComponents.java index 7981cdb5c6..380d501ab5 100644 --- a/java/sca/samples/domain-management/src/main/java/manager/DistributeAndRunComponents.java +++ b/java/sca/samples/domain-management/src/main/java/manager/DistributeAndRunComponents.java @@ -71,7 +71,7 @@ import org.apache.tuscany.sca.implementation.node.builder.impl.NodeCompositeBuil import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.MonitorFactory; -import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode; import org.apache.tuscany.sca.node.launcher.NodeLauncher; import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory; import org.apache.tuscany.sca.workspace.Workspace; @@ -260,7 +260,7 @@ public class DistributeAndRunComponents { System.out.println(print(domainComposite)); // Now start our SCA nodes - List<SCANode2> runtimeNodes = new ArrayList<SCANode2>(); + List<SCANode> runtimeNodes = new ArrayList<SCANode>(); NodeLauncher launcher = NodeLauncher.newInstance(); for (Component node: cloudComposite.getComponents()) { @@ -286,7 +286,7 @@ public class DistributeAndRunComponents { Contribution dependency = dependencies.get(c); contributions[c] = new org.apache.tuscany.sca.node.launcher.Contribution(dependency.getURI(), dependency.getLocation()); } - SCANode2 runtimeNode = launcher.createNode("http://sample/" + node.getName(), print(runnable), contributions); + SCANode runtimeNode = launcher.createNode("http://sample/" + node.getName(), print(runnable), contributions); // Start the node runtimeNode.start(); @@ -296,7 +296,7 @@ public class DistributeAndRunComponents { System.out.println("Nodes are running, press enter to stop..."); System.in.read(); - for (SCANode2 runtimeNode: runtimeNodes) { + for (SCANode runtimeNode: runtimeNodes) { runtimeNode.stop(); } } diff --git a/java/sca/samples/store-distributed/pom.xml b/java/sca/samples/store-distributed/pom.xml index 5d2256b362..1cd493807e 100644 --- a/java/sca/samples/store-distributed/pom.xml +++ b/java/sca/samples/store-distributed/pom.xml @@ -39,13 +39,13 @@ <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node2-api</artifactId> + <artifactId>tuscany-node-api</artifactId> <version>1.4-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node2-launcher</artifactId> + <artifactId>tuscany-node-launcher</artifactId> <version>1.4-SNAPSHOT</version> </dependency> |