activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r784883 - in /activemq/sandbox/activemq-flow: activemq-all/src/test/java/org/apache/activemq/legacy/ activemq-bio/src/main/java/org/apache/activemq/transport/tcp/ activemq-broker/src/main/java/org/apache/activemq/apollo/broker/ activemq-bro...
Date Mon, 15 Jun 2009 17:44:50 GMT
Author: chirino
Date: Mon Jun 15 17:44:49 2009
New Revision: 784883

URL: http://svn.apache.org/viewvc?rev=784883&view=rev
Log:
- SslContext is a data holder that can be shared across modules so move it into util for now.
- Started a vm transport impl.
- Starting to move client test cases into the client module.


Added:
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/VMTransportFactory.java
  (with props)
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/package.html
  (with props)
    activemq/sandbox/activemq-flow/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/
    activemq/sandbox/activemq-flow/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/vm
    activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/
    activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/vm/
    activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/vm/VMTransportTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/ActiveMQConnectionFactoryTest.java
      - copied unchanged from r784806, activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/ActiveMQConnectionFactoryTest.java
    activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SslContext.java
      - copied, changed from r784806, activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/broker/SslContext.java
Removed:
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/ActiveMQConnectionFactoryTest.java
    activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/broker/SslContext.java
Modified:
    activemq/sandbox/activemq-flow/activemq-bio/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/VirtualHost.java
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/legacy/broker/BrokerService.java
    activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java
    activemq/sandbox/activemq-flow/activemq-network/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
    activemq/sandbox/activemq-flow/activemq-spring/src/main/java/org/apache/activemq/spring/SpringSslContext.java
    activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java
    activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java
    activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java

Modified: activemq/sandbox/activemq-flow/activemq-bio/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-bio/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-bio/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-bio/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
Mon Jun 15 17:44:49 2009
@@ -31,11 +31,11 @@
 import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.TrustManager;
 
-import org.apache.activemq.broker.SslContext;
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.TransportServer;
 import org.apache.activemq.util.IOExceptionSupport;
 import org.apache.activemq.util.IntrospectionSupport;
+import org.apache.activemq.util.SslContext;
 import org.apache.activemq.util.URISupport;
 import org.apache.activemq.wireformat.WireFormat;
 import org.apache.commons.logging.Log;
@@ -177,8 +177,8 @@
      * @param tm
      * @param random
      * @deprecated "Do not use anymore... using static initializers like this method only
allows the JVM to use 1 SSL configuration per broker."
-     * @see org.apache.activemq.broker.SslContext#setCurrentSslContext(SslContext)
-     * @see org.apache.activemq.broker.SslContext#getSSLContext()
+     * @see org.apache.activemq.util.SslContext#setCurrentSslContext(SslContext)
+     * @see org.apache.activemq.util.SslContext#getSSLContext()
      */
     public void setKeyAndTrustManagers(KeyManager[] km, TrustManager[] tm, SecureRandom random)
{
         SslContext ctx = new SslContext(km, tm, random);

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java
Mon Jun 15 17:44:49 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.apollo.broker;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.LinkedHashMap;
@@ -31,6 +32,7 @@
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.TransportAcceptListener;
 import org.apache.activemq.transport.TransportServer;
+import org.apache.activemq.util.IOHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -50,6 +52,7 @@
     private final LinkedHashMap<AsciiBuffer, VirtualHost> virtualHosts = new LinkedHashMap<AsciiBuffer,
VirtualHost>();
     private VirtualHost defaultVirtualHost;
     private IDispatcher dispatcher;
+    private File dataDirectory;
     
     private final class BrokerAcceptListener implements TransportAcceptListener {
 		public void onAccept(final Transport transport) {
@@ -114,6 +117,10 @@
 		if ( state.get()!=State.CONFIGURATION ) {
     		throw new IllegalStateException("Can only start a broker that is in the "+State.CONFIGURATION
+" state.  Broker was "+state.get());
     	}
+		
+		if( dataDirectory == null ) {
+			dataDirectory = new File(IOHelper.getDefaultDataDirectory());
+		}
 
 		addVirtualHost(getDefaultVirtualHost());
 
@@ -153,6 +160,7 @@
     		// we need to handle failure during the startup to avoid 
     		// a partially started up broker.
         	state.set(State.UNKNOWN);
+        	throw e;
     	}
         
     }
@@ -386,5 +394,13 @@
 	public String getName() {
 		return getDefaultVirtualHost().getHostName().toString();
 	}
+
+	public File getDataDirectory() {
+		return dataDirectory;
+	}
+
+	public void setDataDirectory(File dataDirectory) {
+		this.dataDirectory = dataDirectory;
+	}
    
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/VirtualHost.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/VirtualHost.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/VirtualHost.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/VirtualHost.java
Mon Jun 15 17:44:49 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.apollo.broker;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -28,6 +29,7 @@
 import org.apache.activemq.queue.AbstractFlowQueue;
 import org.apache.activemq.queue.ExclusivePersistentQueue;
 import org.apache.activemq.queue.IQueue;
+import org.apache.activemq.util.IOHelper;
 
 /**
  * @author chirino
@@ -55,7 +57,7 @@
 
 	public AsciiBuffer getHostName() {
         if (hostNames.size() > 0) {
-            hostNames.get(0);
+        	return hostNames.get(0);
         }
         return null;
     }
@@ -95,8 +97,15 @@
 
 		if ( database == null ) {
 			Store store = StoreFactory.createStore("kaha-db");
+			if( store.getStoreDirectory() == null ) {
+				File baseDir = broker.getDataDirectory();
+				String hostName = getHostName().toString();
+				String subDir = IOHelper.toFileSystemDirectorySafeName(hostName);
+				store.setStoreDirectory( new File(baseDir, subDir ) );
+			}
 			database = new BrokerDatabase(store);
 		}
+		
 	    database.setDispatcher(broker.getDispatcher());
 	    database.start();
 

Added: 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=784883&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/VMTransportFactory.java
(added)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/VMTransportFactory.java
Mon Jun 15 17:44:49 2009
@@ -0,0 +1,156 @@
+/**
+ * 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.activemq.apollo.transport.vm;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.activemq.apollo.broker.Broker;
+import org.apache.activemq.apollo.broker.BrokerFactory;
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.transport.TransportFactory;
+import org.apache.activemq.transport.TransportServer;
+import org.apache.activemq.transport.pipe.Pipe;
+import org.apache.activemq.transport.pipe.PipeTransportFactory;
+import org.apache.activemq.util.URISupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Implements the vm transport which behaves like the pipe transport except that
+ * it can start embedded brokers up on demand.  
+ * 
+ * @author chirino
+ *
+ */
+public class VMTransportFactory extends PipeTransportFactory {
+	static final private Log LOG = LogFactory.getLog(VMTransportFactory.class);
+	
+	/**
+	 * This extension of the PipeTransportServer shuts down the broker
+	 * when all the connections are disconnected.
+	 * 
+	 * @author chirino
+	 */
+	private final class VmTransportServer extends PipeTransportServer {
+		private final AtomicInteger refs = new AtomicInteger();
+		private Broker broker;
+
+		@Override
+		protected PipeTransport cerateServerTransport(Pipe<Object> pipe) {
+			return new PipeTransport(pipe.connect()) {
+				@Override
+				public void start() throws Exception {
+					refs.incrementAndGet();
+					super.start();
+				}
+				@Override
+				public void stop() throws Exception {
+					super.stop();
+					if( refs.decrementAndGet() == 0 ) {
+						stopBroker();
+					}
+				}
+			};
+		}
+
+		public void setBroker(Broker broker) {
+			this.broker = broker;
+		}
+		
+		private void stopBroker() {
+			try {
+				this.broker.stop();
+			} catch (Exception e) {
+				LOG.error("Failed to stop the broker gracefully: "+e);
+				LOG.debug("Failed to stop the broker gracefully: ", e);
+			}
+		}
+	}
+
+
+	private static final String DEFAULT_PIPE_NAME = Broker.DEFAULT_VIRTUAL_HOST_NAME.toString();
+
+	@Override
+	synchronized public Transport doCompositeConnect(URI location) throws Exception {
+
+		String brokerURI = null;
+		String name;
+		boolean create = true;
+
+		name = location.getHost();
+		if (name == null) {
+			name = DEFAULT_PIPE_NAME;
+		}
+
+		Map<String, String> options = URISupport.parseParamters(location);
+		String config = (String) options.remove("broker");
+		if (config != null) {
+			brokerURI = config;
+		}
+		if ("false".equals(options.remove("create"))) {
+			create = false;
+		}
+		if( !options.isEmpty() ) {
+			throw new IllegalArgumentException("Unrecognized vm transport parameters: "+options.keySet());
+		}
+
+
+		PipeTransportServer server = servers.get(name);
+		if (server == null && create) {
+			
+			// Create the broker on demand.
+			Broker broker;
+			if( brokerURI == null ) {
+				broker = new Broker();
+			} else {
+				broker = BrokerFactory.createBroker(brokerURI);
+			}
+			
+			// Remove the existing pipe severs if the broker is configured with one...  we want to
make sure it 
+			// uses the one we explicitly configure here.
+			for (TransportServer s : broker.getTransportServers()) {
+				if (s instanceof PipeTransportServer && name.equals(((PipeTransportServer) s).getName()))
{
+					broker.removeTransportServer(s);
+				}
+			}
+			
+			// We want to use a vm transport server impl.
+			VmTransportServer vmTransportServer = (VmTransportServer) TransportFactory.bind(new URI("vm://"
+ name));
+			vmTransportServer.setBroker(broker);
+			broker.addTransportServer(vmTransportServer);
+			broker.start();
+			
+			server = servers.get(name);
+		}
+
+		if (server == null) {
+			throw new IOException("Server is not bound: " + name);
+		}
+		
+		return server.connect();
+	}
+
+
+	@Override
+	protected PipeTransportServer createTransportServer() {
+		return new VmTransportServer();
+	}
+		
+}

Propchange: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/VMTransportFactory.java
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/package.html
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/package.html?rev=784883&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/package.html
(added)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/package.html
Mon Jun 15 17:44:49 2009
@@ -0,0 +1,25 @@
+<!--
+    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.
+-->
+<html>
+<head>
+</head>
+<body>
+
+In-JVM based Transport implementation.
+
+</body>
+</html>

Propchange: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/transport/vm/package.html
------------------------------------------------------------------------------
    svn:executable = *

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/legacy/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/legacy/broker/BrokerService.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/legacy/broker/BrokerService.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/legacy/broker/BrokerService.java
Mon Jun 15 17:44:49 2009
@@ -24,10 +24,10 @@
 import javax.net.ssl.TrustManager;
 
 import org.apache.activemq.Service;
-import org.apache.activemq.broker.SslContext;
 import org.apache.activemq.legacy.broker.region.RegionBroker;
 import org.apache.activemq.legacy.store.PersistenceAdapter;
 import org.apache.activemq.legacy.usage.SystemUsage;
+import org.apache.activemq.util.SslContext;
 
 /**
  * @deprecated The entire 'org.apache.activemq.legacy' package will hopefully go away soon.

Added: activemq/sandbox/activemq-flow/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/vm
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/vm?rev=784883&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/vm
(added)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/vm
Mon Jun 15 17:44:49 2009
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+class=org.apache.activemq.apollo.transport.vm.VMTransportFactory

Added: 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=784883&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/vm/VMTransportTest.java
(added)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/test/java/org/apache/activemq/apollo/transport/vm/VMTransportTest.java
Mon Jun 15 17:44:49 2009
@@ -0,0 +1,40 @@
+/**
+ * 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.activemq.apollo.transport.vm;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.transport.TransportFactory;
+
+/**
+ * 
+ * @author chirino
+ */
+public class VMTransportTest extends TestCase {
+
+	
+	public void testAutoCreateBroker() throws Exception {
+		
+		Transport connect = TransportFactory.compositeConnect(new URI("vm://test"));
+		assertNotNull(connect);
+		
+	}
+	
+}

Modified: activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java
Mon Jun 15 17:44:49 2009
@@ -1140,6 +1140,9 @@
         return directory;
     }
 
+	public File getStoreDirectory() {
+		return directory;
+	}
     public void setStoreDirectory(File directory) {
         this.directory = directory;
     }
@@ -1222,4 +1225,5 @@
         this.failIfDatabaseIsLocked = failIfDatabaseIsLocked;
     }
 
+
 }

Modified: activemq/sandbox/activemq-flow/activemq-network/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-network/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-network/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-network/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
Mon Jun 15 17:44:49 2009
@@ -22,7 +22,6 @@
 import java.util.Iterator;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.activemq.broker.SslContext;
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.TransportFactory;
 import org.apache.activemq.transport.discovery.DiscoveryAgent;
@@ -31,6 +30,7 @@
 import org.apache.activemq.transport.discovery.DiscoveryListener;
 import org.apache.activemq.util.ServiceStopper;
 import org.apache.activemq.util.ServiceSupport;
+import org.apache.activemq.util.SslContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

Modified: activemq/sandbox/activemq-flow/activemq-spring/src/main/java/org/apache/activemq/spring/SpringSslContext.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-spring/src/main/java/org/apache/activemq/spring/SpringSslContext.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-spring/src/main/java/org/apache/activemq/spring/SpringSslContext.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-spring/src/main/java/org/apache/activemq/spring/SpringSslContext.java
Mon Jun 15 17:44:49 2009
@@ -29,7 +29,7 @@
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
 
-import org.apache.activemq.broker.SslContext;
+import org.apache.activemq.util.SslContext;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.core.io.Resource;
 

Modified: activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java
Mon Jun 15 17:44:49 2009
@@ -99,6 +99,12 @@
     public void setStoreDirectory(File directory);
 
     /**
+     * Gets the store's root directory;
+     */ 
+    public File getStoreDirectory();
+
+    
+    /**
      * Indicates that all messages should be deleted on startup
      * 
      * @param val

Modified: activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java
Mon Jun 15 17:44:49 2009
@@ -593,9 +593,14 @@
         // NOOP
     }
 
-    public void setDeleteAllMessages(boolean val) {
+	public File getStoreDirectory() {
+		return null;
+	}
+
+	public void setDeleteAllMessages(boolean val) {
         // TODO Auto-generated method stub
 
     }
 
+
 }

Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java?rev=784883&r1=784882&r2=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java
Mon Jun 15 17:44:49 2009
@@ -31,10 +31,9 @@
 
 public class PipeTransportFactory extends TransportFactory {
 
-    private final HashMap<String, PipeTransportServer> servers = new HashMap<String,
PipeTransportServer>();
-    static final AtomicInteger connectionCounter = new AtomicInteger();
+    protected final HashMap<String, PipeTransportServer> servers = new HashMap<String,
PipeTransportServer>();
 
-    private static class PipeTransport implements DispatchableTransport, Dispatchable, Runnable,
ReadReadyListener<Object> {
+    protected static class PipeTransport implements DispatchableTransport, Dispatchable,
Runnable, ReadReadyListener<Object> {
 
         private final Pipe<Object> pipe;
         private TransportListener listener;
@@ -208,11 +207,12 @@
         }
     }
 
-    private class PipeTransportServer implements TransportServer {
-        private URI connectURI;
-        private TransportAcceptListener listener;
-        private String name;
-        private WireFormatFactory wireFormatFactory;
+    protected class PipeTransportServer implements TransportServer {
+    	protected URI connectURI;
+        protected TransportAcceptListener listener;
+        protected String name;
+        protected WireFormatFactory wireFormatFactory;
+        protected final AtomicInteger connectionCounter = new AtomicInteger();
 
         public URI getConnectURI() {
             return connectURI;
@@ -250,9 +250,9 @@
             String remoteAddress = connectURI.toString() + "#" + connectionId;
             assert listener != null : "Server does not have an accept listener";
             Pipe<Object> pipe = new Pipe<Object>();
-            PipeTransport rc = new PipeTransport(pipe);
+            PipeTransport rc = createClientTransport(pipe);
             rc.setRemoteAddress(remoteAddress);
-            PipeTransport serverSide = new PipeTransport(pipe.connect());
+            PipeTransport serverSide = cerateServerTransport(pipe);
             serverSide.setRemoteAddress(remoteAddress);
             if (wireFormatFactory != null) {
                 rc.setWireFormat(wireFormatFactory.createWireFormat());
@@ -262,6 +262,14 @@
             return rc;
         }
 
+		protected PipeTransport createClientTransport(Pipe<Object> pipe) {
+			return new PipeTransport(pipe);
+		}
+
+		protected PipeTransport cerateServerTransport(Pipe<Object> pipe) {
+			return new PipeTransport(pipe.connect());
+		}
+
         public void setWireFormatFactory(WireFormatFactory wireFormatFactory) {
             this.wireFormatFactory = wireFormatFactory;
         }
@@ -276,7 +284,7 @@
             if (servers.containsKey(node)) {
                 throw new IOException("Server already bound: " + node);
             }
-            PipeTransportServer server = new PipeTransportServer();
+            PipeTransportServer server = createTransportServer();
             server.setConnectURI(uri);
             server.setName(node);
             if (options.containsKey("wireFormat")) {
@@ -290,6 +298,10 @@
         }
     }
 
+	protected PipeTransportServer createTransportServer() {
+		return new PipeTransportServer();
+	}
+
     private synchronized void unbind(PipeTransportServer server) {
         servers.remove(server.getName());
     }

Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SslContext.java
(from r784806, activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/broker/SslContext.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SslContext.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SslContext.java&p1=activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/broker/SslContext.java&r1=784806&r2=784883&rev=784883&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/broker/SslContext.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SslContext.java
Mon Jun 15 17:44:49 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.broker;
+package org.apache.activemq.util;
 
 import java.security.KeyManagementException;
 import java.security.NoSuchAlgorithmException;



Mime
View raw message