summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-04-07 13:16:58 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-04-07 13:16:58 +0000
commit327ea2366e59054d98ba533403c69f7721989f3d (patch)
tree512248acf4a5517f415db16cc683a7e2d84d77d4
parent084d3e5e0936b31a0d81c65144cace58948bc9be (diff)
Initial support for the SCAClient API, probably better ways we can do this but this is the simplest way to get it working as a starting point
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@762760 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java9
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCAClientFactoryImpl.java34
-rw-r--r--java/sca/modules/node-impl/src/main/resources/META-INF/services/org.oasisopen.sca.client.SCAClientFactory1
3 files changed, 43 insertions, 1 deletions
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
index edd1dd9d3f..f874da80a1 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
@@ -95,8 +95,11 @@ import org.apache.tuscany.sca.workspace.WorkspaceFactory;
import org.apache.tuscany.sca.workspace.builder.ContributionBuilder;
import org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint;
import org.oasisopen.sca.CallableReference;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
import org.oasisopen.sca.ServiceReference;
import org.oasisopen.sca.ServiceRuntimeException;
+import org.oasisopen.sca.client.SCAClient;
/**
@@ -104,7 +107,7 @@ import org.oasisopen.sca.ServiceRuntimeException;
*
* @version $Rev$ $Date$
*/
-public class NodeImpl implements Node, Client {
+public class NodeImpl implements Node, Client, SCAClient {
private static final String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
@@ -766,4 +769,8 @@ public class NodeImpl implements Node, Client {
public ExtensionPointRegistry getExtensionPoints() {
return extensionPoints;
}
+
+ public <T> T getService(Class<T> businessInterface, String serviceName, URI domainURI) throws NoSuchServiceException, NoSuchDomainException {
+ return getService(businessInterface, serviceName);
+ }
}
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCAClientFactoryImpl.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCAClientFactoryImpl.java
new file mode 100644
index 0000000000..99bbe9423d
--- /dev/null
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCAClientFactoryImpl.java
@@ -0,0 +1,34 @@
+/*
+ * 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.node.impl;
+
+import org.oasisopen.sca.client.SCAClient;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+public class SCAClientFactoryImpl extends SCAClientFactory {
+
+ @Override
+ protected SCAClient createSCAClient() {
+ NodeImpl nodeImpl = new NodeImpl();
+ nodeImpl.start();
+ return nodeImpl;
+ }
+
+}
diff --git a/java/sca/modules/node-impl/src/main/resources/META-INF/services/org.oasisopen.sca.client.SCAClientFactory b/java/sca/modules/node-impl/src/main/resources/META-INF/services/org.oasisopen.sca.client.SCAClientFactory
new file mode 100644
index 0000000000..698f01330d
--- /dev/null
+++ b/java/sca/modules/node-impl/src/main/resources/META-INF/services/org.oasisopen.sca.client.SCAClientFactory
@@ -0,0 +1 @@
+org.apache.tuscany.sca.node.impl.SCAClientFactoryImpl