servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r430895 - in /incubator/servicemix/trunk/servicemix-jsr181: ./ src/main/java/org/apache/servicemix/jsr181/ src/test/java/org/apache/servicemix/jsr181/ src/test/java/test/ src/test/resources/org/apache/servicemix/jsr181/
Date Fri, 11 Aug 2006 21:00:22 GMT
Author: gnodet
Date: Fri Aug 11 14:00:22 2006
New Revision: 430895

URL: http://svn.apache.org/viewvc?rev=430895&view=rev
Log:
SM-535: Allow interface to be used with jsr181 annotations

Added:
    incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java
    incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring-proxy.xml
Modified:
    incubator/servicemix/trunk/servicemix-jsr181/pom.xml
    incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
    incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java

Modified: incubator/servicemix/trunk/servicemix-jsr181/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/pom.xml?rev=430895&r1=430894&r2=430895&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/pom.xml (original)
+++ incubator/servicemix/trunk/servicemix-jsr181/pom.xml Fri Aug 11 14:00:22 2006
@@ -152,7 +152,14 @@
           <serviceUnitAnalyzer>org.apache.servicemix.jsr181.packaging.Jsr181ServiceUnitAnalyzer</serviceUnitAnalyzer>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 
-</project>
\ No newline at end of file
+</project>

Modified: incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java?rev=430895&r1=430894&r2=430895&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
(original)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
Fri Aug 11 14:00:22 2006
@@ -232,6 +232,9 @@
         props.put(ObjectServiceFactory.PORT_TYPE, interfaceName);
         props.put(ObjectServiceFactory.STYLE, SoapConstants.STYLE_WRAPPED);
         props.put(ObjectServiceFactory.USE, SoapConstants.USE_LITERAL);
+        if (serviceInterface != null) {
+            props.put("annotations.allow.interface", "true");
+        }
         xfireService = factory.create(serviceClass, svcLocalName, svcNamespace, props);
         xfireService.setInvoker(new BeanInvoker(getPojo()));
         xfireService.setFaultSerializer(new JbiFaultSerializer(getConfiguration()));

Added: incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java?rev=430895&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java
(added)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java
Fri Aug 11 14:00:22 2006
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jsr181;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOut;
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.client.DefaultServiceMixClient;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+
+import test.Echo;
+
+public class Jsr181SpringProxyTest extends SpringTestSupport {
+
+    private static Log logger =  LogFactory.getLog(Jsr181ComponentTest.class);
+
+    public void test() throws Exception {
+        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
+        InOut me = client.createInOutExchange();
+        me.setInterfaceName(new QName("http://test", "EchoPortType"));
+        me.getInMessage().setContent(new StringSource("<echo xmlns='http://test'><echoin0>world</echoin0></echo>"));
+        client.sendSync(me);
+        if (me.getStatus() == ExchangeStatus.ERROR) {
+            if (me.getFault() != null) {
+                fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
+            } else if (me.getError() != null) {
+                throw me.getError();
+            } else {
+                fail("Received ERROR status");
+            }
+        } else {
+            logger.info(new SourceTransformer().toString(me.getOutMessage().getContent()));
+        }
+    }
+    
+    protected AbstractXmlApplicationContext createBeanFactory() {
+        return new ClassPathXmlApplicationContext("org/apache/servicemix/jsr181/spring-proxy.xml");
+    }
+    
+}

Modified: incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java?rev=430895&r1=430894&r2=430895&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java (original)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/test/java/test/Echo.java Fri Aug 11 14:00:22
2006
@@ -16,6 +16,9 @@
  */
 package test;
 
+import javax.jws.WebService;
+
+@WebService
 public interface Echo {
 
     public String echo(String input);

Added: incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring-proxy.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring-proxy.xml?rev=430895&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring-proxy.xml
(added)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring-proxy.xml
Fri Aug 11 14:00:22 2006
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns:sm="http://servicemix.apache.org/config/1.0" 
+	   xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
+       xmlns:test="http://test">
+
+  <!-- the JBI container -->
+  
+  <!-- START SNIPPET: dot -->
+  <sm:container id="jbi" embedded="true">
+    <sm:listeners>
+        <sm:dotViewEndpointListener file="target/ServiceMixComponents.dot"/>
+    </sm:listeners>
+    
+    <sm:activationSpecs>
+  <!-- END SNIPPET: dot -->
+
+      <!-- START SNIPPET: lightweight -->  
+      <sm:activationSpec>
+      	<sm:component>
+            <jsr181:component>
+            	<jsr181:endpoints>
+            		<jsr181:endpoint serviceInterface="test.Echo"
+  				   					 annotations="jsr181"
+                                     pojo="#pojo" />
+            	</jsr181:endpoints>
+            </jsr181:component>
+        </sm:component>
+      </sm:activationSpec>
+      <!-- END SNIPPET: lightweight -->  
+
+    </sm:activationSpecs>
+  </sm:container>
+  
+  <bean id="transactionAttributeSource" class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
+    <property name="properties">
+      <props>
+        <prop key="*">PROPAGATION_REQUIRED, -Throwable</prop>
+      </props>
+    </property>
+  </bean>
+ 
+  <bean id="transactionContextManager" class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
+  <bean id="userTransaction" class="org.jencks.factory.GeronimoTransactionManagerFactoryBean"
/>
+  <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
+    <property name="userTransaction" ref="userTransaction"/>
+  </bean>
+ 
+  <bean id="transactionTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
lazy-init="true">
+    <property name="transactionManager" ref="transactionManager" />
+    <property name="transactionAttributeSource" ref="transactionAttributeSource" />
+  </bean>
+ 
+  <bean id="pojo" parent="transactionTemplate">
+     <property name="target">
+        <bean class="test.EchoService2" />
+     </property>
+  </bean>
+
+  
+</beans>



Mime
View raw message