servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r798272 - in /servicemix/components/engines/servicemix-exec/trunk: ./ src/main/java/org/apache/servicemix/exec/ src/main/java/org/apache/servicemix/exec/marshaler/ src/test/java/org/apache/servicemix/exec/marshaler/
Date Mon, 27 Jul 2009 20:12:41 GMT
Author: jbonofre
Date: Mon Jul 27 20:12:40 2009
New Revision: 798272

URL: http://svn.apache.org/viewvc?rev=798272&view=rev
Log:
Generate the servicemix-exec WSDL using CXF on the marshaler interface.
Refactor the marshaler to be compliant with WSDL generation.

Modified:
    servicemix/components/engines/servicemix-exec/trunk/pom.xml
    servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java
    servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshaler.java
    servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/ExecMarshalerSupport.java
    servicemix/components/engines/servicemix-exec/trunk/src/test/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshalerTest.java

Modified: servicemix/components/engines/servicemix-exec/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-exec/trunk/pom.xml?rev=798272&r1=798271&r2=798272&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-exec/trunk/pom.xml (original)
+++ servicemix/components/engines/servicemix-exec/trunk/pom.xml Mon Jul 27 20:12:40 2009
@@ -137,6 +137,42 @@
 				</executions>
 			</plugin>
 			<plugin>
+			     <groupId>org.apache.cxf</groupId>
+			     <artifactId>cxf-java2ws-plugin</artifactId>
+			     <version>2.1.3</version>
+			     <dependencies>
+			         <dependency>
+			             <groupId>org.apache.cxf</groupId>
+			             <artifactId>cxf-rt-frontend-jaxws</artifactId>
+			             <version>2.1.3</version>
+			         </dependency>
+			         <dependency>
+			             <groupId>org.apache.cxf</groupId>
+			             <artifactId>cxf-rt-frontend-simple</artifactId>
+			             <version>2.1.3</version>
+			         </dependency>
+			     </dependencies>
+			     <executions>
+			         <execution>
+			             <id>process-classes</id>
+			             <phase>process-classes</phase>
+			             <configuration>
+			                 <className>org.apache.servicemix.exec.marshaler.ExecMarshalerSupport</className>
+			                 <outputFile>${project.build.directory}/generated/wsdl/servicemix-exec.wsdl</outputFile>
+			                 <servicename>servicemix-exec</servicename>
+			                 <targetNameSpace>http://servicemix.apache.org/exec</targetNameSpace>
+			                 <genWsdl>true</genWsdl>
+			                 <genClient>false</genClient>
+			                 <genServer>false</genServer>
+			                 <verbose>true</verbose>
+			             </configuration>
+			             <goals>
+			                 <goal>java2ws</goal>
+			             </goals>
+			         </execution>
+			     </executions>
+			</plugin>
+			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-surefire-plugin</artifactId>
 				<configuration>

Modified: servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java?rev=798272&r1=798271&r2=798272&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java
(original)
+++ servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java
Mon Jul 27 20:12:40 2009
@@ -27,6 +27,7 @@
 import org.apache.servicemix.exec.marshaler.ExecMarshalerSupport;
 import org.apache.servicemix.exec.utils.ExecUtils;
 import org.apache.servicemix.exec.utils.ExecutionData;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.jbi.jaxp.StringSource;
 import org.apache.servicemix.soap.util.DomUtil;
 import org.springframework.core.io.ClassPathResource;
@@ -158,7 +159,8 @@
 				// gets the in message
 				NormalizedMessage in = exchange.getMessage("in");
 				// parses the in message and get the execution command
-				exec = marshaler.constructExecCommand(in);
+				SourceTransformer transformer = new SourceTransformer();
+				exec = marshaler.constructExecCommand(transformer.toDOMDocument(in));
 			}
 
 			// fall back to static command if extracted is null or empty

Modified: servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshaler.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshaler.java?rev=798272&r1=798271&r2=798272&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshaler.java
(original)
+++ servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshaler.java
Mon Jul 27 20:12:40 2009
@@ -47,13 +47,9 @@
      * (non-Javadoc)
      * @see org.apache.servicemix.exec.marshaler.ExecMarshalerSupport#constructExecCommand(javax.jbi.messaging.NormalizedMessage)
      */
-    public String constructExecCommand(NormalizedMessage message) throws TransformerException
{
+    public String constructExecCommand(Document document) throws TransformerException {
         String execString = null;
-        // create a source transformer
-        SourceTransformer transformer = new SourceTransformer();
         try {
-            // transform the message content into a DOM document
-            Document document = transformer.toDOMDocument(message);
             document.getDocumentElement().normalize();
             
             // get the command node

Modified: servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/ExecMarshalerSupport.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/ExecMarshalerSupport.java?rev=798272&r1=798271&r2=798272&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/ExecMarshalerSupport.java
(original)
+++ servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/marshaler/ExecMarshalerSupport.java
Mon Jul 27 20:12:40 2009
@@ -16,10 +16,10 @@
  */
 package org.apache.servicemix.exec.marshaler;
 
-import javax.jbi.messaging.NormalizedMessage;
 import javax.xml.transform.TransformerException;
 
 import org.apache.servicemix.exec.utils.ExecutionData;
+import org.w3c.dom.Document;
 
 /**
  * This interface describes the behavior of an exec marshaler.
@@ -34,11 +34,11 @@
      * to constructs the execution command.
      * </p>
      * 
-     * @param message the <code>NormalizedMessage</code>.
+     * @param document the DOM contained in the <code>NormalizedMessage</code>.
      * @return the execution command.
      * @throws TransformerException in case of error during command construction.
      */
-    public String constructExecCommand(NormalizedMessage message) throws TransformerException;
+    public String constructExecCommand(Document document) throws TransformerException;
     
     /**
      * <p>

Modified: servicemix/components/engines/servicemix-exec/trunk/src/test/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshalerTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-exec/trunk/src/test/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshalerTest.java?rev=798272&r1=798271&r2=798272&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-exec/trunk/src/test/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshalerTest.java
(original)
+++ servicemix/components/engines/servicemix-exec/trunk/src/test/java/org/apache/servicemix/exec/marshaler/DefaultExecMarshalerTest.java
Mon Jul 27 20:12:40 2009
@@ -26,6 +26,7 @@
 
 import org.apache.servicemix.id.IdGenerator;
 import org.apache.servicemix.jbi.helper.MessageExchangePattern;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.jbi.jaxp.StringSource;
 import org.apache.servicemix.jbi.messaging.MessageExchangeFactoryImpl;
 
@@ -65,8 +66,8 @@
         NormalizedMessage message = exchange.createMessage();
         message.setContent(new StringSource(MSG_VALID));
         exchange.setMessage(message, "in");
-        
-        String execCommand = marshaler.constructExecCommand(message);
+        SourceTransformer transformer = new SourceTransformer();
+        String execCommand = marshaler.constructExecCommand(transformer.toDOMDocument(message));
         
         assertEquals("ls -lt /tmp", execCommand);
     }



Mime
View raw message