avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scottca...@apache.org
Subject svn commit: r1242069 - in /avro/trunk: ./ lang/java/archetypes/ lang/java/archetypes/avro-service-archetype/ lang/java/archetypes/avro-service-archetype/src/main/pom/ lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/sr...
Date Wed, 08 Feb 2012 20:08:25 GMT
Author: scottcarey
Date: Wed Feb  8 20:08:24 2012
New Revision: 1242069

URL: http://svn.apache.org/viewvc?rev=1242069&view=rev
Log:
AVRO-1012. Java: Improve avro-service-archetype: POM and IT changes.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/archetypes/avro-service-archetype/pom.xml
    avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/pom/pom.xml
    avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/service/SimpleOrderService.java
    avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceClient.java
    avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceEndpoint.java
    avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/resources/logback.xml
    avro/trunk/lang/java/archetypes/pom.xml

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1242069&r1=1242068&r2=1242069&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Wed Feb  8 20:08:24 2012
@@ -62,6 +62,8 @@ Avro 1.6.2 (unreleased)
 
     AVRO-995. Java: Update Dependencies for 1.6.2. (scottcarey)
 
+    AVRO-1012. Java: Improve avro-service-archetype: POM and IT changes. (Lars Francke via
scottcarey)
+
   BUG FIXES
 
     AVRO-962. Java: Fix Maven plugin to support string type override.

Modified: avro/trunk/lang/java/archetypes/avro-service-archetype/pom.xml
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/archetypes/avro-service-archetype/pom.xml?rev=1242069&r1=1242068&r2=1242069&view=diff
==============================================================================
--- avro/trunk/lang/java/archetypes/avro-service-archetype/pom.xml (original)
+++ avro/trunk/lang/java/archetypes/avro-service-archetype/pom.xml Wed Feb  8 20:08:24 2012
@@ -33,4 +33,20 @@
   <name>Apache Avro Maven Service Archetype</name>
   <description>Archetype that generates a simple example Avro service</description>
 
+  <build>
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+      </resource>
+      <resource>
+        <targetPath>archetype-resources</targetPath>
+        <directory>target/generated-resources</directory>
+        <filtering>false</filtering>
+        <includes>
+          <include>pom.xml</include>
+        </includes>
+      </resource>
+    </resources>
+  </build>
+
 </project>

Modified: avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/pom/pom.xml
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/pom/pom.xml?rev=1242069&r1=1242068&r2=1242069&view=diff
==============================================================================
--- avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/pom/pom.xml (original)
+++ avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/pom/pom.xml Wed Feb  8
20:08:24 2012
@@ -27,11 +27,13 @@
   <name>Simple Avro Ordering Service</name>
 
   <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
     <avro.version>${project.version}</avro.version>
-    <jackson.version>1.8.4</jackson.version>
-    <junit.version>4.10</junit.version>
+    <jackson.version>${jackson.version}</jackson.version>
+    <junit.version>${junit.version}</junit.version>
     <logback.version>1.0.0</logback.version>
-    <slf4j.version>1.6.4</slf4j.version>
+    <slf4j.version>${slf4j.version}</slf4j.version>
   </properties>
 
   <dependencies>
@@ -79,7 +81,7 @@
       <plugin>
         <groupId>org.apache.avro</groupId>
         <artifactId>avro-maven-plugin</artifactId>
-        <version>${avro.version}</version>
+        <version>\${avro.version}</version>
         <executions>
           <execution>
             <goals>
@@ -99,7 +101,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.9</version>
+        <version>${surefire-plugin.version}</version>
         <configuration>
           <excludes>
             <exclude>%regex[.*.integration.*]</exclude>
@@ -108,7 +110,7 @@
       </plugin>
       <plugin>
         <artifactId>maven-failsafe-plugin</artifactId>
-        <version>2.6</version>
+        <version>${surefire-plugin.version}</version>
         <executions>
           <execution>
             <goals>
@@ -126,7 +128,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.3.2</version>
+        <version>${compiler-plugin.version}</version>
         <configuration>
           <source>1.6</source>
           <target>1.6</target>

Modified: avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/service/SimpleOrderService.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/service/SimpleOrderService.java?rev=1242069&r1=1242068&r2=1242069&view=diff
==============================================================================
--- avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/service/SimpleOrderService.java
(original)
+++ avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/service/SimpleOrderService.java
Wed Feb  8 20:08:24 2012
@@ -25,26 +25,21 @@ import org.apache.avro.AvroRemoteExcepti
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import ${package}.service.Confirmation;
-import ${package}.service.Order;
-import ${package}.service.OrderFailure;
-import ${package}.service.OrderProcessingService;
-
 /**
- * <code>SimpleOrderService</code> is a simple example implementation of an Avro
service generated from the
- * order-service.avpr protocol definition. 
+ * {@code SimpleOrderService} is a simple example implementation of an Avro service generated
from the
+ * order-service.avpr protocol definition.
  */
 public class SimpleOrderService implements OrderProcessingService {
 
 	private Logger log = LoggerFactory.getLogger(SimpleOrderService.class);
 
-	@Override
-	public Confirmation submitOrder(Order order) throws AvroRemoteException, OrderFailure {
-		log.info("Received order for '{}' items from customer with id '{}'",
-				new Object[] {order.getOrderItems().size(), order.getCustomerId() });
+  @Override
+  public Confirmation submitOrder(Order order) throws AvroRemoteException, OrderFailure {
+    log.info("Received order for '{}' items from customer with id '{}'",
+      new Object[] {order.getOrderItems().size(), order.getCustomerId()});
 
-		long estimatedCompletion = System.currentTimeMillis() + (5 * 60 * 60);
-		return Confirmation.newBuilder().setCustomerId(order.getCustomerId())
-				.setEstimatedCompletion(estimatedCompletion).setOrderId(order.getOrderId()).build();
-	}
+    long estimatedCompletion = System.currentTimeMillis() + (5 * 60 * 60);
+    return Confirmation.newBuilder().setCustomerId(order.getCustomerId()).setEstimatedCompletion(estimatedCompletion)
+      .setOrderId(order.getOrderId()).build();
+  }
 }

Modified: avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceClient.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceClient.java?rev=1242069&r1=1242068&r2=1242069&view=diff
==============================================================================
--- avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceClient.java
(original)
+++ avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceClient.java
Wed Feb  8 20:08:24 2012
@@ -37,43 +37,43 @@ import ${package}.service.OrderFailure;
 import ${package}.service.OrderProcessingService;
 
 /**
- * <code>SimpleOrderServiceClient</code> is a basic client for the Netty backed
{@link OrderProcessingService}
+ * {@code SimpleOrderServiceClient} is a basic client for the Netty backed {@link OrderProcessingService}
  * implementation.
  */
 public class SimpleOrderServiceClient implements OrderProcessingService {
 
-	private static final Logger log = LoggerFactory.getLogger(SimpleOrderServiceEndpoint.class);
+  private static final Logger log = LoggerFactory.getLogger(SimpleOrderServiceEndpoint.class);
 
-	private InetSocketAddress endpointAddress;
+  private InetSocketAddress endpointAddress;
 
-	private Transceiver transceiver;
+  private Transceiver transceiver;
 
-	private OrderProcessingService service;
+  private OrderProcessingService service;
 
-	public SimpleOrderServiceClient(InetSocketAddress endpointAddress) {
-		this.endpointAddress = endpointAddress;
-	}
-
-	public synchronized void start() throws IOException {
-		if (log.isInfoEnabled()) {
-			log.info("Starting Simple Ordering Netty client on '{}'", endpointAddress);
-		}
-		transceiver = new NettyTransceiver(endpointAddress);
-		service = SpecificRequestor.getClient(OrderProcessingService.class, transceiver);
-	}
-
-	public void stop() throws IOException {
-		if (log.isInfoEnabled()) {
-			log.info("Stopping Simple Ordering Netty client on '{}'", endpointAddress);
-		}
-		if (transceiver != null && transceiver.isConnected()) {
-			transceiver.close();
-		}
-	}
-
-	@Override
-	public Confirmation submitOrder(Order order) throws AvroRemoteException, OrderFailure {
-		return service.submitOrder(order);
-	}
+  public SimpleOrderServiceClient(InetSocketAddress endpointAddress) {
+    this.endpointAddress = endpointAddress;
+  }
+
+  public synchronized void start() throws IOException {
+    if (log.isInfoEnabled()) {
+      log.info("Starting Simple Ordering Netty client on '{}'", endpointAddress);
+    }
+    transceiver = new NettyTransceiver(endpointAddress);
+    service = SpecificRequestor.getClient(OrderProcessingService.class, transceiver);
+  }
+
+  public void stop() throws IOException {
+    if (log.isInfoEnabled()) {
+      log.info("Stopping Simple Ordering Netty client on '{}'", endpointAddress);
+    }
+    if (transceiver != null && transceiver.isConnected()) {
+      transceiver.close();
+    }
+  }
+
+  @Override
+  public Confirmation submitOrder(Order order) throws AvroRemoteException, OrderFailure {
+    return service.submitOrder(order);
+  }
 
 }

Modified: avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceEndpoint.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceEndpoint.java?rev=1242069&r1=1242068&r2=1242069&view=diff
==============================================================================
--- avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceEndpoint.java
(original)
+++ avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceEndpoint.java
Wed Feb  8 20:08:24 2012
@@ -33,35 +33,35 @@ import org.slf4j.LoggerFactory;
 import ${package}.service.OrderProcessingService;
 
 /**
- * <code>SimpleOrderProcessingServer</code> provides a very basic example Netty
endpoint for the
+ * {@code SimpleOrderProcessingServer} provides a very basic example Netty endpoint for the
  * {@link SimpleOrderService} implementation
  */
 public class SimpleOrderServiceEndpoint {
 
-	private static final Logger log = LoggerFactory.getLogger(SimpleOrderServiceEndpoint.class);
+  private static final Logger log = LoggerFactory.getLogger(SimpleOrderServiceEndpoint.class);
 
-	private InetSocketAddress endpointAddress;
-	
-	private Server service;
-	
-	public SimpleOrderServiceEndpoint(InetSocketAddress endpointAddress) {
-		this.endpointAddress = endpointAddress;
-	}
-	
-	public synchronized void start() throws Exception {
-		if (log.isInfoEnabled()) {
-			log.info("Starting Simple Ordering Netty Server on '{}'", endpointAddress);
-		}
-		
-		SpecificResponder responder = new SpecificResponder(OrderProcessingService.class, new SimpleOrderService());
-		service = new NettyServer(responder, endpointAddress);
-		service.start();
-	}
-
-	public synchronized void stop() throws Exception {
-		if (log.isInfoEnabled()) {
-			log.info("Stopping Simple Ordering Server on '{}'", endpointAddress);
-		}
-		service.start();
-	}
+  private InetSocketAddress endpointAddress;
+
+  private Server service;
+
+  public SimpleOrderServiceEndpoint(InetSocketAddress endpointAddress) {
+    this.endpointAddress = endpointAddress;
+  }
+
+  public synchronized void start() throws Exception {
+    if (log.isInfoEnabled()) {
+      log.info("Starting Simple Ordering Netty Server on '{}'", endpointAddress);
+    }
+
+    SpecificResponder responder = new SpecificResponder(OrderProcessingService.class, new
SimpleOrderService());
+    service = new NettyServer(responder, endpointAddress);
+    service.start();
+  }
+
+  public synchronized void stop() throws Exception {
+    if (log.isInfoEnabled()) {
+      log.info("Stopping Simple Ordering Server on '{}'", endpointAddress);
+    }
+    service.start();
+  }
 }

Modified: avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/resources/logback.xml
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/resources/logback.xml?rev=1242069&r1=1242068&r2=1242069&view=diff
==============================================================================
--- avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/resources/logback.xml
(original)
+++ avro/trunk/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/resources/logback.xml
Wed Feb  8 20:08:24 2012
@@ -1,6 +1,7 @@
 #set( $symbol_pound = '#' )
 #set( $symbol_dollar = '$' )
 #set( $symbol_escape = '\' )
+<?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
@@ -17,9 +18,8 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration> 
-  <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> 
+<configuration>
+  <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
     <encoder>
       <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
     </encoder>

Modified: avro/trunk/lang/java/archetypes/pom.xml
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/archetypes/pom.xml?rev=1242069&r1=1242068&r2=1242069&view=diff
==============================================================================
--- avro/trunk/lang/java/archetypes/pom.xml (original)
+++ avro/trunk/lang/java/archetypes/pom.xml Wed Feb  8 20:08:24 2012
@@ -68,9 +68,9 @@
             <goals>
               <goal>copy-resources</goal>
             </goals>
-            <phase>validate</phase>
+            <phase>generate-resources</phase>
             <configuration>
-              <outputDirectory>src/main/resources/archetype-resources</outputDirectory>
+              <outputDirectory>target/generated-resources</outputDirectory>
               <escapeString>\</escapeString>
               <resources>
                 <resource>



Mime
View raw message