You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wadi-commits@incubator.apache.org by bd...@apache.org on 2005/12/20 01:41:45 UTC

svn commit: r357868 - in /incubator/wadi/trunk/modules/core: ./ src/main/java/org/codehaus/wadi/gridstate/activecluster/ src/main/java/org/codehaus/wadi/impl/ src/test/java/org/codehaus/wadi/old/test/ src/test/java/org/codehaus/wadi/test/

Author: bdudney
Date: Mon Dec 19 17:41:40 2005
New Revision: 357868

URL: http://svn.apache.org/viewcvs?rev=357868&view=rev
Log:
updates to make wadi work with activemq 4

Modified:
    incubator/wadi/trunk/modules/core/pom.xml
    incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/gridstate/activecluster/ActiveClusterDispatcher.java
    incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/impl/Utils.java
    incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/old/test/ClusterDemo.java
    incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/DIndexNode.java
    incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/TestContextualiser.java

Modified: incubator/wadi/trunk/modules/core/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/wadi/trunk/modules/core/pom.xml?rev=357868&r1=357867&r2=357868&view=diff
==============================================================================
--- incubator/wadi/trunk/modules/core/pom.xml (original)
+++ incubator/wadi/trunk/modules/core/pom.xml Mon Dec 19 17:41:40 2005
@@ -3,7 +3,7 @@
     <groupId>wadi</groupId>
     <artifactId>wadi</artifactId>
     <relativePath>../../pom.xml</relativePath>
-    <version>2.0M1</version>
+    <version>2.0M2</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>wadi-core</artifactId>
@@ -73,8 +73,8 @@
     </dependency>
 
     <dependency>
-      <groupId>activemq</groupId>
-      <artifactId>activemq</artifactId>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>activemq-core</artifactId>
     </dependency>
 
     <dependency>

Modified: incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/gridstate/activecluster/ActiveClusterDispatcher.java
URL: http://svn.apache.org/viewcvs/incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/gridstate/activecluster/ActiveClusterDispatcher.java?rev=357868&r1=357867&r2=357868&view=diff
==============================================================================
--- incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/gridstate/activecluster/ActiveClusterDispatcher.java (original)
+++ incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/gridstate/activecluster/ActiveClusterDispatcher.java Mon Dec 19 17:41:40 2005
@@ -18,21 +18,14 @@
 
 import java.util.Collection;
 import java.util.Map;
-
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.MessageConsumer;
 import javax.jms.ObjectMessage;
-
 import org.activecluster.Cluster;
 import org.activecluster.ClusterListener;
 import org.activecluster.Node;
-import org.activemq.ActiveMQConnection;
 import org.activemq.ActiveMQConnectionFactory;
-import org.activemq.broker.BrokerConnector;
-import org.activemq.broker.BrokerContainer;
-import org.activemq.store.vm.VMPersistenceAdapterFactory;
-import org.activemq.transport.TransportChannel;
 import org.apache.commons.logging.LogFactory;
 import org.codehaus.wadi.dindex.impl.DIndex;
 import org.codehaus.wadi.gridstate.DispatcherConfig;
@@ -91,8 +84,7 @@
 		super.init(config);
 		try {
 			_connectionFactory=new ActiveMQConnectionFactory(_clusterUri);
-			_connectionFactory.start();
-			System.setProperty("activemq.persistenceAdapterFactory", VMPersistenceAdapterFactory.class.getName()); // do we need this ?
+			//_connectionFactory.start();
 			_clusterFactory=new CustomClusterFactory(_connectionFactory);
 			_clusterFactory.setInactiveTime(_inactiveTime);
 			_cluster=(ExtendedCluster)_clusterFactory.createCluster(_clusterName);
@@ -119,16 +111,7 @@
 	public void stop() throws Exception {
 		// shut down activemq cleanly - what happens if we are running more than one distributable webapp ?
 		// there must be an easier way - :-(
-		ActiveMQConnection connection=(ActiveMQConnection)((ExtendedCluster)_cluster).getConnection();
-		TransportChannel channel=(connection==null?null:connection.getTransportChannel());
-		BrokerConnector connector=(channel==null?null:channel.getEmbeddedBrokerConnector());
-		BrokerContainer container=(connector==null?null:connector.getBrokerContainer());
-		if (container!=null)
-			container.stop(); // for peer://
-		
-		_cluster.stop();
-		_connectionFactory.stop();
-		
+        _cluster.stop();
 		Thread.sleep(5*1000);
 	}
 	

Modified: incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/impl/Utils.java
URL: http://svn.apache.org/viewcvs/incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/impl/Utils.java?rev=357868&r1=357867&r2=357868&view=diff
==============================================================================
--- incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/impl/Utils.java (original)
+++ incubator/wadi/trunk/modules/core/src/main/java/org/codehaus/wadi/impl/Utils.java Mon Dec 19 17:41:40 2005
@@ -22,11 +22,7 @@
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-
 import org.activemq.ActiveMQConnectionFactory;
-import org.activemq.broker.impl.BrokerContainerFactoryImpl;
-import org.activemq.store.vm.VMPersistenceAdapter;
-import org.activemq.store.vm.VMPersistenceAdapterFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.codehaus.wadi.Emoter;
@@ -34,7 +30,6 @@
 import org.codehaus.wadi.Motable;
 import org.codehaus.wadi.SerializableContent;
 import org.codehaus.wadi.Streamer;
-
 import EDU.oswego.cs.dl.util.concurrent.Puttable;
 import EDU.oswego.cs.dl.util.concurrent.Sync;
 import EDU.oswego.cs.dl.util.concurrent.Takable;
@@ -238,10 +233,6 @@
     // this should really be passed in the top somewhere - but the tests need access too...
     public static ActiveMQConnectionFactory getConnectionFactory() {
         ActiveMQConnectionFactory cf=new ActiveMQConnectionFactory(getClusterUri());
-        // ActiveMQConnectionFactory cf=new ActiveMQConnectionFactory("tcp://localhost:61616");
-        // _connectionFactory=new ActiveMQConnectionFactory("multicast://224.1.2.3:5123");
-        cf.setBrokerContainerFactory(new BrokerContainerFactoryImpl(new VMPersistenceAdapter())); // peer protocol seems to ignore this...
-        System.setProperty("activemq.persistenceAdapterFactory", VMPersistenceAdapterFactory.class.getName()); // peer protocol sees this
         return cf;
     }
 

Modified: incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/old/test/ClusterDemo.java
URL: http://svn.apache.org/viewcvs/incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/old/test/ClusterDemo.java?rev=357868&r1=357867&r2=357868&view=diff
==============================================================================
--- incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/old/test/ClusterDemo.java (original)
+++ incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/old/test/ClusterDemo.java Mon Dec 19 17:41:40 2005
@@ -78,7 +78,6 @@
   {
     _cluster.stop();
     _topology.stop();
-    _connFactory.stop();
   }
 
   //----------------------------------------

Modified: incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/DIndexNode.java
URL: http://svn.apache.org/viewcvs/incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/DIndexNode.java?rev=357868&r1=357867&r2=357868&view=diff
==============================================================================
--- incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/DIndexNode.java (original)
+++ incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/DIndexNode.java Mon Dec 19 17:41:40 2005
@@ -19,11 +19,8 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
-
 import javax.jms.Destination;
-
 import org.activecluster.Node;
-import org.activemq.store.vm.VMPersistenceAdapterFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.codehaus.wadi.ContextPool;
@@ -50,7 +47,6 @@
 import org.codehaus.wadi.impl.SimplePartitionMapper;
 import org.codehaus.wadi.impl.SimpleSessionPool;
 import org.codehaus.wadi.impl.SimpleStreamer;
-
 import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
 import EDU.oswego.cs.dl.util.concurrent.Latch;
 import EDU.oswego.cs.dl.util.concurrent.Sync;
@@ -82,7 +78,6 @@
 		_nodeName=nodeName;
 		_dispatcher=new ActiveClusterDispatcher(_nodeName, _clusterName, _clusterUri, inactiveTime);
 		_numPartitions=numPartitions;
-		System.setProperty("activemq.persistenceAdapterFactory", VMPersistenceAdapterFactory.class.getName()); // peer protocol sees this
 		_mapper=mapper;
 		_streamer=new SimpleStreamer();
 		_streamer.init(new StreamerConfig(){public ClassLoader getClassLoader() {return getClass().getClassLoader();}});

Modified: incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/TestContextualiser.java
URL: http://svn.apache.org/viewcvs/incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/TestContextualiser.java?rev=357868&r1=357867&r2=357868&view=diff
==============================================================================
--- incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/TestContextualiser.java (original)
+++ incubator/wadi/trunk/modules/core/src/test/java/org/codehaus/wadi/test/TestContextualiser.java Mon Dec 19 17:41:40 2005
@@ -22,7 +22,6 @@
 import java.net.InetSocketAddress;
 import java.util.HashMap;
 import java.util.Map;
-
 import javax.jms.ConnectionFactory;
 import javax.jms.Destination;
 import javax.servlet.FilterChain;
@@ -30,13 +29,8 @@
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.sql.DataSource;
-
 import junit.framework.TestCase;
-
 import org.activecluster.ClusterFactory;
-import org.activemq.ActiveMQConnectionFactory;
-import org.activemq.broker.impl.BrokerContainerFactoryImpl;
-import org.activemq.store.vm.VMPersistenceAdapter;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.axiondb.jdbc.AxionDataSource;
@@ -108,7 +102,6 @@
 import org.codehaus.wadi.impl.Utils;
 import org.codehaus.wadi.impl.WebHybridRelocater;
 import org.codehaus.wadi.impl.WebInvocationContext;
-
 import EDU.oswego.cs.dl.util.concurrent.NullSync;
 import EDU.oswego.cs.dl.util.concurrent.Sync;
 
@@ -581,7 +574,6 @@
 	
 	public void testCluster() throws Exception {
 		ConnectionFactory connectionFactory = Utils.getConnectionFactory();
-		((ActiveMQConnectionFactory)connectionFactory).setBrokerContainerFactory(new BrokerContainerFactoryImpl(new VMPersistenceAdapter()));
 		ClusterFactory clusterFactory       = new CustomClusterFactory(connectionFactory);
 		String clusterName                  = "ORG.CODEHAUS.WADI.TEST.CLUSTER";
 		CustomCluster cluster0              = (CustomCluster)clusterFactory.createCluster(clusterName);