summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/binding-rmi/pom.xml16
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java138
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingActivator.java58
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java31
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingFactoryImpl.java34
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingImpl.java109
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingProviderFactory.java62
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java (renamed from java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvokerFactory.java)31
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceInvoker.java (renamed from java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvoker.java)2
-rw-r--r--java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java (renamed from java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java)18
-rw-r--r--java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rmi.RMIBindingFactory (renamed from java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator)37
-rw-r--r--java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--java/sca/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java13
14 files changed, 415 insertions, 172 deletions
diff --git a/java/sca/modules/binding-rmi/pom.xml b/java/sca/modules/binding-rmi/pom.xml
index 44b4ded5b4..5f96169522 100644
--- a/java/sca/modules/binding-rmi/pom.xml
+++ b/java/sca/modules/binding-rmi/pom.xml
@@ -32,7 +32,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extension-helper</artifactId>
+ <artifactId>tuscany-core-spi</artifactId>
<version>1.4-SNAPSHOT</version>
</dependency>
@@ -41,6 +41,12 @@
<artifactId>tuscany-host-rmi</artifactId>
<version>1.4-SNAPSHOT</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>cglib</groupId>
@@ -50,6 +56,14 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-java-runtime</artifactId>
<version>1.4-SNAPSHOT</version>
<scope>test</scope>
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java
index 906e0df652..4ef3822b5b 100644
--- a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java
+++ b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java
@@ -1,77 +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.binding.rmi;
-
-import org.apache.tuscany.sca.extension.helper.utils.AbstractBinding;
-
-/**
- * Represents a binding to an RMI service.
- *
- * @version $Rev$ $Date$
- */
-public class RMIBinding extends AbstractBinding {
-
- private String host;
- private String port;
- private String serviceName;
-
- /**
- * @return the host name of the RMI Service
- */
- public String getHost() {
- return host;
- }
-
- /**
- * @param rmiHostName the hostname of the RMI Service
- */
- public void setHost(String rmiHostName) {
- this.host = rmiHostName;
- }
-
- /**
- * @return the port number for the RMI Service
- */
- public String getPort() {
- return port;
- }
-
- /**
- * @param rmiPort the port number for the RMI Service
- */
- public void setPort(String rmiPort) {
- this.port = rmiPort;
- }
-
- /**
- * @return returns the RMI Service Name
- */
- public String getServiceName() {
- return serviceName;
- }
-
- /**
- * Sets the service name for the RMI Server
- *
- * @param rmiServiceName the name of the RMI service
- */
- public void setServiceName(String rmiServiceName) {
- this.serviceName = rmiServiceName;
- }
-}
+/*
+ * 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.binding.rmi;
+
+import org.apache.tuscany.sca.assembly.Binding;
+
+/**
+ * RMI Binding model
+ */
+public interface RMIBinding extends Binding {
+
+ /**
+ * @return the host name of the RMI Service
+ */
+ String getHost();
+
+ /**
+ * @return the port number for the RMI Service
+ */
+ String getPort();
+
+ /**
+ * @return returns the RMI Service Name
+ */
+ String getServiceName();
+
+ /**
+ * @param rmiHostName the hostname of the RMI Service
+ */
+ void setHost(String rmiHostName);
+
+ /**
+ * @param rmiPort the port number for the RMI Service
+ */
+ void setPort(String rmiPort);
+
+ /**
+ * Sets the service name for the RMI Server
+ *
+ * @param rmiServiceName the name of the RMI service
+ */
+ void setServiceName(String rmiServiceName);
+
+}
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingActivator.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingActivator.java
deleted file mode 100644
index 1be70f57f7..0000000000
--- a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingActivator.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.binding.rmi;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.extension.helper.BindingActivator;
-import org.apache.tuscany.sca.extension.helper.ComponentLifecycle;
-import org.apache.tuscany.sca.extension.helper.InvokerFactory;
-import org.apache.tuscany.sca.host.rmi.ExtensibleRMIHost;
-import org.apache.tuscany.sca.host.rmi.RMIHost;
-import org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Binding Activator for the RMI Binding.
- *
- * @version $Rev$ $Date$
- */
-public class RMIBindingActivator implements BindingActivator<RMIBinding> {
-
- private RMIHost rmiHost;
-
- public RMIBindingActivator(RMIHostExtensionPoint rmiHosts) {
- this.rmiHost = new ExtensibleRMIHost(rmiHosts);
- }
-
- public Class<RMIBinding> getBindingClass() {
- return RMIBinding.class;
- }
-
- public InvokerFactory createInvokerFactory(RuntimeComponent rc, RuntimeComponentReference rcr, Binding b, RMIBinding binding) {
- return new RMIReferenceInvokerFactory(rc, rcr, binding, rmiHost);
- }
-
- public ComponentLifecycle createService(RuntimeComponent rc, RuntimeComponentService rcs, Binding b, RMIBinding binding) {
- return new RMIService(rc, rcs, binding, rmiHost);
- }
-
-}
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java
new file mode 100644
index 0000000000..ecfd45def3
--- /dev/null
+++ b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java
@@ -0,0 +1,31 @@
+/*
+ * 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.binding.rmi;
+
+/**
+ * Factory to create RMIBinding instances
+ */
+public interface RMIBindingFactory {
+ /**
+ * Create RMIBinding model
+ * @return
+ */
+ RMIBinding createRMIBinding();
+}
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingFactoryImpl.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingFactoryImpl.java
new file mode 100644
index 0000000000..547fc633a8
--- /dev/null
+++ b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingFactoryImpl.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.binding.rmi.impl;
+
+import org.apache.tuscany.sca.binding.rmi.RMIBinding;
+import org.apache.tuscany.sca.binding.rmi.RMIBindingFactory;
+
+/**
+ *
+ */
+public class RMIBindingFactoryImpl implements RMIBindingFactory {
+ public RMIBinding createRMIBinding() {
+ // TODO Auto-generated method stub
+ return new RMIBindingImpl();
+ }
+
+}
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingImpl.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingImpl.java
new file mode 100644
index 0000000000..daf6ea6291
--- /dev/null
+++ b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingImpl.java
@@ -0,0 +1,109 @@
+/*
+ * 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.binding.rmi.impl;
+
+import org.apache.tuscany.sca.binding.rmi.RMIBinding;
+
+/**
+ * Represents a binding to an RMI service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RMIBindingImpl implements RMIBinding {
+ private String name;
+ private String uri;
+ private String host;
+ private String port;
+ private String serviceName;
+
+ /**
+ * @return the host name of the RMI Service
+ */
+ public String getHost() {
+ return host;
+ }
+
+ /**
+ * @param rmiHostName the hostname of the RMI Service
+ */
+ public void setHost(String rmiHostName) {
+ this.host = rmiHostName;
+ }
+
+ /**
+ * @return the port number for the RMI Service
+ */
+ public String getPort() {
+ return port;
+ }
+
+ /**
+ * @param rmiPort the port number for the RMI Service
+ */
+ public void setPort(String rmiPort) {
+ this.port = rmiPort;
+ }
+
+ /**
+ * @return returns the RMI Service Name
+ */
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ /**
+ * Sets the service name for the RMI Server
+ *
+ * @param rmiServiceName the name of the RMI service
+ */
+ public void setServiceName(String rmiServiceName) {
+ this.serviceName = rmiServiceName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ // The sample binding is always resolved
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+}
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingProviderFactory.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingProviderFactory.java
new file mode 100644
index 0000000000..746aa4dac1
--- /dev/null
+++ b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingProviderFactory.java
@@ -0,0 +1,62 @@
+/*
+ * 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.binding.rmi.provider;
+
+import org.apache.tuscany.sca.binding.rmi.RMIBinding;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.host.rmi.ExtensibleRMIHost;
+import org.apache.tuscany.sca.host.rmi.RMIHost;
+import org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint;
+import org.apache.tuscany.sca.provider.BindingProviderFactory;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ *
+ */
+public class RMIBindingProviderFactory implements BindingProviderFactory<RMIBinding> {
+ private RMIHost rmiHost;
+
+ public RMIBindingProviderFactory(ExtensionPointRegistry registry) {
+ super();
+ RMIHostExtensionPoint hosts = registry.getExtensionPoint(RMIHostExtensionPoint.class);
+ rmiHost = new ExtensibleRMIHost(hosts);
+ }
+
+ public Class<RMIBinding> getModelType() {
+ return RMIBinding.class;
+ }
+
+ public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
+ RuntimeComponentReference reference,
+ RMIBinding binding) {
+ return new RMIReferenceBindingProvider(component, reference, binding, rmiHost);
+ }
+
+ public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
+ RuntimeComponentService service,
+ RMIBinding binding) {
+ return new RMIServiceBindingProvider(component, service, binding, rmiHost);
+ }
+
+}
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvokerFactory.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java
index c67bd910ba..d09ea1f903 100644
--- a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvokerFactory.java
+++ b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java
@@ -17,16 +17,18 @@
* under the License.
*/
-package org.apache.tuscany.sca.binding.rmi;
+package org.apache.tuscany.sca.binding.rmi.provider;
import java.lang.reflect.Method;
-import org.apache.tuscany.sca.extension.helper.InvokerFactory;
+import org.apache.tuscany.sca.binding.rmi.RMIBinding;
import org.apache.tuscany.sca.host.rmi.RMIHost;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
import org.osoa.sca.ServiceRuntimeException;
@@ -37,13 +39,12 @@ import org.osoa.sca.ServiceRuntimeException;
*
* @version $Rev$ $Date$
*/
-public class RMIReferenceInvokerFactory implements InvokerFactory {
+public class RMIReferenceBindingProvider implements ReferenceBindingProvider {
+ private RuntimeComponentReference reference;
+ private RMIHost rmiHost;
+ private RMIBinding binding;
- RuntimeComponentReference reference;
- RMIHost rmiHost;
- RMIBinding binding;
-
- public RMIReferenceInvokerFactory(RuntimeComponent rc, RuntimeComponentReference rcr, RMIBinding binding, RMIHost rmiHost) {
+ public RMIReferenceBindingProvider(RuntimeComponent rc, RuntimeComponentReference rcr, RMIBinding binding, RMIHost rmiHost) {
this.reference = rcr;
this.rmiHost = rmiHost;
this.binding = binding;
@@ -62,4 +63,18 @@ public class RMIReferenceInvokerFactory implements InvokerFactory {
}
}
+ public InterfaceContract getBindingInterfaceContract() {
+ return reference.getInterfaceContract();
+ }
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
}
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvoker.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceInvoker.java
index 069ed4a070..d300cb7d05 100644
--- a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIReferenceInvoker.java
+++ b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceInvoker.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.binding.rmi;
+package org.apache.tuscany.sca.binding.rmi.provider;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
diff --git a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java
index 25beb58820..4d257b38c8 100644
--- a/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIService.java
+++ b/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.tuscany.sca.binding.rmi;
+package org.apache.tuscany.sca.binding.rmi.provider;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@@ -34,13 +34,15 @@ import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
-import org.apache.tuscany.sca.extension.helper.ComponentLifecycle;
+import org.apache.tuscany.sca.binding.rmi.RMIBinding;
import org.apache.tuscany.sca.host.rmi.RMIHost;
import org.apache.tuscany.sca.host.rmi.RMIHostException;
import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
import org.apache.tuscany.sca.runtime.RuntimeComponentService;
import org.apache.tuscany.sca.runtime.RuntimeWire;
@@ -51,7 +53,7 @@ import org.osoa.sca.ServiceRuntimeException;
*
* @version $Rev$ $Date$
*/
-public class RMIService implements ComponentLifecycle {
+public class RMIServiceBindingProvider implements ServiceBindingProvider {
private RuntimeComponent component;
private RuntimeComponentService service;
@@ -59,7 +61,7 @@ public class RMIService implements ComponentLifecycle {
private RMIHost rmiHost;
private RuntimeWire wire;
- public RMIService(RuntimeComponent rc, RuntimeComponentService rcs, RMIBinding binding, RMIHost rmiHost) {
+ public RMIServiceBindingProvider(RuntimeComponent rc, RuntimeComponentService rcs, RMIBinding binding, RMIHost rmiHost) {
this.component = rc;
this.service = rcs;
this.binding = binding;
@@ -196,4 +198,12 @@ public class RMIService implements ComponentLifecycle {
return defineClass(null, byteArray, 0, byteArray.length);
}
}
+
+ public InterfaceContract getBindingInterfaceContract() {
+ return service.getInterfaceContract();
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
}
diff --git a/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator b/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rmi.RMIBindingFactory
index 582f321be9..889fcafae2 100644
--- a/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator
+++ b/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rmi.RMIBindingFactory
@@ -1,18 +1,19 @@
-# 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.
-# Implementation class for the ExtensionActivator
-org.apache.tuscany.sca.binding.rmi.RMIBindingActivator
+# 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.
+
+# Implementation class for model factory
+org.apache.tuscany.sca.binding.rmi.impl.RMIBindingFactoryImpl
diff --git a/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
new file mode 100644
index 0000000000..d628701a7f
--- /dev/null
+++ b/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -0,0 +1,19 @@
+# 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.
+
+# Implementation class for the artifact processor extension
+org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#binding.rmi,model=org.apache.tuscany.sca.binding.rmi.RMIBinding,factory=org.apache.tuscany.sca.binding.rmi.RMIBindingFactory
diff --git a/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
new file mode 100644
index 0000000000..b188c24a20
--- /dev/null
+++ b/java/sca/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
@@ -0,0 +1,19 @@
+# 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.
+
+# Implementation class for the binding extension
+org.apache.tuscany.sca.binding.rmi.provider.RMIBindingProviderFactory;model=org.apache.tuscany.sca.binding.rmi.RMIBinding
diff --git a/java/sca/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java b/java/sca/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
index c7838e284b..a3c4ae4010 100644
--- a/java/sca/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
+++ b/java/sca/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
@@ -22,7 +22,9 @@ import helloworld.HelloException;
import helloworld.HelloWorldRmiService;
import junit.framework.Assert;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -34,7 +36,7 @@ import org.junit.Test;
*/
public class BindingTestCase {
private static HelloWorldRmiService helloWorldRmiService;
- private static SCADomain domain;
+ private static SCANode node;
@Test
public void testRmiService() {
@@ -60,8 +62,9 @@ public class BindingTestCase {
@BeforeClass
public static void init() throws Exception {
try {
- domain = SCADomain.newInstance("RMIBindingTest.composite");
- helloWorldRmiService = domain.getService(HelloWorldRmiService.class, "HelloWorldRmiServiceComponent");
+ node = SCANodeFactory.newInstance().createSCANodeFromClassLoader("RMIBindingTest.composite", BindingTestCase.class.getClassLoader());
+ node.start();
+ helloWorldRmiService = ((SCAClient) node).getService(HelloWorldRmiService.class, "HelloWorldRmiServiceComponent");
} catch (Exception e) {
e.printStackTrace();
}
@@ -69,7 +72,7 @@ public class BindingTestCase {
@AfterClass
public static void destroy() throws Exception {
- domain.close();
+ node.stop();
}
}