summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-08-03 09:21:41 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-08-03 09:21:41 +0000
commit1fb6a28a73ca17dbb8c4b3059db590e2f9620943 (patch)
tree71d9c9a70ce373cecc4597c2880a5047e0353d07 /sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src
parent7ad16a07b4288227c531c485939318768129fb54 (diff)
Correct tag name
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1153404 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src')
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBinding.java94
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingException.java40
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingProcessor.java135
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingInvoker.java73
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingProviderFactory.java67
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianReferenceBindingProvider.java62
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceBindingProvider.java87
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceListenerServlet.java335
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema19
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/binding-hessian.xsd36
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstImpl.java37
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstTestCase.java70
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/IFirst.java29
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/ISecond.java25
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondImpl.java37
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondTestCase.java72
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/resources/first_hessian.composite39
-rw-r--r--sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/resources/second_hessian.composite45
20 files changed, 0 insertions, 1340 deletions
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBinding.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBinding.java
deleted file mode 100644
index 7f90d78424..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBinding.java
+++ /dev/null
@@ -1,94 +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.hessian.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-public class HessianBinding implements Binding {
-
- // properties required to implement the Tuscany
- // binding extension SPI
- private String uri = null;
- private String name = null;
- private boolean unresolved = false;
- private List<Object> extensions = new ArrayList<Object>();
-
- public HessianBinding() {
- super();
- }
-
- /**
- * Returns the binding URI.
- *
- * @return the binding URI
- */
- public String getURI() {
- return this.uri;
- }
-
- /**
- * Sets the binding URI.
- *
- * @param uri the binding URI
- */
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- /**
- * Returns the binding name.
- *
- * @return the binding name
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Sets the binding name.
- *
- * @param name the binding name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- public boolean isUnresolved() {
- return this.unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public List<Object> getExtensions() {
- return extensions;
- }
-
- /**
- * Clone the binding
- */
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingException.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingException.java
deleted file mode 100644
index 456f0d11ba..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingException.java
+++ /dev/null
@@ -1,40 +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.hessian.impl;
-
-public class HessianBindingException extends RuntimeException {
- private static final long serialVersionUID = 1L;
-
- public HessianBindingException() {
- super();
- }
-
- public HessianBindingException(String arg0, Throwable arg1) {
- super(arg0, arg1);
- }
-
- public HessianBindingException(String arg0) {
- super(arg0);
- }
-
- public HessianBindingException(Throwable arg0) {
- super(arg0);
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingProcessor.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingProcessor.java
deleted file mode 100644
index f5564b926b..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/impl/HessianBindingProcessor.java
+++ /dev/null
@@ -1,135 +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.hessian.impl;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-public class HessianBindingProcessor implements StAXArtifactProcessor<HessianBinding> {
-
- private QName BINDING_HESSIAN = new QName("http://hessian", "binding.hessian");
-
- private PolicyFactory policyFactory;
- private PolicyAttachPointProcessor policyProcessor;
- private Monitor monitor;
-
- public HessianBindingProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.monitor = monitor;
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void warning(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem =
- new ProblemImpl(this.getClass().getName(), "binding-hessian-validation-messages", Severity.WARNING,
- model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem =
- new ProblemImpl(this.getClass().getName(), "binding-hessian-validation-messages", Severity.ERROR,
- model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return BINDING_HESSIAN;
- }
-
- public Class<HessianBinding> getModelType() {
- return HessianBinding.class;
- }
-
- public HessianBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- HessianBinding hessianBinding = new HessianBinding();
-
- // Read policies
- policyProcessor.readPolicies(hessianBinding, reader);
-
- // Read binding name
- String name = reader.getAttributeValue(null, "name");
- if (name != null) {
- hessianBinding.setName(name);
- }
-
- // Read binding URI
- String uri = reader.getAttributeValue(null, "uri");
- if (uri != null) {
- hessianBinding.setURI(uri);
- }
-
- return hessianBinding;
- }
-
- public void resolve(HessianBinding model, ModelResolver resolver) throws ContributionResolveException {
- }
-
- public void write(HessianBinding hessianBinding, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- policyProcessor.writePolicyPrefixes(hessianBinding, writer);
- writer.writeStartElement(BINDING_HESSIAN.getNamespaceURI(), BINDING_HESSIAN.getLocalPart());
- policyProcessor.writePolicyAttributes(hessianBinding, writer);
-
- if (hessianBinding.getName() != null) {
- writer.writeAttribute("name", hessianBinding.getName());
- }
-
- if (hessianBinding.getURI() != null) {
- writer.writeAttribute("uri", hessianBinding.getURI());
- }
-
- writer.writeEndElement();
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingInvoker.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingInvoker.java
deleted file mode 100644
index 9d6ede2dbc..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingInvoker.java
+++ /dev/null
@@ -1,73 +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.hessian.provider;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.binding.hessian.impl.HessianBinding;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-import com.caucho.hessian.client.HessianProxyFactory;
-
-public class HessianBindingInvoker implements Invoker {
-
- private String serviceURL;
- private Interface homeImpl;
-
- HessianBindingInvoker(Interface homeImpl, HessianBinding binding) {
- this.serviceURL = binding.getURI();
- this.homeImpl = homeImpl;
- }
-
- public Message invoke(Message msg) {
- try {
- Method method = ((JavaOperation)msg.getOperation()).getJavaMethod();
- Object[] args = msg.getBody();
-
- HessianProxyFactory proxyFactory = new HessianProxyFactory();
- Object service = proxyFactory.create(loadClass(homeImpl.toString()), serviceURL);
- Object result = null;
- result = method.invoke(service, args);
- msg.setBody(result);
- } catch (Throwable e) {
- e.printStackTrace();
- if (e instanceof InvocationTargetException)
- e = ((InvocationTargetException)e).getTargetException();
- msg.setFaultBody(e);
- }
- return msg;
- }
-
- private Class loadClass(String className) {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try {
- if (loader != null)
- return Class.forName(className, false, loader);
- else
- return Class.forName(className);
- } catch (Exception e) {
-
- }
- return null;
- }
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingProviderFactory.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingProviderFactory.java
deleted file mode 100644
index 77a5f6f675..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianBindingProviderFactory.java
+++ /dev/null
@@ -1,67 +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.hessian.provider;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.hessian.impl.HessianBinding;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-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 HessianBindingProviderFactory implements BindingProviderFactory<HessianBinding> {
-
- private MessageFactory messageFactory;
- private ServletHost servletHost;
-
- public HessianBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- List<ServletHost> hosts = servletHosts.getServletHosts();
- if (!hosts.isEmpty()) {
- this.servletHost = hosts.get(0);
- }
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- messageFactory = modelFactories.getFactory(MessageFactory.class);
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- HessianBinding binding) {
- return new HessianReferenceBindingProvider(component, reference, binding);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- HessianBinding binding) {
- return new HessianServiceBindingProvider(component, service, binding, messageFactory, servletHost);
- }
-
- public Class<HessianBinding> getModelType() {
- return HessianBinding.class;
- }
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianReferenceBindingProvider.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianReferenceBindingProvider.java
deleted file mode 100644
index 27711932d7..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianReferenceBindingProvider.java
+++ /dev/null
@@ -1,62 +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.hessian.provider;
-
-import org.apache.tuscany.sca.binding.hessian.impl.HessianBinding;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-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;
-
-public class HessianReferenceBindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
- private HessianBinding hessianBinding;
-
- public HessianReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- HessianBinding binding) {
- this.reference = reference;
- this.hessianBinding = binding;
- }
-
- public Invoker createInvoker(Operation operation) {
- return new HessianBindingInvoker(getBindingInterfaceContract().getInterface(), hessianBinding);
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- public void start() {
-
- }
-
- public void stop() {
-
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceBindingProvider.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceBindingProvider.java
deleted file mode 100644
index 3e4922dc13..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceBindingProvider.java
+++ /dev/null
@@ -1,87 +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.hessian.provider;
-
-import java.util.logging.Logger;
-
-import javax.servlet.Servlet;
-
-import org.apache.tuscany.sca.binding.hessian.impl.HessianBinding;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-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;
-
-public class HessianServiceBindingProvider implements ServiceBindingProvider {
- private static final Logger logger = Logger.getLogger(HessianServiceBindingProvider.class.getName());
-
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private HessianBinding hessianBinding;
- private MessageFactory messageFactory;
- private ServletHost servletHost;
- private String servletMapping;
-
- public HessianServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- HessianBinding binding,
- MessageFactory messageFactory,
- ServletHost servletHost) {
- this.component = component;
- this.service = service;
- this.hessianBinding = binding;
- this.messageFactory = messageFactory;
- this.servletHost = servletHost;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-
- public void start() {
- Servlet servlet = null;
- Interface homeImpl = service.getInterfaceContract().getInterface();
- RuntimeWire wire = service.getRuntimeWire(hessianBinding);
- servlet = new HessianServiceListenerServlet(homeImpl, wire, messageFactory);
-
- if (servlet == null) {
- throw new IllegalStateException("No get or service method found on the service");
- }
-
- servletMapping = hessianBinding.getURI();
- servletHost.addServletMapping(servletMapping, servlet);
-
- // Save the actual binding URI in the binding
- hessianBinding.setURI(servletHost.getURLMapping(hessianBinding.getURI()).toString());
- }
-
- public void stop() {
- servletHost.removeServletMapping(servletMapping);
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceListenerServlet.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceListenerServlet.java
deleted file mode 100644
index de9b4927c6..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/java/org/apache/tuscany/sca/binding/hessian/provider/HessianServiceListenerServlet.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (c) 2001-2008 Caucho Technology, Inc. All rights reserved.
- *
- * The Apache Software License, Version 1.1
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Caucho Technology (http://www.caucho.com/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "Hessian", "Resin", and "Caucho" must not be used to
- * endorse or promote products derived from this software without prior
- * written permission. For written permission, please contact
- * info@caucho.com.
- *
- * 5. Products derived from this software may not be called "Resin"
- * nor may "Resin" appear in their names without prior written
- * permission of Caucho Technology.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL CAUCHO TECHNOLOGY OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * @author Scott Ferguson
- */
-
-package org.apache.tuscany.sca.binding.hessian.provider;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javax.servlet.GenericServlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-import com.caucho.hessian.io.AbstractHessianInput;
-import com.caucho.hessian.io.AbstractHessianOutput;
-import com.caucho.hessian.io.Hessian2Input;
-import com.caucho.hessian.io.Hessian2Output;
-import com.caucho.hessian.io.HessianOutput;
-import com.caucho.hessian.io.SerializerFactory;
-import com.caucho.services.server.ServiceContext;
-
-/**
- * Servlet for serving Hessian services.
- */
-public class HessianServiceListenerServlet extends GenericServlet {
-
- private static final Logger logger = Logger.getLogger(HessianServiceListenerServlet.class.getName());
-
- private Interface homeImpl;
- private RuntimeWire wire;
- private MessageFactory messageFactory;
-
- private SerializerFactory _serializerFactory;
-
- private Map<String, JavaOperation> _operationMap = new Hashtable<String, JavaOperation>();
-
- public HessianServiceListenerServlet(Interface homeImpl, RuntimeWire wire, MessageFactory messageFactory) {
- this.homeImpl = homeImpl;
- this.wire = wire;
- this.messageFactory = messageFactory;
-
- List<Operation> operations = homeImpl.getOperations();
- for (int i = 0; i < operations.size(); i++) {
- JavaOperation op = (JavaOperation)operations.get(i);
- Method method = op.getJavaMethod();
- if (_operationMap.get(method.getName()) == null)
- _operationMap.put(method.getName(), op);
-
- Class[] param = method.getParameterTypes();
- String mangledName = method.getName() + "__" + param.length;
- _operationMap.put(mangledName, op);
- _operationMap.put(mangleName(method, false), op);
- }
- }
-
- public String getServletInfo() {
- return "Tuscany Binding Hessian Servlet";
- }
-
- /**
- * Sets the serializer factory.
- */
- public void setSerializerFactory(SerializerFactory factory) {
- _serializerFactory = factory;
- }
-
- /**
- * Gets the serializer factory.
- */
- public SerializerFactory getSerializerFactory() {
- if (_serializerFactory == null)
- _serializerFactory = new SerializerFactory();
-
- return _serializerFactory;
- }
-
- /**
- * Sets the serializer send collection java type.
- */
- public void setSendCollectionType(boolean sendType) {
- getSerializerFactory().setSendCollectionType(sendType);
- }
-
- /**
- * Execute a request. The path-info of the request selects the bean. Once
- * the bean's selected, it will be applied.
- */
- public void service(ServletRequest request, ServletResponse response) throws IOException, ServletException {
- HttpServletRequest req = (HttpServletRequest)request;
- HttpServletResponse res = (HttpServletResponse)response;
-
- if (!req.getMethod().equals("POST")) {
- res.setStatus(500, "Hessian Requires POST");
- PrintWriter out = res.getWriter();
- res.setContentType("text/html");
- out.println("<h1>Hessian Requires POST</h1>");
- return;
- }
-
- String serviceId = req.getPathInfo();
- String objectId = req.getParameter("id");
- if (objectId == null)
- objectId = req.getParameter("ejbid");
-
- ServiceContext.begin(req, serviceId, objectId);
-
- try {
- InputStream is = request.getInputStream();
- OutputStream os = response.getOutputStream();
-
- Hessian2Input in = new Hessian2Input(is);
- AbstractHessianOutput out;
-
- SerializerFactory serializerFactory = getSerializerFactory();
-
- in.setSerializerFactory(serializerFactory);
-
- int code = in.read();
-
- if (code != 'c') {
- // XXX: deflate
- throw new IOException("expected 'c' in hessian input at " + code);
- }
-
- int major = in.read();
- int minor = in.read();
-
- if (major >= 2)
- out = new Hessian2Output(os);
- else
- out = new HessianOutput(os);
-
- out.setSerializerFactory(serializerFactory);
-
- invoke(in, out);
-
- out.close();
- } catch (RuntimeException e) {
- throw e;
- } catch (ServletException e) {
- throw e;
- } catch (Throwable e) {
- throw new ServletException(e);
- } finally {
- ServiceContext.end();
- }
- }
-
- private String mangleName(Method method, boolean isFull) {
- StringBuffer sb = new StringBuffer();
- sb.append(method.getName());
- Class[] params = method.getParameterTypes();
- for (int i = 0; i < params.length; i++) {
- sb.append('_');
- sb.append(mangleClass(params[i], isFull));
- }
- return sb.toString();
- }
-
- private String mangleClass(Class cl, boolean isFull) {
- String name = cl.getName();
- if (name.equals("boolean") || name.equals("java.lang.Boolean"))
- return "boolean";
- else if (name.equals("int") || name.equals("java.lang.Integer")
- || name.equals("short")
- || name.equals("java.lang.Short")
- || name.equals("byte")
- || name.equals("java.lang.Byte"))
- return "int";
- else if (name.equals("long") || name.equals("java.lang.Long"))
- return "long";
- else if (name.equals("float") || name.equals("java.lang.Float")
- || name.equals("double")
- || name.equals("java.lang.Double"))
- return "double";
- else if (name.equals("java.lang.String") || name.equals("com.caucho.util.CharBuffer")
- || name.equals("char")
- || name.equals("java.lang.Character")
- || name.equals("java.io.Reader"))
- return "string";
- else if (name.equals("java.util.Date") || name.equals("com.caucho.util.QDate"))
- return "date";
- else if (InputStream.class.isAssignableFrom(cl) || name.equals("[B"))
- return "binary";
- else if (cl.isArray()) {
- return "[" + mangleClass(cl.getComponentType(), isFull);
- } else if (name.equals("org.w3c.dom.Node") || name.equals("org.w3c.dom.Element")
- || name.equals("org.w3c.dom.Document"))
- return "xml";
- else if (isFull)
- return name;
- else {
- int p = name.lastIndexOf('.');
- if (p > 0)
- return name.substring(p + 1);
- else
- return name;
- }
- }
-
- public void invoke(AbstractHessianInput in, AbstractHessianOutput out) throws Exception {
- ServiceContext context = ServiceContext.getContext();
-
- // backward compatibility for some frameworks that don't read
- // the call type first
- in.skipOptionalCall();
-
- String header;
- while ((header = in.readHeader()) != null) {
- Object value = in.readObject();
- context.addHeader(header, value);
- }
-
- String methodName = in.readMethod();
- Method method = null;
- JavaOperation operation = _operationMap.get(methodName);
- if (operation != null)
- method = operation.getJavaMethod();
-
- if (method != null) {
- } else if ("_hessian_getAttribute".equals(methodName)) {
- String attrName = in.readString();
- in.completeCall();
- String value = null;
- if ("java.api.class".equals(attrName))
- value = homeImpl.toString();
- else if ("java.home.class".equals(attrName))
- value = homeImpl.toString();
- else if ("java.object.class".equals(attrName))
- value = homeImpl.toString();
- out.startReply();
- out.writeObject(value);
- out.completeReply();
- return;
- } else if (method == null) {
- out.startReply();
- out.writeFault("NoSuchMethodException", "The service has no method named: " + in.getMethod(), null);
- out.completeReply();
- return;
- }
-
- Class[] args = method.getParameterTypes();
- Object[] values = new Object[args.length];
-
- for (int i = 0; i < args.length; i++) {
- values[i] = in.readObject(args[i]);
- }
-
- Object result = null;
- try {
- Message msg = messageFactory.createMessage();
- msg.setOperation(operation);
- msg.setBody(values);
- result = wire.invoke(operation, msg);
- } catch (Throwable e) {
- while (e instanceof InvocationTargetException)
- e = ((InvocationTargetException)e).getTargetException();
- out.startReply();
- out.writeFault("ServiceException", e.getMessage(), e);
- out.completeReply();
- return;
- }
-
- // The complete call needs to be after the invoke to handle a
- // trailing InputStream
- in.completeCall();
- out.startReply();
- out.writeObject(result);
- out.completeReply();
- out.close();
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 1bbe97e514..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +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.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.binding.hessian.impl.HessianBindingProcessor;qname=http://hessian#binding.hessian,model=org.apache.tuscany.sca.binding.hessian.impl.HessianBinding
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
deleted file mode 100644
index dfd4823a13..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
+++ /dev/null
@@ -1,19 +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.
-
-# URI of the XML schema to be used for validation
-binding-hessian.xsd
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 244449ddf0..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
+++ /dev/null
@@ -1,19 +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.
-
-# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.hessian.provider.HessianBindingProviderFactory;model=org.apache.tuscany.sca.binding.hessian.impl.HessianBinding
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/binding-hessian.xsd b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/binding-hessian.xsd
deleted file mode 100644
index 01d7437878..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/main/resources/binding-hessian.xsd
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://hessian"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:e="http://hessian"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0"/>
-
- <element name="binding.hessian" type="e:HessianBinding"/>
-
- <complexType name="HessianBinding">
- <complexContent>
- <extension base="sca:Binding">
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstImpl.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstImpl.java
deleted file mode 100644
index 03ae16792a..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstImpl.java
+++ /dev/null
@@ -1,37 +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.zhulei.test.hessian.first;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class FirstImpl implements IFirst {
-
- public String getString(String str) {
- return str + "_first";
- }
-
- public List<String> getData(String str1, String str2) {
- List<String> list = new ArrayList<String>();
- list.add(str1 + "_first");
- list.add(str2 + "_first");
- return list;
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstTestCase.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstTestCase.java
deleted file mode 100644
index 919cbe90ff..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/FirstTestCase.java
+++ /dev/null
@@ -1,70 +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.zhulei.test.hessian.first;
-
-import java.io.IOException;
-import java.util.List;
-
-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;
-
-import com.caucho.hessian.client.HessianProxyFactory;
-
-/**
- *
- */
-public class FirstTestCase {
- private static SCANode node;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- node = SCANodeFactory.newInstance().createSCANodeFromClassLoader("first_hessian.composite", null);
- node.start();
- }
-
- @Test
- public void testServer() throws IOException {
- try {
- HessianProxyFactory proxyFactory = new HessianProxyFactory();
- IFirst service = (IFirst)proxyFactory.create(IFirst.class, "http://localhost:8085/hessian1");
- List<String> datas = service.getData("123", "ABC");
- for (int i = 0; i < datas.size(); i++) {
- System.out.println(datas.get(i));
- }
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- node.stop();
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/IFirst.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/IFirst.java
deleted file mode 100644
index 03ec25721f..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/first/IFirst.java
+++ /dev/null
@@ -1,29 +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.zhulei.test.hessian.first;
-
-import java.util.List;
-
-public interface IFirst {
-
- public String getString(String str);
-
- public List<String> getData(String str1, String str2);
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/ISecond.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/ISecond.java
deleted file mode 100644
index 5ab32673cd..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/ISecond.java
+++ /dev/null
@@ -1,25 +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.zhulei.test.hessian.second;
-
-public interface ISecond {
-
- public String getString(String str);
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondImpl.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondImpl.java
deleted file mode 100644
index 3fe66f6cbb..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondImpl.java
+++ /dev/null
@@ -1,37 +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.zhulei.test.hessian.second;
-
-import org.osoa.sca.annotations.Reference;
-import org.zhulei.test.hessian.first.IFirst;
-
-public class SecondImpl implements ISecond {
-
- private IFirst first;
-
- public String getString(String str) {
- return first.getString(str) + "_second";
- }
-
- @Reference
- public void setFirst(IFirst first) {
- this.first = first;
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondTestCase.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondTestCase.java
deleted file mode 100644
index f390d5b104..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/java/org/zhulei/test/hessian/second/SecondTestCase.java
+++ /dev/null
@@ -1,72 +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.zhulei.test.hessian.second;
-
-import java.io.IOException;
-
-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;
-
-import com.caucho.hessian.client.HessianProxyFactory;
-
-/**
- *
- */
-public class SecondTestCase {
- private static SCANode node1;
- private static SCANode node2;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- node1 = SCANodeFactory.newInstance().createSCANodeFromClassLoader("second_hessian.composite", null);
- node1.start();
-
- node2 = SCANodeFactory.newInstance().createSCANodeFromClassLoader("first_hessian.composite", null);
- node2.start();
- }
-
- @Test
- public void testServer() throws IOException {
- try {
- HessianProxyFactory proxyFactory = new HessianProxyFactory();
- ISecond service = (ISecond)proxyFactory.create(ISecond.class, "http://localhost:8085/hessian2");
- String str = service.getString("XYZ");
- System.out.println(str);
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- node1.stop();
- node2.stop();
- }
-
-}
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/resources/first_hessian.composite b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/resources/first_hessian.composite
deleted file mode 100644
index 3b14069063..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/resources/first_hessian.composite
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
- xmlns:e="http://hessian"
- targetNamespace="http://FirstHessianSCA"
- name="FirstHessianSCA">
-
- <component name="FirstHessianComponent">
- <implementation.java
- class="org.zhulei.test.hessian.first.FirstImpl" />
- </component>
-
- <service name="Hessian"
- promote="FirstHessianComponent">
- <interface.java
- interface="org.zhulei.test.hessian.first.IFirst" />
- <e:binding.hessian uri="/hessian1" />
- </service>
-
-</composite>
diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/resources/second_hessian.composite b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/resources/second_hessian.composite
deleted file mode 100644
index 76ddd89341..0000000000
--- a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/binding-hessian/src/test/resources/second_hessian.composite
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
- xmlns:e="http://hessian"
- targetNamespace="http://FirstHessianSCA"
- name="FirstHessianSCA">
-
- <component name="SecondHessianComponent">
- <implementation.java
- class="org.zhulei.test.hessian.second.SecondImpl" />
- <reference name="first">
- <interface.java
- interface="org.zhulei.test.hessian.first.IFirst" />
- <e:binding.hessian
- uri="http://localhost:8085/hessian1" />
- </reference>
- </component>
-
- <service name="Hessian"
- promote="SecondHessianComponent">
- <interface.java
- interface="org.zhulei.test.hessian.second.ISecond" />
- <e:binding.hessian uri="/hessian2" />
- </service>
-
-</composite>