activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r468801 - in /incubator/activemq/sandbox/qpid/src: main/java/org/apache/activemq/amqp/broker/ main/java/org/apache/qpid/server/ main/java/org/apache/qpid/server/queue/ test/resources/
Date Sun, 29 Oct 2006 01:25:22 GMT
Author: chirino
Date: Sat Oct 28 18:25:22 2006
New Revision: 468801

URL: http://svn.apache.org/viewvc?view=rev&rev=468801
Log:
lazy construction of the message exchange was causing timing issues.  Make sure it's constructed
in the broker start()

Modified:
    incubator/activemq/sandbox/qpid/src/main/java/org/apache/activemq/amqp/broker/AmqpBrokerService.java
    incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/AMQChannel.java
    incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
    incubator/activemq/sandbox/qpid/src/test/resources/log4j.properties

Modified: incubator/activemq/sandbox/qpid/src/main/java/org/apache/activemq/amqp/broker/AmqpBrokerService.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/qpid/src/main/java/org/apache/activemq/amqp/broker/AmqpBrokerService.java?view=diff&rev=468801&r1=468800&r2=468801
==============================================================================
--- incubator/activemq/sandbox/qpid/src/main/java/org/apache/activemq/amqp/broker/AmqpBrokerService.java
(original)
+++ incubator/activemq/sandbox/qpid/src/main/java/org/apache/activemq/amqp/broker/AmqpBrokerService.java
Sat Oct 28 18:25:22 2006
@@ -64,6 +64,22 @@
         return rc;
     }
     
+    @Override
+    public void start() throws Exception {
+    	
+    	if( getExchangeRegistry() == null )
+    		throw new IllegalArgumentException("The ExchangeRegistry is not properly configured.");
+    	if( getMessageStore() == null )
+    		throw new IllegalArgumentException("The MessageStore is not properly configured.");
+    	if( getAuthenticationManager() == null )
+    		throw new IllegalArgumentException("The AuthenticationManager is not properly configured.");
+    	if( getQueueRegistry() == null )
+    		throw new IllegalArgumentException("The QueueRegistry is not properly configured.");
+
+    	super.start();
+    }
+    
+    
     /**
      * Sets the transport connectors which this broker will listen on for new
      * clients

Modified: incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/AMQChannel.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/AMQChannel.java?view=diff&rev=468801&r1=468800&r2=468801
==============================================================================
--- incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/AMQChannel.java (original)
+++ incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/AMQChannel.java Sat
Oct 28 18:25:22 2006
@@ -17,8 +17,24 @@
  */
 package org.apache.qpid.server;
 
-import org.apache.activemq.amqp.command.*;
-import org.apache.log4j.Logger;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.activemq.amqp.command.AMQDataBlock;
+import org.apache.activemq.amqp.command.BasicPublishBody;
+import org.apache.activemq.amqp.command.ContentBody;
+import org.apache.activemq.amqp.command.ContentHeaderBody;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.ack.TxAck;
 import org.apache.qpid.server.ack.UnacknowledgedMessage;
@@ -33,22 +49,11 @@
 import org.apache.qpid.server.txn.TxnBuffer;
 import org.apache.qpid.server.txn.TxnOp;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
-
 public class AMQChannel
 {
     public static final int DEFAULT_PREFETCH = 5000;
 
-    private static final Logger _log = Logger.getLogger(AMQChannel.class);
+    private static final Log _log = LogFactory.getLog(AMQChannel.class);
 
     private final int _channelId;
 
@@ -309,11 +314,6 @@
         if (q != null)
         {
             q.unregisterProtocolSession(session, _channelId, consumerTag);
-        }
-        else
-        {
-            throw new AMQException(_log, "Consumer tag " + consumerTag + " not known to channel
" +
-                                         _channelId);
         }
     }
 

Modified: incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/queue/AMQQueue.java?view=diff&rev=468801&r1=468800&r2=468801
==============================================================================
--- incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
(original)
+++ incubator/activemq/sandbox/qpid/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
Sat Oct 28 18:25:22 2006
@@ -17,9 +17,33 @@
  */
 package org.apache.qpid.server.queue;
 
-import org.apache.activemq.amqp.command.*;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
+import javax.management.JMException;
+import javax.management.MBeanException;
+import javax.management.MBeanNotificationInfo;
+import javax.management.NotCompliantMBeanException;
+import javax.management.Notification;
+import javax.management.monitor.MonitorNotification;
+import javax.management.openmbean.ArrayType;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeDataSupport;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularDataSupport;
+import javax.management.openmbean.TabularType;
+
+import org.apache.activemq.amqp.command.ContentBody;
 import org.apache.activemq.util.ByteSequence;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.management.AMQManagedObject;
@@ -31,26 +55,13 @@
 import org.apache.qpid.server.txn.TxnBuffer;
 import org.apache.qpid.server.txn.TxnOp;
 
-import javax.management.JMException;
-import javax.management.MBeanException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.NotCompliantMBeanException;
-import javax.management.Notification;
-import javax.management.monitor.MonitorNotification;
-import javax.management.openmbean.*;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-
 /**
  * This is an AMQ Queue, and should not be confused with a JMS queue or any other abstraction
like
  * that. It is described fully in RFC 006.
  */
 public class AMQQueue implements Managable
 {
-    private static final Logger _logger = Logger.getLogger(AMQQueue.class);
+    private static final Log _logger = LogFactory.getLog(AMQQueue.class);
 
     private final String _name;
 

Modified: incubator/activemq/sandbox/qpid/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/qpid/src/test/resources/log4j.properties?view=diff&rev=468801&r1=468800&r2=468801
==============================================================================
--- incubator/activemq/sandbox/qpid/src/test/resources/log4j.properties (original)
+++ incubator/activemq/sandbox/qpid/src/test/resources/log4j.properties Sat Oct 28 18:25:22
2006
@@ -18,9 +18,10 @@
 #
 # The logging properties used for eclipse testing, We want to see debug output on the console.
 #
-log4j.rootLogger=WARN, out
+log4j.rootLogger=INFO, out
 
 log4j.logger.org.apache.activemq=DEBUG
+log4j.logger.org.apache.qpid.server.AMQChannel=DEBUG
 
 # CONSOLE appender not used by default
 log4j.appender.out=org.apache.log4j.ConsoleAppender



Mime
View raw message