cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r524475 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/bindings/ rt/bindings/object/ rt/bindings/object/src/ rt/bindings/object/src/main/ rt/bindings/object/src/main/java/ rt/bindings/object/src/main/java/org/ rt/bi...
Date Sat, 31 Mar 2007 20:17:25 GMT
Author: dandiep
Date: Sat Mar 31 13:17:23 2007
New Revision: 524475

URL: http://svn.apache.org/viewvc?view=rev&rev=524475
Log:
Create an "Object binding". This allows local invocation of services
without any serialization. The binding and operation are selected
via properties on the message. I.e.

message.put(ObjectBinding.BINDING, new QName("someBinding"));
message.put(ObjectBinding.OPERATION, new QName("someOperation"));

We could maybe enhance this to work with URIs like James was suggesting
as well.

I made a few slight changes to the local transport to support this.
There is a DIRECT_DISPATCH flag which just tells the local transport
not to use streams, but instead to copy the content from the sent message
to a new message which is passed on to a Destination.



Added:
    incubator/cxf/trunk/rt/bindings/object/
    incubator/cxf/trunk/rt/bindings/object/pom.xml   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/
    incubator/cxf/trunk/rt/bindings/object/src/main/
    incubator/cxf/trunk/rt/bindings/object/src/main/java/
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/Messages.properties   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBinding.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingConfigBean.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingFactory.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchInInterceptor.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchOutInterceptor.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/NamespaceHandler.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/ObjectBindingConfigBeanDefinintionParser.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/bus-extensions.xml   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/cxf-extension-object-binding.xml   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.handlers   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.schemas   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/
    incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/object.xsd   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/test/
    incubator/cxf/trunk/rt/bindings/object/src/test/java/
    incubator/cxf/trunk/rt/bindings/object/src/test/java/org/
    incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/
    incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/
    incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/
    incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/
    incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/Echo.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/EchoImpl.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java   (with props)
    incubator/cxf/trunk/rt/bindings/object/src/test/resources/
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java
    incubator/cxf/trunk/rt/bindings/pom.xml
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java
    incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
    incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java?view=diff&rev=524475&r1=524474&r2=524475
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageImpl.java Sat Mar 31 13:17:23 2007
@@ -147,11 +147,7 @@
     
     public static void copyContent(Message m1, Message m2) {
         for (Class<?> c : m1.getContentFormats()) {
-            if (c == Exception.class) {
-                m2.setContent(c, m1.getContent(c));
-            } else if (c ==  javax.xml.stream.XMLStreamReader.class) {
-                m2.setContent(c, m1.getContent(c));
-            }
+            m2.setContent(c, m1.getContent(c));
         }
     }
 }

Added: incubator/cxf/trunk/rt/bindings/object/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/pom.xml?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/pom.xml (added)
+++ incubator/cxf/trunk/rt/bindings/object/pom.xml Sat Mar 31 13:17:23 2007
@@ -0,0 +1,83 @@
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>cxf-rt-bindings-objecT</artifactId>
+    <packaging>jar</packaging>
+    <name>Apache CXF Runtime Object Binding</name>
+    <url>http://cwiki.apache.org/CXF</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>2.0-incubator-RC-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-tools-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+		<dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-simple</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-local</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymockclassextension</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/bindings/object</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/bindings/object</developerConnection>
+    </scm>
+
+</project>

Propchange: incubator/cxf/trunk/rt/bindings/object/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/bindings/object/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/Messages.properties?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/Messages.properties (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/Messages.properties Sat Mar 31 13:17:23 2007
@@ -0,0 +1,2 @@
+NO_BINDING: No binding QName was specified.
+NO_OPERATION: No operation QName was specified.
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/Messages.properties
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/Messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBinding.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBinding.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBinding.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,38 @@
+/**
+ * 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.cxf.binding.object;
+
+import org.apache.cxf.binding.Binding;
+import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+
+public class ObjectBinding extends AbstractBasicInterceptorProvider implements Binding {
+
+    public static final String OPERATION = "objectBinding.operationName";
+    public static final String BINDING = "objectBinding.bindingName";
+    
+    public Message createMessage() {
+        return new MessageImpl();
+    }
+
+    public Message createMessage(Message m) {
+        return m;
+    }
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBinding.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBinding.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingConfigBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingConfigBean.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingConfigBean.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingConfigBean.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,23 @@
+/**
+ * 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.cxf.binding.object;
+
+public class ObjectBindingConfigBean {
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingConfigBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingConfigBean.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingConfigBean.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingFactory.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingFactory.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingFactory.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,67 @@
+/**
+ * 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.cxf.binding.object;
+
+import java.util.Collection;
+
+import javax.annotation.Resource;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.binding.AbstractBindingFactory;
+import org.apache.cxf.binding.Binding;
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.OperationInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+
+public class ObjectBindingFactory extends AbstractBindingFactory {
+    public static final String BINDING_ID = "http://cxf.apache.org/binding/object";
+    private Collection<String> activationNamespaces;    
+
+    public Collection<String> getActivationNamespaces() {
+        return activationNamespaces;
+    }
+
+    @Resource(name = "activationNamespaces")
+    public void setActivationNamespaces(Collection<String> ans) {
+        activationNamespaces = ans;
+    }
+
+    public Binding createBinding(BindingInfo bi) {
+        ObjectBinding binding = new ObjectBinding();
+        binding.getOutInterceptors().add(new ObjectDispatchOutInterceptor());
+        binding.getInInterceptors().add(new ObjectDispatchInInterceptor());
+        
+        return binding;
+    }
+
+    public BindingInfo createBindingInfo(ServiceInfo si, String bindingid, Object config) {
+        BindingInfo info = super.createBindingInfo(si, bindingid, config);
+        
+        info.setName(new QName(si.getName().getNamespaceURI(), 
+                               si.getName().getLocalPart() + "ObjectBinding"));
+        
+        for (OperationInfo o : si.getInterface().getOperations()) {
+            BindingOperationInfo bop = info.buildOperation(o.getName(), o.getInputName(), o.getOutputName());
+            info.addOperation(bop);
+        }
+        return info;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingFactory.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectBindingFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchInInterceptor.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchInInterceptor.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchInInterceptor.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,67 @@
+/**
+ * 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.cxf.binding.object;
+
+import java.util.ResourceBundle;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+
+public class ObjectDispatchInInterceptor extends AbstractPhaseInterceptor<Message> {
+    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(ObjectDispatchInInterceptor.class);
+    
+    public ObjectDispatchInInterceptor() {
+        super();
+        setPhase(Phase.READ);
+    }
+
+    public void handleMessage(Message message) throws Fault {
+        if (Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) {
+            return;
+        }
+        
+        QName opName = (QName) message.get(ObjectBinding.OPERATION);
+        QName bindingName = (QName) message.get(ObjectBinding.BINDING);
+
+        if (opName == null) {
+            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION", BUNDLE));
+        }
+        
+        if (bindingName == null) {
+            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_BINDING", BUNDLE));
+        }
+        
+        Endpoint ep = message.getExchange().get(Endpoint.class);
+        
+        BindingInfo binding = ep.getService().getServiceInfo().getBinding(bindingName);
+        BindingOperationInfo bop = binding.getOperation(opName);
+        
+        message.getExchange().put(BindingOperationInfo.class, bop);
+        
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchInInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchInInterceptor.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchInInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchOutInterceptor.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchOutInterceptor.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchOutInterceptor.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,45 @@
+/**
+ * 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.cxf.binding.object;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.transport.local.LocalConduit;
+
+public class ObjectDispatchOutInterceptor extends AbstractPhaseInterceptor<Message> {
+
+    public ObjectDispatchOutInterceptor() {
+        super();
+        setPhase(Phase.SETUP);
+    }
+
+    public void handleMessage(Message message) throws Fault {
+        Exchange ex = message.getExchange();
+        message.put(LocalConduit.DIRECT_DISPATCH, Boolean.TRUE);
+        BindingOperationInfo bop = ex.get(BindingOperationInfo.class);
+        
+        message.put(ObjectBinding.OPERATION, bop.getName());
+        message.put(ObjectBinding.BINDING, bop.getBinding().getName());
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchOutInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchOutInterceptor.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/ObjectDispatchOutInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/NamespaceHandler.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/NamespaceHandler.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/NamespaceHandler.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,27 @@
+/**
+ * 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.cxf.binding.object.spring;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+public class NamespaceHandler extends NamespaceHandlerSupport {
+    public void init() {
+        registerBeanDefinitionParser("soapBinding", new ObjectBindingConfigBeanDefinintionParser());        
+    }
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/ObjectBindingConfigBeanDefinintionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/ObjectBindingConfigBeanDefinintionParser.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/ObjectBindingConfigBeanDefinintionParser.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/ObjectBindingConfigBeanDefinintionParser.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,47 @@
+/**
+ * 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.cxf.binding.object.spring;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+
+import org.apache.cxf.binding.object.ObjectBindingConfigBean;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+
+public class ObjectBindingConfigBeanDefinintionParser extends AbstractBeanDefinitionParser {
+
+    @Override
+    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        NamedNodeMap atts = element.getAttributes();
+        for (int i = 0; i < atts.getLength(); i++) {
+            Attr node = (Attr) atts.item(i);
+            
+            mapToProperty(bean, node.getLocalName(), node.getValue());
+        }
+    }
+
+    @Override
+    protected Class getBeanClass(Element arg0) {
+        return ObjectBindingConfigBean.class;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/ObjectBindingConfigBeanDefinintionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/ObjectBindingConfigBeanDefinintionParser.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/spring/ObjectBindingConfigBeanDefinintionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/bus-extensions.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/bus-extensions.xml?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/bus-extensions.xml (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/bus-extensions.xml Sat Mar 31 13:17:23 2007
@@ -0,0 +1,27 @@
+<?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.
+-->
+<extensions xmlns="http://cxf.apache.org/bus/extension">
+
+    <extension class="org.apache.cxf.binding.object.ObjectBindingFactory" 
+      interface="org.apache.cxf.binding.BindingFactory" deferred="true">
+        <namespace>http://cxf.apache.org/binding/object/</namespace>
+    </extension>
+    
+</extensions>

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/cxf-extension-object-binding.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/cxf-extension-object-binding.xml?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/cxf-extension-object-binding.xml (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/cxf-extension-object-binding.xml Sat Mar 31 13:17:23 2007
@@ -0,0 +1,35 @@
+<?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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:foo="http://cxf.apache.org/configuration/foo"
+	xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean class="org.apache.cxf.binding.object.ObjectBindingFactory"
+		lazy-init="true">
+		<property name="activationNamespaces">
+			<set>
+				<value>http://cxf.apache.org/binding/object</value>
+			</set>
+		</property>
+	</bean>
+</beans>

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/cxf-extension-object-binding.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/cxf-extension-object-binding.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/cxf-extension-object-binding.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/cxf/cxf-extension-object-binding.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.handlers
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.handlers?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.handlers (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.handlers Sat Mar 31 13:17:23 2007
@@ -0,0 +1 @@
+http\://cxf.apache.org/bindings/object=org.apache.cxf.binding.object.spring.NamespaceHandler
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.handlers
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.schemas?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.schemas (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.schemas Sat Mar 31 13:17:23 2007
@@ -0,0 +1 @@
+http\://cxf.apache.org/schema/bindings/object.xsd=org/apache/cxf/binding/soap/spring/object.xsd
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/META-INF/spring.schemas
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/object.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/object.xsd?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/object.xsd (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/object.xsd Sat Mar 31 13:17:23 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:beans="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
+  targetNamespace="http://cxf.apache.org/bindings/object" 
+  elementFormDefault="qualified"
+  attributeFormDefault="unqualified"  >
+
+  <xsd:import namespace="http://www.springframework.org/schema/beans" />
+
+  <xsd:element name="objectBinding">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="beans:identifiedType">
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+
+</xsd:schema>

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/object.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/object.xsd
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/object.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/bindings/object/src/main/resources/org/apache/cxf/binding/object/spring/object.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/Echo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/Echo.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/Echo.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/Echo.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,26 @@
+/**
+ * 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.cxf.binding.object;
+
+import javax.jws.WebService;
+
+@WebService
+public interface Echo {
+    String echo(String text);
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/Echo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/Echo.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/Echo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/EchoImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/EchoImpl.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/EchoImpl.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/EchoImpl.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,30 @@
+/**
+ * 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.cxf.binding.object;
+
+import javax.jws.WebService;
+
+@WebService(endpointInterface = "org.apache.cxf.binding.object.Echo")
+public class EchoImpl implements Echo {
+
+    public String echo(String text) {
+        return text;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/EchoImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/EchoImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/EchoImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java?view=auto&rev=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java (added)
+++ incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java Sat Mar 31 13:17:23 2007
@@ -0,0 +1,176 @@
+/**
+ * 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.cxf.binding.object;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.BusException;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.frontend.ClientFactoryBean;
+import org.apache.cxf.frontend.ServerFactoryBean;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.test.AbstractCXFTest;
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.ConduitInitiator;
+import org.apache.cxf.transport.ConduitInitiatorManager;
+import org.apache.cxf.transport.Destination;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.transport.MessageObserver;
+import org.apache.cxf.transport.local.LocalConduit;
+import org.apache.cxf.transport.local.LocalTransportFactory;
+import org.junit.Test;
+
+public class ObjectBindingTest extends AbstractCXFTest {
+    private Message response;
+
+    @Test
+    public void testServer() throws Exception {
+        ServerFactoryBean sfb = new ServerFactoryBean();
+        sfb.setBindingId(ObjectBindingFactory.BINDING_ID);
+        sfb.setServiceClass(EchoImpl.class);
+        sfb.setAddress("local://Echo");
+        Server server = sfb.create();
+
+        List<Object> content = new ArrayList<Object>();
+        content.add("Hello");
+
+        ServiceInfo serviceInfo = server.getEndpoint().getService().getServiceInfo();
+        BindingInfo bi = serviceInfo.getBindings().iterator().next();
+        BindingOperationInfo bop = bi.getOperations().iterator().next();
+
+        assertNotNull(bop.getOperationInfo());
+
+        MessageImpl m = new MessageImpl();
+        m.setContent(List.class, content);
+        m.put(LocalConduit.DIRECT_DISPATCH, Boolean.TRUE);
+        m.put(ObjectBinding.BINDING, bop.getBinding().getName());
+        m.put(ObjectBinding.OPERATION, bop.getName());
+
+        ExchangeImpl ex = new ExchangeImpl();
+        ex.setInMessage(m);
+
+        Conduit c = getLocalConduit("local://Echo");
+        m.setConduit(c);
+
+        c.setMessageObserver(new MessageObserver() {
+            public void onMessage(Message message) {
+                response = message;
+            }
+        });
+        c.send(m);
+
+        Thread.sleep(1000);
+        assertNotNull(response);
+
+        List<?> content2 = CastUtils.cast((List<?>)response.getContent(List.class));
+        assertNotNull(content2);
+        assertEquals(1, content2.size());
+
+    }
+
+    @Test
+    public void testClient() throws Exception {
+        ClientFactoryBean cfb = new ClientFactoryBean();
+        cfb.setBindingId(ObjectBindingFactory.BINDING_ID);
+        cfb.setServiceClass(EchoImpl.class);
+        cfb.setAddress("local://Echo");
+        Client client = cfb.create();
+
+        final List<Object> content = new ArrayList<Object>();
+        content.add("Hello");
+
+        final Destination d = getLocalDestination("local://Echo");
+
+        d.setMessageObserver(new MessageObserver() {
+
+            public void onMessage(Message inMsg) {
+                // formulate the response message
+                MessageImpl outMsg = new MessageImpl();
+                outMsg.setContent(List.class, content);
+                outMsg.put(LocalConduit.DIRECT_DISPATCH, Boolean.TRUE);
+
+                inMsg.getExchange().setInMessage(outMsg);
+                try {
+                    Conduit backChannel = d.getBackChannel(inMsg, null, null);
+                    backChannel.send(outMsg);
+                    backChannel.close();
+                } catch (IOException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+        });
+
+        Object[] res = client.invoke("echo", content.toArray());
+        assertNotNull(res);
+        assertEquals(1, res.length);
+        assertEquals("Hello", res[0]);
+
+    }
+
+    @Test
+    public void testClientServer() throws Exception {
+        ClientFactoryBean cfb = new ClientFactoryBean();
+        cfb.setBindingId(ObjectBindingFactory.BINDING_ID);
+        cfb.setServiceClass(EchoImpl.class);
+        cfb.setAddress("local://Echo");
+        Client client = cfb.create();
+
+        ServerFactoryBean sfb = new ServerFactoryBean();
+        sfb.setBindingId(ObjectBindingFactory.BINDING_ID);
+        sfb.setServiceClass(EchoImpl.class);
+        sfb.setAddress("local://Echo");
+        sfb.create();
+
+        Object[] res = client.invoke("echo", new Object[] {"Hello"});
+        assertNotNull(res);
+        assertEquals(1, res.length);
+        assertEquals("Hello", res[0]);
+    }
+
+    private Destination getLocalDestination(String string) throws BusException, IOException {
+        DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class);
+
+        DestinationFactory df = dfm.getDestinationFactory(LocalTransportFactory.TRANSPORT_ID);
+        EndpointInfo ei = new EndpointInfo();
+        ei.setAddress(string);
+
+        return df.getDestination(ei);
+    }
+
+    private Conduit getLocalConduit(String string) throws BusException, IOException {
+        ConduitInitiatorManager cim = getBus().getExtension(ConduitInitiatorManager.class);
+
+        ConduitInitiator ci = cim.getConduitInitiator(LocalTransportFactory.TRANSPORT_ID);
+        EndpointInfo ei = new EndpointInfo();
+        ei.setAddress(string);
+        return ci.getConduit(ei);
+    }
+}

Propchange: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/object/src/test/java/org/apache/cxf/binding/object/ObjectBindingTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/pom.xml?view=diff&rev=524475&r1=524474&r2=524475
==============================================================================
--- incubator/cxf/trunk/rt/bindings/pom.xml (original)
+++ incubator/cxf/trunk/rt/bindings/pom.xml Sat Mar 31 13:17:23 2007
@@ -34,6 +34,7 @@
         <module>soap</module>
         <module>xml</module>
         <module>http</module>
+        <module>object</module>
     </modules>
 
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java?view=diff&rev=524475&r1=524474&r2=524475
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java Sat Mar 31 13:17:23 2007
@@ -60,7 +60,10 @@
      * @param message for which content shoul dbe closed.
      */    
     public void close(Message msg) throws IOException {
-        msg.getContent(OutputStream.class).close();        
+        OutputStream os = msg.getContent(OutputStream.class);
+        if (os != null) {
+            os.close();
+        }
     }
     
     /**

Modified: incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java?view=diff&rev=524475&r1=524474&r2=524475
==============================================================================
--- incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java (original)
+++ incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java Sat Mar 31 13:17:23 2007
@@ -63,15 +63,23 @@
             throw new IllegalStateException("Local destination does not have a MessageObserver on address " 
                                             + destination.getAddress().getAddress().getValue());
         }
+
+        MessageImpl copy = new MessageImpl();
+        copy.put(IN_CONDUIT, this);
+        copy.setDestination(destination);
         
-        message.put(IN_CONDUIT, this);
-        Exchange exchange = message.getExchange();
-        if (exchange == null) {
-            exchange = new ExchangeImpl();
-            exchange.setInMessage(message);
-        }
-        exchange.setDestination(destination);
-        destination.getMessageObserver().onMessage(message);
+        // copy all the contents
+        copy.putAll(message);
+        MessageImpl.copyContent(message, copy);
+        copy.remove(Message.REQUESTOR_ROLE);
+        
+        // Create a new incoming exchange and store the original exchange for the response
+        ExchangeImpl ex = new ExchangeImpl();
+        ex.setInMessage(copy);
+        ex.put(IN_EXCHANGE, message.getExchange());
+        ex.setDestination(destination);
+        
+        destination.getMessageObserver().onMessage(copy);
     }
 
     private void dispatchViaPipe(final Message message) throws IOException {

Modified: incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java?view=diff&rev=524475&r1=524474&r2=524475
==============================================================================
--- incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java (original)
+++ incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java Sat Mar 31 13:17:23 2007
@@ -37,13 +37,12 @@
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 
 public class LocalDestination extends AbstractDestination {
-    
+
     private static final Logger LOG = LogUtils.getL7dLogger(LocalDestination.class);
-    
+
     private LocalTransportFactory localDestinationFactory;
 
-    public LocalDestination(LocalTransportFactory localDestinationFactory,
-                            EndpointReferenceType epr,
+    public LocalDestination(LocalTransportFactory localDestinationFactory, EndpointReferenceType epr,
                             EndpointInfo ei) {
         super(epr, ei);
         this.localDestinationFactory = localDestinationFactory;
@@ -52,11 +51,11 @@
     public void shutdown() {
         localDestinationFactory.remove(this);
     }
-    
+
     protected Logger getLogger() {
         return LOG;
     }
-    
+
     @Override
     protected Conduit getInbuiltBackChannel(Message inMessage) {
         Conduit conduit = (Conduit)inMessage.get(LocalConduit.IN_CONDUIT);
@@ -75,9 +74,22 @@
         }
 
         public void send(final Message message) throws IOException {
+            final Exchange exchange = (Exchange)message.getExchange().get(LocalConduit.IN_EXCHANGE);
+            
+            if (Boolean.TRUE.equals(message.get(LocalConduit.DIRECT_DISPATCH))) {
+                MessageImpl copy = new MessageImpl();
+                copy.putAll(message);
+                MessageImpl.copyContent(message, copy);
+                
+                if (exchange.getInMessage() == null) {
+                    exchange.setInMessage(copy);
+                }
+                
+                conduit.getMessageObserver().onMessage(copy);
+                return;
+            }
 
             final PipedInputStream stream = new PipedInputStream();
-            final Exchange exchange = (Exchange)message.getExchange().get(LocalConduit.IN_EXCHANGE);
             final Runnable receiver = new Runnable() {
                 public void run() {
                     MessageImpl m = new MessageImpl();
@@ -94,9 +106,10 @@
 
             new Thread(receiver).start();
         }
-        
+
         protected Logger getLogger() {
             return LOG;
         }
     }
+    
 }



Mime
View raw message