You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2007/10/09 18:12:24 UTC

svn commit: r583206 - in /incubator/servicemix/trunk/archetypes: ./ servicemix-archetypes-itests/ servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/ servicemix-binding-component/src/main/resources/META-INF/maven/ servicemix-bindi...

Author: gnodet
Date: Tue Oct  9 09:12:21 2007
New Revision: 583206

URL: http://svn.apache.org/viewvc?rev=583206&view=rev
Log:
Fix archetypes

Removed:
    incubator/servicemix/trunk/archetypes/servicemix-binding-component/src/main/resources/archetype-resources/src/main/java/MyBootstrap.java
    incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/archetype-resources/src/main/java/MyBootstrap.java
Modified:
    incubator/servicemix/trunk/archetypes/pom.xml
    incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml
    incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java
    incubator/servicemix/trunk/archetypes/servicemix-binding-component/src/main/resources/META-INF/maven/archetype.xml
    incubator/servicemix/trunk/archetypes/servicemix-camel-service-unit/pom.xml
    incubator/servicemix/trunk/archetypes/servicemix-embedded-simple/src/main/resources/archetype-resources/pom.xml
    incubator/servicemix/trunk/archetypes/servicemix-jsr181-annotated-service-unit/src/main/resources/META-INF/maven/archetype.xml
    incubator/servicemix/trunk/archetypes/servicemix-jsr181-wsdl-first-service-unit/src/main/resources/archetype-resources/pom.xml
    incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml
    incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/archetype-resources/src/main/java/MyEndpoint.java

Modified: incubator/servicemix/trunk/archetypes/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/pom.xml?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/pom.xml (original)
+++ incubator/servicemix/trunk/archetypes/pom.xml Tue Oct  9 09:12:21 2007
@@ -89,30 +89,6 @@
 						<camel-version>${camel-version}</camel-version>
 						<xfire-version>${xfire-version}</xfire-version>
 						<repositories><![CDATA[  
-  <pluginRepositories>
-    <pluginRepository>
-      <id>${releases-repo-id}</id>
-      <name>${releases-repo-name}</name>
-      <url>${releases-repo-url}</url>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-	</pluginRepository>
-	<pluginRepository>
-	  <id>${snapshots-repo-id}</id>
-	  <name>${snapshots-repo-name}</name>
-	  <url>${snapshots-repo-url}</url>
-	  <snapshots>
-	    <enabled>true</enabled>
-	  </snapshots>
-	  <releases>
-	    <enabled>false</enabled>
-	  </releases>
-	</pluginRepository>
-  </pluginRepositories>
   <repositories>
     <repository>
       <id>${releases-repo-id}</id>
@@ -137,6 +113,30 @@
       </releases>
     </repository>
   </repositories>
+  <pluginRepositories>
+    <pluginRepository>
+      <id>${releases-repo-id}</id>
+      <name>${releases-repo-name}</name>
+      <url>${releases-repo-url}</url>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+	</pluginRepository>
+	<pluginRepository>
+	  <id>${snapshots-repo-id}</id>
+	  <name>${snapshots-repo-name}</name>
+	  <url>${snapshots-repo-url}</url>
+	  <snapshots>
+	    <enabled>true</enabled>
+	  </snapshots>
+	  <releases>
+	    <enabled>false</enabled>
+	  </releases>
+	</pluginRepository>
+  </pluginRepositories>
 ]]></repositories>
 					</filters>
 				</configuration>

Modified: incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/pom.xml Tue Oct  9 09:12:21 2007
@@ -161,6 +161,62 @@
       <artifactId>servicemix-cxf-bc-service-unit</artifactId>
       <version>${servicemix-version}</version>
     </dependency>
+
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-bean</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-camel</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-cxf-bc</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-cxf-se</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-eip</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-ftp</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-http</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-jms</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-jsr181</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-lwcontainer</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-saxon</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
   </dependencies>
   
   <build>
@@ -180,6 +236,9 @@
             <include>**/*Test.*</include>
           </includes>
           <excludes>
+            <exclude>**/BindingComponentTest.java</exclude>
+            <exclude>**/ServiceEngineTest.java</exclude>
+            <exclude>**/Jsr181WsdlFirstServiceUnitTest.java</exclude>
           </excludes>
         </configuration>
       </plugin>

Modified: incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-archetypes-itests/src/test/java/org/apache/servicemix/tooling/AbstractArchetypeTest.java Tue Oct  9 09:12:21 2007
@@ -18,12 +18,14 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.reflect.Field;
 import java.net.URL;
 import java.util.Collections;
 import java.util.Properties;
 import java.util.UUID;
 
 import junit.framework.TestCase;
+import org.apache.maven.artifact.manager.WagonManager;
 import org.apache.maven.cli.ConsoleDownloadMonitor;
 import org.apache.maven.embedder.MavenEmbedder;
 import org.apache.maven.embedder.MavenEmbedderConsoleLogger;
@@ -52,12 +54,10 @@
         maven.setLogger(logger);
         maven.start();
 
-        /*
         Field f = maven.getClass().getDeclaredField("wagonManager");
         f.setAccessible(true);
         WagonManager wagon = (WagonManager) f.get(maven);
         wagon.setOnline(false);
-        */
         
         MavenProject project = maven.readProject(new File(baseDir, "pom.xml"));
         version = project.getVersion();
@@ -79,6 +79,7 @@
         targetDir.mkdirs();
         EventMonitor eventMonitor = new DefaultEventMonitor(new PlexusLoggerAdapter(
                         new MavenEmbedderConsoleLogger()));
+
         Properties props = new Properties();
         props.setProperty("archetypeGroupId", groupId);
         props.setProperty("archetypeArtifactId", artifactId);

Modified: incubator/servicemix/trunk/archetypes/servicemix-binding-component/src/main/resources/META-INF/maven/archetype.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-binding-component/src/main/resources/META-INF/maven/archetype.xml?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-binding-component/src/main/resources/META-INF/maven/archetype.xml (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-binding-component/src/main/resources/META-INF/maven/archetype.xml Tue Oct  9 09:12:21 2007
@@ -20,7 +20,6 @@
 <archetype>
   <id>servicemix-se</id>
   <sources>
-    <source>src/main/java/MyBootstrap.java</source>
     <source>src/main/java/MyComponent.java</source>
     <source>src/main/java/MyConsumerEndpoint.java</source>
     <source>src/main/java/MyEndpointType.java</source>

Modified: incubator/servicemix/trunk/archetypes/servicemix-camel-service-unit/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-camel-service-unit/pom.xml?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-camel-service-unit/pom.xml (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-camel-service-unit/pom.xml Tue Oct  9 09:12:21 2007
@@ -32,4 +32,13 @@
   <artifactId>servicemix-camel-service-unit</artifactId>
   <name>ServiceMix :: Archetypes :: CamelServiceUnit</name>
 
+  <dependencies>
+	<dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-maven-plugin</artifactId>
+      <version>${camel-version}</version>
+      <scope>test</scope>
+	</dependency>
+  </dependencies>
+
 </project>

Modified: incubator/servicemix/trunk/archetypes/servicemix-embedded-simple/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-embedded-simple/src/main/resources/archetype-resources/pom.xml?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-embedded-simple/src/main/resources/archetype-resources/pom.xml (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-embedded-simple/src/main/resources/archetype-resources/pom.xml Tue Oct  9 09:12:21 2007
@@ -30,6 +30,13 @@
     <xbean-version>@{xbean-version}</xbean-version>
     <servicemix-version>@{servicemix-version}</servicemix-version>
   </properties>
+  <dependencies>
+	<dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-core</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+  </dependencies>
   <build>
   	<resources>
       <resource>

Modified: incubator/servicemix/trunk/archetypes/servicemix-jsr181-annotated-service-unit/src/main/resources/META-INF/maven/archetype.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-jsr181-annotated-service-unit/src/main/resources/META-INF/maven/archetype.xml?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-jsr181-annotated-service-unit/src/main/resources/META-INF/maven/archetype.xml (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-jsr181-annotated-service-unit/src/main/resources/META-INF/maven/archetype.xml Tue Oct  9 09:12:21 2007
@@ -23,7 +23,6 @@
     <source>src/main/java/ExampleService.java</source>
   </sources>
   <resources>
-    <resource>src/main/resources/services.xml</resource>
     <resource>src/main/resources/xbean.xml</resource>   
   </resources>  
 </archetype>

Modified: incubator/servicemix/trunk/archetypes/servicemix-jsr181-wsdl-first-service-unit/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-jsr181-wsdl-first-service-unit/src/main/resources/archetype-resources/pom.xml?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-jsr181-wsdl-first-service-unit/src/main/resources/archetype-resources/pom.xml (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-jsr181-wsdl-first-service-unit/src/main/resources/archetype-resources/pom.xml Tue Oct  9 09:12:21 2007
@@ -48,7 +48,7 @@
 				</includes>
 			</resource>
 			<resource>
-				<directory>target/generated-sources</directory>
+				<directory>target/jaxws</directory>
 				<includes>
 					<include>**/*</include>
 				</includes>
@@ -71,9 +71,9 @@
             <phase>generate-sources</phase>
             <configuration>
               <wsdls>
-                <wsdl>${basedir}/src/main/resources/service.wsdl</wsdl>
+                <wsdl>src/main/resources/service.wsdl</wsdl>
               </wsdls>
-              <outputDirectory>${basedir}/target/jaxws</outputDirectory>
+              <outputDirectory>target/jaxws</outputDirectory>
               <profile>org.codehaus.xfire.jaxws.gen.JAXWSProfile</profile>
             </configuration>
             <goals>

Modified: incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/META-INF/maven/archetype.xml Tue Oct  9 09:12:21 2007
@@ -20,7 +20,6 @@
 <archetype>
   <id>servicemix-se</id>
   <sources>
-    <source>src/main/java/MyBootstrap.java</source>
     <source>src/main/java/MyComponent.java</source>
     <source>src/main/java/MyEndpoint.java</source>
   </sources>

Modified: incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/archetype-resources/src/main/java/MyEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/archetype-resources/src/main/java/MyEndpoint.java?rev=583206&r1=583205&r2=583206&view=diff
==============================================================================
--- incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/archetype-resources/src/main/java/MyEndpoint.java (original)
+++ incubator/servicemix/trunk/archetypes/servicemix-service-engine/src/main/resources/archetype-resources/src/main/java/MyEndpoint.java Tue Oct  9 09:12:21 2007
@@ -28,134 +28,20 @@
 import javax.jbi.messaging.NormalizedMessage;
 import javax.jbi.servicedesc.ServiceEndpoint;
 
-import org.apache.servicemix.common.BaseLifeCycle;
-import org.apache.servicemix.common.Endpoint;
-import org.apache.servicemix.common.ExchangeProcessor;
+import org.apache.servicemix.common.endpoints.ProviderEndpoint;
 
 /**
  * @org.apache.xbean.XBean element="endpoint"
  */
-public class MyEndpoint extends Endpoint implements ExchangeProcessor {
+public class MyEndpoint extends ProviderEndpoint {
 
-    private ServiceEndpoint activated;
-    private DeliveryChannel channel;
-    private MessageExchangeFactory exchangeFactory;
-    
-    /* (non-Javadoc)
-     * @see org.apache.servicemix.common.Endpoint#getRole()
-     */
-    public Role getRole() {
-        return Role.PROVIDER;
-    }
-
-    public void activate() throws Exception {
-        logger = this.serviceUnit.getComponent().getLogger();
-        ComponentContext ctx = getServiceUnit().getComponent().getComponentContext();
-        channel = ctx.getDeliveryChannel();
-        exchangeFactory = channel.createExchangeFactory();
-        activated = ctx.activateEndpoint(service, endpoint);
-        start();
-    }
-
-    public void deactivate() throws Exception {
-        stop();
-        ServiceEndpoint ep = activated;
-        activated = null;
-        ComponentContext ctx = getServiceUnit().getComponent().getComponentContext();
-        ctx.deactivateEndpoint(ep);
-    }
-
-    public ExchangeProcessor getProcessor() {
-        return this;
-    }
-    
     public void validate() throws DeploymentException {
     }
     
-    protected void send(MessageExchange me) throws MessagingException {
-        if (me.getRole() == MessageExchange.Role.CONSUMER &&
-            me.getStatus() == ExchangeStatus.ACTIVE) {
-            BaseLifeCycle lf = (BaseLifeCycle) getServiceUnit().getComponent().getLifeCycle();
-            lf.sendConsumerExchange(me, (Endpoint) this);
-        } else {
-            channel.send(me);
-        }
-    }
-    
-    protected void done(MessageExchange me) throws MessagingException {
-        me.setStatus(ExchangeStatus.DONE);
-        send(me);
-    }
-    
-    protected void fail(MessageExchange me, Exception error) throws MessagingException {
-        me.setError(error);
-        send(me);
-    }
-    
-    public void start() throws Exception {
-    }
-    
-    public void stop() {
-    }
-
-    public void process(MessageExchange exchange) throws Exception {
-        // The component acts as a provider, this means that another component has requested our service
-        // As this exchange is active, this is either an in or a fault (out are send by this component)
-        if (exchange.getRole() == MessageExchange.Role.PROVIDER) {
-            // Check here if the mep is supported by this component
-            if (exchange instanceof InOut == false) {
-               throw new UnsupportedOperationException("Unsupported MEP: " + exchange.getPattern());
-            }
-            // In message
-            if (exchange.getMessage("in") != null) {
-                NormalizedMessage in = exchange.getMessage("in");
-                // TODO ... handle the in message
-                // If the MEP is an InOnly, RobustInOnly, you have to set the exchange to DONE status
-                // else, you have to create an Out message and populate it
-                // For now, just echo back
-                NormalizedMessage out = exchange.createMessage();
-                out.setContent(in.getContent());
-                exchange.setMessage(out, "out");
-                channel.send(exchange);
-            // Fault message
-            } else if (exchange.getFault() != null) {
-                // TODO ... handle the fault
-                exchange.setStatus(ExchangeStatus.DONE);
-                channel.send(exchange);
-            // This is not compliant with the default MEPs
-            } else {
-                throw new IllegalStateException("Provider exchange is ACTIVE, but no in or fault is provided");
-            }
-        // The component acts as a consumer, this means this exchange is received because
-        // we sent it to another component.  As it is active, this is either an out or a fault
-        // If this component does not create / send exchanges, you may just throw an UnsupportedOperationException
-        } else if (exchange.getRole() == MessageExchange.Role.CONSUMER) {
-            // Exchange is finished
-            if (exchange.getStatus() == ExchangeStatus.DONE) {
-                return;
-            // Exchange has been aborted with an exception
-            } else if (exchange.getStatus() == ExchangeStatus.ERROR) {
-                return;
-            // Exchange is active
-            } else {
-                // Out message
-                if (exchange.getMessage("out") != null) {
-                    // TODO ... handle the response
-                    exchange.setStatus(ExchangeStatus.DONE);
-                    channel.send(exchange);
-                // Fault message
-                } else if (exchange.getFault() != null) {
-                    // TODO ... handle the fault
-                    exchange.setStatus(ExchangeStatus.DONE);
-                    channel.send(exchange);
-                // This is not compliant with the default MEPs
-                } else {
-                    throw new IllegalStateException("Consumer exchange is ACTIVE, but no out or fault is provided");
-                }
-            }
-        // Unknown role
-        } else {
-            throw new IllegalStateException("Unkown role: " + exchange.getRole());
+    protected void processInOut(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws Exception {
+	    if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
+            out.setContent(in.getContent());
+            getChannel().send(exchange);
         }
     }