activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r785345 - in /activemq/sandbox/activemq-flow: ./ activemq-all/src/test/resources/ activemq-broker/ activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/ activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/ activem...
Date Tue, 16 Jun 2009 19:14:57 GMT
Author: chirino
Date: Tue Jun 16 19:14:56 2009
New Revision: 785345

URL: http://svn.apache.org/viewvc?rev=785345&view=rev
Log:
More VMTransport fixes.  Eliminated a timeing issue with the test.  It also now properly sets
up the transport server to use the same wireformat that the
client transport is using.


Added:
    activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java
      - copied, changed from r785273, activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/TestWireFormatFactory.java
Removed:
    activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/TestWireFormatFactory.java
Modified:
    activemq/sandbox/activemq-flow/activemq-all/src/test/resources/activemq.xml
    activemq/sandbox/activemq-flow/activemq-broker/pom.xml
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/KahaDBStoreXml.java
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/MemoryStoreXml.java
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/StoreXml.java
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/VMTransportFactory.java
    activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/jaxb/JAXBConfigTest.java
    activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/vm/VMTransportTest.java
    activemq/sandbox/activemq-flow/activemq-broker/src/test/resources/org/apache/activemq/apollo/jaxb/testSimpleConfig.xml
    activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
    activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java
    activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java
    activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java
    activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java
    activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java
    activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java
    activemq/sandbox/activemq-flow/activemq-transport/src/test/java/org/apache/activemq/wireformat/mock/MockWireFormatFactory.java
    activemq/sandbox/activemq-flow/pom.xml

Modified: activemq/sandbox/activemq-flow/activemq-all/src/test/resources/activemq.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-all/src/test/resources/activemq.xml?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-all/src/test/resources/activemq.xml (original)
+++ activemq/sandbox/activemq-flow/activemq-all/src/test/resources/activemq.xml Tue Jun 16
19:14:56 2009
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker>
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
   <transport-server>tcp://localhost:61616?wireFormat=openwire</transport-server>
 

Modified: activemq/sandbox/activemq-flow/activemq-broker/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/pom.xml?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/pom.xml (original)
+++ activemq/sandbox/activemq-flow/activemq-broker/pom.xml Tue Jun 16 19:14:56 2009
@@ -93,6 +93,23 @@
   </dependencies>
 
   <build>
+  
+    <resources>
+      <resource>
+        <directory>target/schema</directory>
+        <includes>
+          <include>**/*</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>src/main/resources</directory>
+        <includes>
+          <include>**/*</include>
+        </includes>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+      
     <plugins>
 
       <!-- Generate a test jar for the test cases in this package -->
@@ -107,6 +124,27 @@
         </executions>
       </plugin>
 
+      <plugin>
+        <groupId>com.sun.tools.jxc.maven2</groupId>
+        <artifactId>maven-jaxb-schemagen-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>compile</phase>
+            <configuration>
+              <destdir>${project.build.directory}/schema</destdir>
+              <srcdir>${project.build.directory}/schema-src</srcdir>
+              <schemas>
+                <schema>
+                  <namespace>http://activemq.apache.org/schema/activemq/apollo</namespace>
+                  <file>activemq-apollo.xsd</file>
+                </schema>
+              </schemas>
+              <!--<verbose>false</verbose>-->
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>  
+
     </plugins>
   </build>
   

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/KahaDBStoreXml.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/KahaDBStoreXml.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/KahaDBStoreXml.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/KahaDBStoreXml.java
Tue Jun 16 19:14:56 2009
@@ -12,7 +12,7 @@
 
 @XmlRootElement(name="kahadb-store")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class KahaDBStoreXml implements StoreXml {
+public class KahaDBStoreXml extends StoreXml {
 
 	@XmlAttribute(name="checkpoint-interval", required=false)
 	private Long checkpointInterval;

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/MemoryStoreXml.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/MemoryStoreXml.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/MemoryStoreXml.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/MemoryStoreXml.java
Tue Jun 16 19:14:56 2009
@@ -9,7 +9,7 @@
 
 @XmlRootElement(name="memory-store")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class MemoryStoreXml implements StoreXml {
+public class MemoryStoreXml extends StoreXml {
 
 	public Store createStore() {
 		MemoryStore rc = new MemoryStore();

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/StoreXml.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/StoreXml.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/StoreXml.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/StoreXml.java
Tue Jun 16 19:14:56 2009
@@ -1,12 +1,12 @@
 package org.apache.activemq.apollo.jaxb;
 
-import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
 
 import org.apache.activemq.broker.store.Store;
 
-@XmlSeeAlso( {MemoryStoreXml.class, KahaDBStoreXml.class} )
-public interface StoreXml {
+@XmlType(name = "storeType")
+public abstract class StoreXml {
 
-	Store createStore();
+	abstract Store createStore();
 
 }

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java
Tue Jun 16 19:14:56 2009
@@ -20,9 +20,8 @@
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyElement;
 import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlElementRef;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@@ -49,19 +48,21 @@
     @XmlElement(name="host-name", required=true)
     private ArrayList<AsciiBuffer> hostNames = new ArrayList<AsciiBuffer>();
 
-    @XmlElementWrapper(name="store", required=false)
-    @XmlAnyElement
-    private ArrayList<StoreXml> store = new ArrayList<StoreXml>();
+    @XmlElementRef    
+    private StoreXml store;
     
 	public VirtualHost createVirtualHost(BrokerXml brokerXml) throws Exception {
 		VirtualHost rc = new VirtualHost();
 		rc.setHostNames(hostNames);
 		
-		if( !store.isEmpty() ) {
-			if( store.size() > 1 )  {
-				throw new Exception("Only one store is allowed.");
-			}
-			rc.setStore(store.get(0).createStore());
+//		if( !store.isEmpty() ) {
+//			if( store.size() > 1 )  {
+//				throw new Exception("Only one store is allowed.");
+//			}
+//			rc.setStore(store.get(0).createStore());
+//		}
+		if( store!=null ) {
+			rc.setStore(store.createStore());
 		}
 		return rc;
 	}

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/VMTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/VMTransportFactory.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/VMTransportFactory.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/VMTransportFactory.java
Tue Jun 16 19:14:56 2009
@@ -21,6 +21,7 @@
 import java.net.URISyntaxException;
 import java.net.UnknownHostException;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.apollo.broker.Broker;
@@ -57,18 +58,23 @@
 		private Broker broker;
 
 		@Override
-		protected PipeTransport cerateServerTransport(Pipe<Object> pipe) {
-			return new PipeTransport(pipe.connect()) {
+		protected PipeTransport createClientTransport(Pipe<Object> pipe) {
+			return new PipeTransport(pipe) {
+				AtomicBoolean started = new AtomicBoolean();
 				@Override
 				public void start() throws Exception {
-					refs.incrementAndGet();
-					super.start();
+					if( started.compareAndSet(false, true) ) { 
+						refs.incrementAndGet();
+						super.start();
+					}
 				}
 				@Override
 				public void stop() throws Exception {
-					super.stop();
-					if( refs.decrementAndGet() == 0 ) {
-						stopBroker();
+					if( started.compareAndSet(true, false) ) { 
+						super.stop();
+						if( refs.decrementAndGet() == 0 ) {
+							stopBroker();
+						}
 					}
 				}
 			};
@@ -93,6 +99,15 @@
 	private static final String DEFAULT_PIPE_NAME = Broker.DEFAULT_VIRTUAL_HOST_NAME.toString();
 
 	@Override
+	public Transport compositeConfigure(Transport transport, WireFormat format, Map options)
{
+		// Wishing right now the options would have been passed to the createTransport(URI location,
WireFormat wf) method so we did don't
+		// need to remove these here.
+		options.remove("create");
+		options.remove("broker");
+		return super.compositeConfigure(transport, format, options);
+	}
+	
+	@Override
     protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException,
IOException {
 		try {
 			
@@ -135,8 +150,9 @@
 				}
 				
 				// We want to use a vm transport server impl.
-				VmTransportServer vmTransportServer = (VmTransportServer) TransportFactory.bind(new URI("vm://"
+ name));
+				VmTransportServer vmTransportServer = (VmTransportServer) TransportFactory.bind(new URI("vm://"
+ name+"?wireFormat=mock"));
 				vmTransportServer.setBroker(broker);
+				vmTransportServer.setWireFormatFactory(wf.getWireFormatFactory());
 				broker.addTransportServer(vmTransportServer);
 				broker.start();
 				

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/jaxb/JAXBConfigTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/jaxb/JAXBConfigTest.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/jaxb/JAXBConfigTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/jaxb/JAXBConfigTest.java
Tue Jun 16 19:14:56 2009
@@ -51,7 +51,7 @@
 		
 		assertEquals(2, broker.getVirtualHosts().size());
 		
-		// assertNotNull(broker.getDefaultVirtualHost().getDatabase());
+//		 assertNotNull(broker.getDefaultVirtualHost().getDatabase());
 		
 	}
 

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/vm/VMTransportTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/vm/VMTransportTest.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/vm/VMTransportTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/vm/VMTransportTest.java
Tue Jun 16 19:14:56 2009
@@ -36,9 +36,9 @@
 	
 	public void testAutoCreateBroker() throws Exception {
 		Transport connect = TransportFactory.compositeConnect(new URI("vm://test?wireFormat=mock"));
+		connect.start();
 		assertNotNull(connect);
 		connect.stop();
-		System.out.println("done");
 	}
 	
 	public void testNoAutoCreateBroker() throws Exception {

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/test/resources/org/apache/activemq/apollo/jaxb/testSimpleConfig.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/test/resources/org/apache/activemq/apollo/jaxb/testSimpleConfig.xml?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/test/resources/org/apache/activemq/apollo/jaxb/testSimpleConfig.xml
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/test/resources/org/apache/activemq/apollo/jaxb/testSimpleConfig.xml
Tue Jun 16 19:14:56 2009
@@ -27,9 +27,7 @@
     <host-name>localhost</host-name>
     <host-name>test.localhost</host-name>
     
-    <store>
-      <memory-store/>
-    </store>
+    <memory-store/>
   </virtual-host>
   
 </broker>
\ No newline at end of file

Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
Tue Jun 16 19:14:56 2009
@@ -27,15 +27,16 @@
 import org.apache.activemq.command.CommandTypes;
 import org.apache.activemq.command.DataStructure;
 import org.apache.activemq.command.WireFormatInfo;
+import org.apache.activemq.transport.InactivityMonitor;
 import org.apache.activemq.transport.ResponseCorrelator;
 import org.apache.activemq.transport.Transport;
-import org.apache.activemq.transport.InactivityMonitor;
 import org.apache.activemq.transport.WireFormatNegotiator;
 import org.apache.activemq.util.ByteSequence;
 import org.apache.activemq.util.ByteSequenceData;
 import org.apache.activemq.util.DataByteArrayInputStream;
 import org.apache.activemq.util.DataByteArrayOutputStream;
 import org.apache.activemq.wireformat.WireFormat;
+import org.apache.activemq.wireformat.WireFormatFactory;
 
 /**
  * 
@@ -661,4 +662,8 @@
         transport = new ResponseCorrelator(transport);
         return transport;
     }
+
+	public WireFormatFactory getWireFormatFactory() {
+		return new OpenWireFormatFactory();
+	}
 }

Modified: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java
Tue Jun 16 19:14:56 2009
@@ -279,6 +279,10 @@
         public Transport createTransportFilters(Transport transport, Map options) {
            return transport;
         }
+
+		public WireFormatFactory getWireFormatFactory() {
+			return new Proto2WireFormatFactory();
+		}
     }
 
 	public WireFormat createWireFormat() {

Modified: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java
Tue Jun 16 19:14:56 2009
@@ -249,6 +249,10 @@
         public String getName() {
             return WIREFORMAT_NAME;
         }
+
+		public WireFormatFactory getWireFormatFactory() {
+			return new ProtoWireFormatFactory();
+		}
     }
 
 	public WireFormat createWireFormat() {

Modified: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java
Tue Jun 16 19:14:56 2009
@@ -31,6 +31,7 @@
 import org.apache.activemq.util.ByteArrayOutputStream;
 import org.apache.activemq.util.ByteSequence;
 import org.apache.activemq.wireformat.WireFormat;
+import org.apache.activemq.wireformat.WireFormatFactory;
 
 /**
  * Implements marshalling and unmarsalling the <a
@@ -221,4 +222,8 @@
         return transport;
     }
 
+	public WireFormatFactory getWireFormatFactory() {
+		return new StompWireFormatFactory();
+	}
+
 }

Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java
Tue Jun 16 19:14:56 2009
@@ -23,6 +23,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.activemq.transport.Transport;
@@ -127,7 +128,11 @@
         }
 
         public Transport createTransportFilters(Transport transport, Map options) {
-            return transport;
+        	if( wireFormat==null ) {
+        		return transport;
+        	} else {
+        		return wireFormat.createTransportFilters(transport, options);
+        	}
         }
 
         public String getName() {
@@ -137,9 +142,20 @@
                 return wireFormat.getName();
             }
         }
+
+		public WireFormatFactory getWireFormatFactory() {
+			return new MultiWireFormatFactory(wireFormatFactories);
+		}
+    }
+
+    public MultiWireFormatFactory() {
     }
+    
+    public MultiWireFormatFactory(List<WireFormatFactory> factories) {
+    	setWireFormatFactories(factories);
+	}
 
-    public WireFormat createWireFormat() {
+	public WireFormat createWireFormat() {
         MultiWireFormat rc = new MultiWireFormat();
         if (wireFormatFactories == null) {
             wireFormatFactories = new ArrayList<WireFormatFactory>();
@@ -199,6 +215,12 @@
     public int maxWireformatHeaderLength() {
         throw new UnsupportedOperationException();
     }
+	public List<WireFormatFactory> getWireFormatFactories() {
+		return new ArrayList<WireFormatFactory>(wireFormatFactories);
+	}
+	public void setWireFormatFactories(List<WireFormatFactory> wireFormatFactories) {
+		this.wireFormatFactories = new ArrayList<WireFormatFactory>(wireFormatFactories);
+	}
 
 
 }

Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java
Tue Jun 16 19:14:56 2009
@@ -90,4 +90,8 @@
     public Transport createTransportFilters(Transport transport, Map options) {
         return transport;
     }
+
+	public WireFormatFactory getWireFormatFactory() {
+		return new ObjectStreamWireFormatFactory();
+	}
 }

Copied: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java
(from r785273, activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/TestWireFormatFactory.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java?p2=activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java&p1=activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/TestWireFormatFactory.java&r1=785273&r2=785345&rev=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/TestWireFormatFactory.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java
Tue Jun 16 19:14:56 2009
@@ -1,11 +1,8 @@
-package org.apache.activemq.queue.perf;
+package org.apache.activemq.wireformat;
 
 import org.apache.activemq.util.ByteSequence;
-import org.apache.activemq.wireformat.ObjectStreamWireFormat;
-import org.apache.activemq.wireformat.WireFormat;
-import org.apache.activemq.wireformat.WireFormatFactory;
 
-public class TestWireFormatFactory implements WireFormatFactory {
+public class ObjectStreamWireFormatFactory implements WireFormatFactory {
 
 	public WireFormat createWireFormat() {
 		return new ObjectStreamWireFormat();

Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java
Tue Jun 16 19:14:56 2009
@@ -22,7 +22,6 @@
 import java.util.Map;
 
 import org.apache.activemq.transport.Transport;
-import org.apache.activemq.transport.TransportFilter;
 import org.apache.activemq.util.ByteSequence;
 
 
@@ -82,5 +81,10 @@
      * @return Either the given transport or a Transport filter wrapping the onw provided.

      */
     Transport createTransportFilters(Transport transport, Map options);
-    
+
+    /**
+     * Returns a WireFormatFactory which can create WireFormat of this type.
+     * @return
+     */
+    WireFormatFactory getWireFormatFactory();
 }

Modified: activemq/sandbox/activemq-flow/activemq-transport/src/test/java/org/apache/activemq/wireformat/mock/MockWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/test/java/org/apache/activemq/wireformat/mock/MockWireFormatFactory.java?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/test/java/org/apache/activemq/wireformat/mock/MockWireFormatFactory.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/test/java/org/apache/activemq/wireformat/mock/MockWireFormatFactory.java
Tue Jun 16 19:14:56 2009
@@ -47,6 +47,10 @@
 		public Object unmarshal(DataInput in) throws IOException {
 	        throw new UnsupportedOperationException();
 		}
+
+		public WireFormatFactory getWireFormatFactory() {
+			return new MockWireFormatFactory();
+		}
     }
 
 	public WireFormat createWireFormat() {

Modified: activemq/sandbox/activemq-flow/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/pom.xml?rev=785345&r1=785344&r2=785345&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/pom.xml (original)
+++ activemq/sandbox/activemq-flow/pom.xml Tue Jun 16 19:14:56 2009
@@ -811,6 +811,11 @@
     <pluginManagement>
       <plugins>
         <plugin>
+          <groupId>com.sun.tools.jxc.maven2</groupId>
+          <artifactId>maven-jaxb-schemagen-plugin</artifactId>
+          <version>1.3-dev</version>
+        </plugin>
+        <plugin>
           <groupId>ch.elca.el4j.maven.plugins</groupId>
           <artifactId>maven-depgraph-plugin</artifactId>
           <version>1.7</version>



Mime
View raw message