diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
index c18381af70..7bb50cc4c7 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
@@ -41,7 +41,6 @@ import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.ExceptionListener;
import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
@@ -290,8 +289,8 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
checkClosedOrFailed();
ensureConnectionInfoSent();
boolean doSessionAsync = alwaysSessionAsync || sessions.size() > 0 || transacted || acknowledgeMode == Session.CLIENT_ACKNOWLEDGE;
- return new ActiveMQSession(this, getNextSessionId(), (transacted ? Session.SESSION_TRANSACTED : (acknowledgeMode == Session.SESSION_TRANSACTED
- ? Session.AUTO_ACKNOWLEDGE : acknowledgeMode)), dispatchAsync, alwaysSessionAsync);
+ return new ActiveMQSession(this, getNextSessionId(), transacted ? Session.SESSION_TRANSACTED : (acknowledgeMode == Session.SESSION_TRANSACTED
+ ? Session.AUTO_ACKNOWLEDGE : acknowledgeMode), dispatchAsync, alwaysSessionAsync);
}
/**
@@ -1168,10 +1167,11 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
Response response = (Response)this.transport.request(command);
if (response.isException()) {
ExceptionResponse er = (ExceptionResponse)response;
- if (er.getException() instanceof JMSException)
+ if (er.getException() instanceof JMSException) {
throw (JMSException)er.getException();
- else
+ } else {
throw JMSExceptionSupport.create(er.getException());
+ }
}
return response;
} catch (IOException e) {
@@ -1196,10 +1196,11 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
Response response = (Response)this.transport.request(command, timeout);
if (response != null && response.isException()) {
ExceptionResponse er = (ExceptionResponse)response;
- if (er.getException() instanceof JMSException)
+ if (er.getException() instanceof JMSException) {
throw (JMSException)er.getException();
- else
+ } else {
throw JMSExceptionSupport.create(er.getException());
+ }
}
return response;
} catch (IOException e) {
@@ -1361,9 +1362,9 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
* @throws IllegalStateException if the connection is in used.
*/
public void changeUserInfo(String userName, String password) throws JMSException {
- if (isConnectionInfoSentToBroker)
+ if (isConnectionInfoSentToBroker) {
throw new IllegalStateException("changeUserInfo used Connection is not allowed");
-
+ }
this.info.setUserName(userName);
this.info.setPassword(password);
}
@@ -1374,8 +1375,9 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
*/
public String getResourceManagerId() throws JMSException {
waitForBrokerInfo();
- if (brokerInfo == null)
+ if (brokerInfo == null) {
throw new JMSException("Connection failed before Broker info was received.");
+ }
return brokerInfo.getBrokerId().getValue();
}
@@ -1580,8 +1582,6 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
onAsyncException(error.getException());
}
});
- new Thread("Async error worker") {
- }.start();
return null;
}
@@ -1633,8 +1633,9 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
if (!closed.get() && !closing.get()) {
if (this.exceptionListener != null) {
- if (!(error instanceof JMSException))
+ if (!(error instanceof JMSException)) {
error = JMSExceptionSupport.create(error);
+ }
final JMSException e = (JMSException)error;
asyncConnectionThread.execute(new Runnable() {
@@ -1744,8 +1745,9 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
// If we are not watching the advisories.. then
// we will assume that the temp destination does exist.
- if (advisoryConsumer == null)
+ if (advisoryConsumer == null) {
return false;
+ }
return !activeTempDestinations.contains(dest);
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
index 4105862965..8cf024a9f0 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
@@ -16,6 +16,23 @@
*/
package org.apache.activemq;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.naming.Context;
+
import org.apache.activemq.blob.BlobTransferPolicy;
import org.apache.activemq.jndi.JNDIBaseStorable;
import org.apache.activemq.management.JMSStatsImpl;
@@ -29,22 +46,6 @@ import org.apache.activemq.util.JMSExceptionSupport;
import org.apache.activemq.util.URISupport;
import org.apache.activemq.util.URISupport.CompositeData;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.naming.Context;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadFactory;
-
/**
* A ConnectionFactory is an an Administered object, and is used for creating
* Connections.
This class also implements QueueConnectionFactory and
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionMetaData.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionMetaData.java
index e244cbf5ce..5884174975 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionMetaData.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionMetaData.java
@@ -28,7 +28,7 @@ import javax.jms.ConnectionMetaData;
* the Connection
object.
*/
-public class ActiveMQConnectionMetaData implements ConnectionMetaData {
+public final class ActiveMQConnectionMetaData implements ConnectionMetaData {
public static final String PROVIDER_VERSION;
public static final int PROVIDER_MAJOR_VERSION;
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
index 78e59a5639..c58744cc2b 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
@@ -16,7 +16,29 @@
*/
package org.apache.activemq;
-import org.apache.activemq.command.*;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.ActiveMQTempDestination;
+import org.apache.activemq.command.ConsumerId;
+import org.apache.activemq.command.ConsumerInfo;
+import org.apache.activemq.command.MessageAck;
+import org.apache.activemq.command.MessageDispatch;
+import org.apache.activemq.command.MessagePull;
import org.apache.activemq.management.JMSConsumerStatsImpl;
import org.apache.activemq.management.StatsCapable;
import org.apache.activemq.management.StatsImpl;
@@ -29,18 +51,6 @@ import org.apache.activemq.util.JMSExceptionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.jms.IllegalStateException;
-import javax.jms.*;
-import javax.jms.Message;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* A client uses a MessageConsumer
object to receive messages
* from a destination. A MessageConsumer
object is created by
@@ -612,7 +622,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
Thread.currentThread().interrupt();
}
}
- if ((session.isTransacted() || session.isDupsOkAcknowledge())) {
+ if (session.isTransacted() || session.isDupsOkAcknowledge()) {
acknowledge();
}
if (session.isClientAcknowledge()) {
@@ -885,7 +895,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
}
}
if (!unconsumedMessages.isClosed()) {
- if (this.info.isBrowser() || session.connection.isDuplicate(this, md.getMessage()) == false) {
+ if (this.info.isBrowser() || !session.connection.isDuplicate(this, md.getMessage())) {
if (listener != null && unconsumedMessages.isRunning()) {
ActiveMQMessage message = createActiveMQMessage(md);
beforeMessageIsConsumed(md);
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageProducer.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageProducer.java
index 71433021c8..c3bbf25c14 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageProducer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageProducer.java
@@ -16,6 +16,15 @@
*/
package org.apache.activemq;
+import java.util.HashMap;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.jms.Destination;
+import javax.jms.IllegalStateException;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.Message;
+
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ProducerAck;
import org.apache.activemq.command.ProducerId;
@@ -26,14 +35,6 @@ import org.apache.activemq.management.StatsImpl;
import org.apache.activemq.memory.UsageManager;
import org.apache.activemq.util.IntrospectionSupport;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import java.util.HashMap;
-import java.util.concurrent.atomic.AtomicLong;
-
/**
* A client uses a MessageProducer
object to send messages to a
* destination. A MessageProducer
object is created by passing a
@@ -139,14 +140,14 @@ public class ActiveMQMessageProducer extends ActiveMQMessageProducerSupport impl
* to some internal error.
*/
public void close() throws JMSException {
- if (closed == false) {
+ if (!closed) {
dispose();
this.session.asyncSendPacket(info.createRemoveCommand());
}
}
public void dispose() {
- if (closed == false) {
+ if (!closed) {
this.session.removeProducer(this);
closed = true;
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageProducerSupport.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageProducerSupport.java
index 242fd1c36d..59309a0664 100644
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageProducerSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageProducerSupport.java
@@ -16,9 +16,12 @@
*/
package org.apache.activemq;
-import javax.jms.*;
+import javax.jms.DeliveryMode;
+import javax.jms.Destination;
import javax.jms.IllegalStateException;
+import javax.jms.JMSException;
import javax.jms.Message;
+import javax.jms.MessageProducer;
/**
* A useful base class for implementing a {@link MessageProducer}
@@ -194,7 +197,7 @@ public abstract class ActiveMQMessageProducerSupport implements MessageProducer,
* @see javax.jms.Message#DEFAULT_TIME_TO_LIVE
*/
public void setTimeToLive(long timeToLive) throws JMSException {
- if (timeToLive < 0l) {
+ if (timeToLive < 0L) {
throw new IllegalStateException("cannot set a negative timeToLive");
}
checkClosed();
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageTransformation.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageTransformation.java
index 9af7a8cd98..1b769e64c5 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageTransformation.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageTransformation.java
@@ -20,10 +20,10 @@ import java.util.Enumeration;
import javax.jms.BytesMessage;
import javax.jms.Destination;
-import javax.jms.MessageEOFException;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
+import javax.jms.MessageEOFException;
import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.StreamMessage;
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQOutputStream.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQOutputStream.java
index 37c218de3b..0a56bb8d9d 100644
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQOutputStream.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQOutputStream.java
@@ -72,7 +72,7 @@ public class ActiveMQOutputStream extends OutputStream implements Disposable {
}
public void close() throws IOException {
- if (closed == false) {
+ if (!closed) {
flushBuffer();
try {
// Send an EOS style empty message to signal EOS.
@@ -86,7 +86,7 @@ public class ActiveMQOutputStream extends OutputStream implements Disposable {
}
public void dispose() {
- if (closed == false) {
+ if (!closed) {
this.connection.removeOutputStream(this);
closed = true;
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java
index 178eab3444..ec06768384 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java
@@ -17,6 +17,7 @@
package org.apache.activemq;
import java.util.Enumeration;
+import java.util.concurrent.atomic.AtomicBoolean;
import javax.jms.IllegalStateException;
import javax.jms.JMSException;
@@ -28,8 +29,6 @@ import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ConsumerId;
import org.apache.activemq.command.MessageDispatch;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* A client uses a QueueBrowser
object to look at messages on a
* queue without removing them.
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java
index 10dd380948..01b6ecf7b8 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java
@@ -29,8 +29,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.jms.BytesMessage;
import javax.jms.Destination;
import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.InvalidSelectorException;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
@@ -52,11 +50,32 @@ import javax.jms.Topic;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
-import javax.jms.TransactionRolledBackException;
import org.apache.activemq.blob.BlobTransferPolicy;
import org.apache.activemq.blob.BlobUploader;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQBlobMessage;
+import org.apache.activemq.command.ActiveMQBytesMessage;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ActiveMQMapMessage;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.ActiveMQObjectMessage;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.ActiveMQStreamMessage;
+import org.apache.activemq.command.ActiveMQTempDestination;
+import org.apache.activemq.command.ActiveMQTempQueue;
+import org.apache.activemq.command.ActiveMQTempTopic;
+import org.apache.activemq.command.ActiveMQTextMessage;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.command.Command;
+import org.apache.activemq.command.ConsumerId;
+import org.apache.activemq.command.MessageAck;
+import org.apache.activemq.command.MessageDispatch;
+import org.apache.activemq.command.MessageId;
+import org.apache.activemq.command.ProducerId;
+import org.apache.activemq.command.Response;
+import org.apache.activemq.command.SessionId;
+import org.apache.activemq.command.SessionInfo;
+import org.apache.activemq.command.TransactionId;
import org.apache.activemq.management.JMSSessionStatsImpl;
import org.apache.activemq.management.StatsCapable;
import org.apache.activemq.management.StatsImpl;
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQTopicPublisher.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQTopicPublisher.java
index 9bbc42c6d0..d2712c062f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQTopicPublisher.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQTopicPublisher.java
@@ -17,17 +17,12 @@
package org.apache.activemq;
-import org.apache.activemq.command.ActiveMQDestination;
-
-import javax.jms.Destination;
-import javax.jms.InvalidDestinationException;
import javax.jms.JMSException;
import javax.jms.Message;
-import javax.jms.MessageFormatException;
-import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
+
+import org.apache.activemq.command.ActiveMQDestination;
/**
* A client uses a TopicPublisher
object to publish messages on
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQTopicSubscriber.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQTopicSubscriber.java
index cb8bf8d33b..689efddcf5 100755
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQTopicSubscriber.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQTopicSubscriber.java
@@ -17,13 +17,13 @@
package org.apache.activemq;
-import org.apache.activemq.command.ActiveMQDestination;
-import org.apache.activemq.command.ConsumerId;
-
import javax.jms.JMSException;
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ConsumerId;
+
/**
* A client uses a TopicSubscriber
object to receive messages
* that have been published to a topic. A TopicSubscriber
object
diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQXAConnectionFactory.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQXAConnectionFactory.java
index 65bde01ed2..d788cdbad5 100644
--- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQXAConnectionFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQXAConnectionFactory.java
@@ -16,8 +16,7 @@
*/
package org.apache.activemq;
-import org.apache.activemq.management.JMSStatsImpl;
-import org.apache.activemq.transport.Transport;
+import java.net.URI;
import javax.jms.JMSException;
import javax.jms.XAConnection;
@@ -27,7 +26,8 @@ import javax.jms.XAQueueConnectionFactory;
import javax.jms.XATopicConnection;
import javax.jms.XATopicConnectionFactory;
-import java.net.URI;
+import org.apache.activemq.management.JMSStatsImpl;
+import org.apache.activemq.transport.Transport;
/**
* A factory of {@link XAConnection} instances
diff --git a/activemq-core/src/main/java/org/apache/activemq/BlobMessage.java b/activemq-core/src/main/java/org/apache/activemq/BlobMessage.java
index c08b58b1c9..50352ab9c9 100644
--- a/activemq-core/src/main/java/org/apache/activemq/BlobMessage.java
+++ b/activemq-core/src/main/java/org/apache/activemq/BlobMessage.java
@@ -16,11 +16,12 @@
*/
package org.apache.activemq;
-import javax.jms.JMSException;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.io.InputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.jms.JMSException;
/**
* Represents a message which has a typically out of band Binary Large Object
diff --git a/activemq-core/src/main/java/org/apache/activemq/CustomDestination.java b/activemq-core/src/main/java/org/apache/activemq/CustomDestination.java
index 2db8be6a2b..49a059fcfa 100644
--- a/activemq-core/src/main/java/org/apache/activemq/CustomDestination.java
+++ b/activemq-core/src/main/java/org/apache/activemq/CustomDestination.java
@@ -17,13 +17,13 @@
package org.apache.activemq;
import javax.jms.Destination;
+import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
-import javax.jms.TopicSubscriber;
import javax.jms.QueueReceiver;
-import javax.jms.TopicPublisher;
import javax.jms.QueueSender;
-import javax.jms.JMSException;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSubscriber;
/**
* Represents a hook to allow the support of custom destinations
diff --git a/activemq-core/src/main/java/org/apache/activemq/MessageTransformer.java b/activemq-core/src/main/java/org/apache/activemq/MessageTransformer.java
index fd40987197..275da2ced5 100644
--- a/activemq-core/src/main/java/org/apache/activemq/MessageTransformer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/MessageTransformer.java
@@ -16,13 +16,11 @@
*/
package org.apache.activemq;
-import org.apache.activemq.command.ActiveMQMessage;
-
-import javax.jms.Message;
-import javax.jms.Session;
-import javax.jms.MessageProducer;
import javax.jms.JMSException;
+import javax.jms.Message;
import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
/**
* A plugin strategy for transforming a message before it is sent by the JMS client or before it is
diff --git a/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java b/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
index 384e8edc3b..3145022901 100755
--- a/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
+++ b/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
@@ -19,6 +19,7 @@ package org.apache.activemq;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
import javax.jms.JMSException;
import javax.jms.TransactionInProgressException;
@@ -29,20 +30,18 @@ import javax.transaction.xa.Xid;
import org.apache.activemq.command.ConnectionId;
import org.apache.activemq.command.DataArrayResponse;
+import org.apache.activemq.command.DataStructure;
import org.apache.activemq.command.IntegerResponse;
import org.apache.activemq.command.LocalTransactionId;
import org.apache.activemq.command.TransactionId;
import org.apache.activemq.command.TransactionInfo;
import org.apache.activemq.command.XATransactionId;
-import org.apache.activemq.command.DataStructure;
import org.apache.activemq.transaction.Synchronization;
import org.apache.activemq.util.JMSExceptionSupport;
import org.apache.activemq.util.LongSequenceGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* A TransactionContext provides the means to control a JMS transaction. It
* provides a local transaction interface and also an XAResource interface.
diff --git a/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java b/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java
index cfee6ea157..815227bfef 100755
--- a/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java
+++ b/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java
@@ -16,8 +16,8 @@
*/
package org.apache.activemq.advisory;
-import java.io.IOException;
import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerFilter;
@@ -42,8 +42,6 @@ import org.apache.activemq.util.LongSequenceGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* This broker filter handles tracking the state of the broker for purposes of
* publishing advisory messages to advisory consumers.
diff --git a/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisorySupport.java b/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisorySupport.java
index 778b7164c7..a5d928db83 100755
--- a/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisorySupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisorySupport.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.advisory;
+import javax.jms.Destination;
+
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQTopic;
-import javax.jms.Destination;
-
public class AdvisorySupport {
public static final String ADVISORY_TOPIC_PREFIX = "ActiveMQ.Advisory.";
@@ -102,8 +102,9 @@ public class AdvisorySupport {
return TEMP_QUEUE_ADVISORY_TOPIC;
case ActiveMQDestination.TEMP_TOPIC_TYPE:
return TEMP_TOPIC_ADVISORY_TOPIC;
+ default:
+ throw new RuntimeException("Unknown destination type: " + destination.getDestinationType());
}
- throw new RuntimeException("Unknown destination type: " + destination.getDestinationType());
}
public static boolean isDestinationAdvisoryTopic(ActiveMQDestination destination) {
diff --git a/activemq-core/src/main/java/org/apache/activemq/advisory/ConsumerEvent.java b/activemq-core/src/main/java/org/apache/activemq/advisory/ConsumerEvent.java
index 3512bc0bfe..1b012f0679 100644
--- a/activemq-core/src/main/java/org/apache/activemq/advisory/ConsumerEvent.java
+++ b/activemq-core/src/main/java/org/apache/activemq/advisory/ConsumerEvent.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.advisory;
-import org.apache.activemq.command.ConsumerId;
+import java.util.EventObject;
import javax.jms.Destination;
-import java.util.EventObject;
+import org.apache.activemq.command.ConsumerId;
/**
* An event when the number of consumers on a given destination changes.
diff --git a/activemq-core/src/main/java/org/apache/activemq/advisory/ConsumerEventSource.java b/activemq-core/src/main/java/org/apache/activemq/advisory/ConsumerEventSource.java
index c1a987d8e7..b7fb5ad2d3 100644
--- a/activemq-core/src/main/java/org/apache/activemq/advisory/ConsumerEventSource.java
+++ b/activemq-core/src/main/java/org/apache/activemq/advisory/ConsumerEventSource.java
@@ -19,6 +19,14 @@ package org.apache.activemq.advisory;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.Session;
+
import org.apache.activemq.Service;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQMessage;
@@ -29,14 +37,6 @@ import org.apache.activemq.command.RemoveInfo;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-
/**
* An object which can be used to listen to the number of active consumers
* available on a given destination.
@@ -82,27 +82,24 @@ public class ConsumerEventSource implements Service, MessageListener {
public void onMessage(Message message) {
if (message instanceof ActiveMQMessage) {
- ActiveMQMessage activeMessage = (ActiveMQMessage) message;
+ ActiveMQMessage activeMessage = (ActiveMQMessage)message;
Object command = activeMessage.getDataStructure();
int count = 0;
if (command instanceof ConsumerInfo) {
count = consumerCount.incrementAndGet();
count = extractConsumerCountFromMessage(message, count);
- fireConsumerEvent(new ConsumerStartedEvent(this, destination, (ConsumerInfo) command, count));
- }
- else if (command instanceof RemoveInfo) {
- RemoveInfo removeInfo = (RemoveInfo) command;
+ fireConsumerEvent(new ConsumerStartedEvent(this, destination, (ConsumerInfo)command, count));
+ } else if (command instanceof RemoveInfo) {
+ RemoveInfo removeInfo = (RemoveInfo)command;
if (removeInfo.isConsumerRemove()) {
count = consumerCount.decrementAndGet();
count = extractConsumerCountFromMessage(message, count);
- fireConsumerEvent(new ConsumerStoppedEvent(this, destination, (ConsumerId) removeInfo.getObjectId(), count));
+ fireConsumerEvent(new ConsumerStoppedEvent(this, destination, (ConsumerId)removeInfo.getObjectId(), count));
}
- }
- else {
+ } else {
log.warn("Unknown command: " + command);
}
- }
- else {
+ } else {
log.warn("Unknown message type: " + message + ". Message ignored");
}
}
@@ -116,12 +113,11 @@ public class ConsumerEventSource implements Service, MessageListener {
try {
Object value = message.getObjectProperty("consumerCount");
if (value instanceof Number) {
- Number n = (Number) value;
+ Number n = (Number)value;
return n.intValue();
}
log.warn("No consumerCount header available on the message: " + message);
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.warn("Failed to extract consumerCount from message: " + message + ".Reason: " + e, e);
}
return count;
diff --git a/activemq-core/src/main/java/org/apache/activemq/advisory/ProducerEvent.java b/activemq-core/src/main/java/org/apache/activemq/advisory/ProducerEvent.java
index 14407aec75..35d298e8bb 100644
--- a/activemq-core/src/main/java/org/apache/activemq/advisory/ProducerEvent.java
+++ b/activemq-core/src/main/java/org/apache/activemq/advisory/ProducerEvent.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.advisory;
-import org.apache.activemq.command.ProducerId;
+import java.util.EventObject;
import javax.jms.Destination;
-import java.util.EventObject;
+import org.apache.activemq.command.ProducerId;
/**
* An event when the number of producers on a given destination changes.
diff --git a/activemq-core/src/main/java/org/apache/activemq/advisory/ProducerEventSource.java b/activemq-core/src/main/java/org/apache/activemq/advisory/ProducerEventSource.java
index bd8b03019a..6cf02a9fd5 100644
--- a/activemq-core/src/main/java/org/apache/activemq/advisory/ProducerEventSource.java
+++ b/activemq-core/src/main/java/org/apache/activemq/advisory/ProducerEventSource.java
@@ -16,6 +16,9 @@
*/
package org.apache.activemq.advisory;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
@@ -23,6 +26,7 @@ import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.Session;
+
import org.apache.activemq.Service;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQMessage;
@@ -32,8 +36,6 @@ import org.apache.activemq.command.ProducerInfo;
import org.apache.activemq.command.RemoveInfo;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
/**
* An object which can be used to listen to the number of active consumers
@@ -80,27 +82,24 @@ public class ProducerEventSource implements Service, MessageListener {
public void onMessage(Message message) {
if (message instanceof ActiveMQMessage) {
- ActiveMQMessage activeMessage = (ActiveMQMessage) message;
+ ActiveMQMessage activeMessage = (ActiveMQMessage)message;
Object command = activeMessage.getDataStructure();
int count = 0;
if (command instanceof ProducerInfo) {
count = producerCount.incrementAndGet();
count = extractProducerCountFromMessage(message, count);
- fireProducerEvent(new ProducerStartedEvent(this, destination, (ProducerInfo) command, count));
- }
- else if (command instanceof RemoveInfo) {
- RemoveInfo removeInfo = (RemoveInfo) command;
+ fireProducerEvent(new ProducerStartedEvent(this, destination, (ProducerInfo)command, count));
+ } else if (command instanceof RemoveInfo) {
+ RemoveInfo removeInfo = (RemoveInfo)command;
if (removeInfo.isProducerRemove()) {
count = producerCount.decrementAndGet();
count = extractProducerCountFromMessage(message, count);
- fireProducerEvent(new ProducerStoppedEvent(this, destination, (ProducerId) removeInfo.getObjectId(), count));
+ fireProducerEvent(new ProducerStoppedEvent(this, destination, (ProducerId)removeInfo.getObjectId(), count));
}
- }
- else {
+ } else {
log.warn("Unknown command: " + command);
}
- }
- else {
+ } else {
log.warn("Unknown message type: " + message + ". Message ignored");
}
}
@@ -109,12 +108,11 @@ public class ProducerEventSource implements Service, MessageListener {
try {
Object value = message.getObjectProperty("producerCount");
if (value instanceof Number) {
- Number n = (Number) value;
+ Number n = (Number)value;
return n.intValue();
}
log.warn("No producerCount header available on the message: " + message);
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.warn("Failed to extract producerCount from message: " + message + ".Reason: " + e, e);
}
return count;
diff --git a/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploadStrategy.java b/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploadStrategy.java
index 5b75b15d9c..f27920642d 100644
--- a/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploadStrategy.java
+++ b/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploadStrategy.java
@@ -16,14 +16,15 @@
*/
package org.apache.activemq.blob;
-import org.apache.activemq.command.ActiveMQBlobMessage;
-
-import javax.jms.JMSException;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import javax.jms.JMSException;
+
+import org.apache.activemq.command.ActiveMQBlobMessage;
+
/**
* Represents a strategy of uploading a file/stream to some remote
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java b/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java
index f3107b5fe0..c0bdcaec90 100644
--- a/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java
+++ b/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java
@@ -16,17 +16,18 @@
*/
package org.apache.activemq.blob;
-import org.apache.activemq.command.ActiveMQBlobMessage;
-
-import javax.jms.JMSException;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import javax.jms.JMSException;
+
+import org.apache.activemq.command.ActiveMQBlobMessage;
+
/**
* A helper class to represent a required upload of a BLOB to some remote URL
- *
+ *
* @version $Revision: $
*/
public class BlobUploader {
@@ -35,7 +36,6 @@ public class BlobUploader {
private File file;
private InputStream in;
-
public BlobUploader(BlobTransferPolicy blobTransferPolicy, InputStream in) {
this.blobTransferPolicy = blobTransferPolicy;
this.in = in;
@@ -49,13 +49,11 @@ public class BlobUploader {
public URL upload(ActiveMQBlobMessage message) throws JMSException, IOException {
if (file != null) {
return getStrategy().uploadFile(message, file);
- }
- else {
+ } else {
return getStrategy().uploadStream(message, in);
}
}
-
public BlobTransferPolicy getBlobTransferPolicy() {
return blobTransferPolicy;
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
index f7a8450f2b..44f5ae9c4f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
@@ -30,9 +30,11 @@ import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
+
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
+
import org.apache.activemq.ActiveMQConnectionMetaData;
import org.apache.activemq.Service;
import org.apache.activemq.advisory.AdvisoryBroker;
@@ -77,10 +79,10 @@ import org.apache.activemq.transport.TransportFactory;
import org.apache.activemq.transport.TransportServer;
import org.apache.activemq.transport.vm.VMTransportFactory;
import org.apache.activemq.util.IOExceptionSupport;
+import org.apache.activemq.util.IOHelper;
import org.apache.activemq.util.JMXSupport;
import org.apache.activemq.util.ServiceStopper;
import org.apache.activemq.util.URISupport;
-import org.apache.activemq.util.IOHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java b/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
index a59910faf6..ada088e424 100755
--- a/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
@@ -16,9 +16,9 @@
*/
package org.apache.activemq.broker;
+import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.broker.region.MessageReference;
import org.apache.activemq.command.ConnectionId;
@@ -29,8 +29,6 @@ import org.apache.activemq.security.MessageAuthorizationPolicy;
import org.apache.activemq.security.SecurityContext;
import org.apache.activemq.transaction.Transaction;
-import java.io.IOException;
-
/**
* Used to hold context information needed to process requests sent to a broker.
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/DestinationAlreadyExistsException.java b/activemq-core/src/main/java/org/apache/activemq/broker/DestinationAlreadyExistsException.java
index 0f471efe3a..d61b20889f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/DestinationAlreadyExistsException.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/DestinationAlreadyExistsException.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.broker;
-import org.apache.activemq.command.ActiveMQDestination;
-
import javax.jms.JMSException;
+import org.apache.activemq.command.ActiveMQDestination;
+
/**
* An exception thrown if a destination is attempted to be created when it already exists.
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/PropertiesBrokerFactory.java b/activemq-core/src/main/java/org/apache/activemq/broker/PropertiesBrokerFactory.java
index f68c7afa9a..63df6fac8e 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/PropertiesBrokerFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/PropertiesBrokerFactory.java
@@ -16,18 +16,18 @@
*/
package org.apache.activemq.broker;
-import org.apache.activemq.util.IntrospectionSupport;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
-import java.net.MalformedURLException;
import java.util.Map;
import java.util.Properties;
+import org.apache.activemq.util.IntrospectionSupport;
+
/**
* A {@link BrokerFactoryHandler} which uses a properties file to configure the
* broker's various policies.
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/SslBrokerService.java b/activemq-core/src/main/java/org/apache/activemq/broker/SslBrokerService.java
index c6a21ecfe4..6253005cba 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/SslBrokerService.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/SslBrokerService.java
@@ -17,10 +17,6 @@
package org.apache.activemq.broker;
-import org.apache.activemq.transport.TransportFactory;
-import org.apache.activemq.transport.TransportServer;
-import org.apache.activemq.transport.tcp.SslTransportFactory;
-
import java.io.IOException;
import java.net.URI;
import java.security.KeyManagementException;
@@ -29,6 +25,10 @@ import java.security.SecureRandom;
import javax.net.ssl.KeyManager;
import javax.net.ssl.TrustManager;
+import org.apache.activemq.transport.TransportFactory;
+import org.apache.activemq.transport.TransportServer;
+import org.apache.activemq.transport.tcp.SslTransportFactory;
+
/**
* A BrokerService that allows access to the key and trust managers used by SSL
* connections. There is no reason to use this class unless SSL is being used
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/TransactionBroker.java b/activemq-core/src/main/java/org/apache/activemq/broker/TransactionBroker.java
index e884856f4c..eacb5d2725 100755
--- a/activemq-core/src/main/java/org/apache/activemq/broker/TransactionBroker.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/TransactionBroker.java
@@ -16,8 +16,15 @@
*/
package org.apache.activemq.broker;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import javax.jms.JMSException;
+import javax.transaction.xa.XAException;
+
import org.apache.activemq.ActiveMQMessageAudit;
import org.apache.activemq.command.ConnectionInfo;
import org.apache.activemq.command.LocalTransactionId;
@@ -36,15 +43,6 @@ import org.apache.activemq.util.WrappedException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.jms.JMSException;
-
-import javax.transaction.xa.XAException;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
/**
* This broker filter handles the transaction related operations in the Broker
* interface.
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java b/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
index 0d5ebb32f2..b67f102fcf 100755
--- a/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
@@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
+
import org.apache.activemq.Service;
import org.apache.activemq.broker.ft.MasterBroker;
import org.apache.activemq.broker.region.ConnectionStatistics;
@@ -97,8 +98,7 @@ import org.apache.commons.logging.LogFactory;
public class TransportConnection implements Service, Connection, Task, CommandVisitor {
private static final Log LOG = LogFactory.getLog(TransportConnection.class);
- private static final Log TRANSPORTLOG = LogFactory.getLog(TransportConnection.class.getName()
- + ".Transport");
+ private static final Log TRANSPORTLOG = LogFactory.getLog(TransportConnection.class.getName() + ".Transport");
private static final Log SERVICELOG = LogFactory.getLog(TransportConnection.class.getName() + ".Service");
// Keeps track of the broker and connector that created this connection.
protected final Broker broker;
@@ -191,8 +191,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
* @param taskRunnerFactory - can be null if you want direct dispatch to the
* transport else commands are sent async.
*/
- public TransportConnection(TransportConnector connector, final Transport transport, Broker broker,
- TaskRunnerFactory taskRunnerFactory) {
+ public TransportConnection(TransportConnector connector, final Transport transport, Broker broker, TaskRunnerFactory taskRunnerFactory) {
this.connector = connector;
this.broker = broker;
RegionBroker rb = (RegionBroker)broker.getAdaptor(RegionBroker.class);
@@ -272,8 +271,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
else if (e.getClass() == BrokerStoppedException.class) {
if (!disposed.get()) {
if (SERVICELOG.isDebugEnabled())
- SERVICELOG
- .debug("Broker has been stopped. Notifying client and closing his connection.");
+ SERVICELOG.debug("Broker has been stopped. Notifying client and closing his connection.");
ConnectionError ce = new ConnectionError();
ce.setException(e);
dispatchSync(ce);
@@ -403,8 +401,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
}
TransactionState transactionState = cs.getTransactionState(info.getTransactionId());
if (transactionState == null)
- throw new IllegalStateException("Cannot prepare a transaction that had not been started: "
- + info.getTransactionId());
+ throw new IllegalStateException("Cannot prepare a transaction that had not been started: " + info.getTransactionId());
// Avoid dups.
if (!transactionState.isPrepared()) {
transactionState.setPrepared(true);
@@ -473,8 +470,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
return broker.messagePull(lookupConnectionState(pull.getConsumerId()).getContext(), pull);
}
- public Response processMessageDispatchNotification(MessageDispatchNotification notification)
- throws Exception {
+ public Response processMessageDispatchNotification(MessageDispatchNotification notification) throws Exception {
broker.processDispatchNotification(notification);
return null;
}
@@ -503,9 +499,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
TransportConnectionState cs = lookupConnectionState(connectionId);
SessionState ss = cs.getSessionState(sessionId);
if (ss == null)
- throw new IllegalStateException(
- "Cannot add a producer to a session that had not been registered: "
- + sessionId);
+ throw new IllegalStateException("Cannot add a producer to a session that had not been registered: " + sessionId);
// Avoid replaying dup commands
if (!ss.getProducerIds().contains(info.getProducerId())) {
broker.addProducer(cs.getContext(), info);
@@ -524,9 +518,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
TransportConnectionState cs = lookupConnectionState(connectionId);
SessionState ss = cs.getSessionState(sessionId);
if (ss == null)
- throw new IllegalStateException(
- "Cannot remove a producer from a session that had not been registered: "
- + sessionId);
+ throw new IllegalStateException("Cannot remove a producer from a session that had not been registered: " + sessionId);
ProducerState ps = ss.removeProducer(id);
if (ps == null)
throw new IllegalStateException("Cannot remove a producer that had not been registered: " + id);
@@ -541,9 +533,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
TransportConnectionState cs = lookupConnectionState(connectionId);
SessionState ss = cs.getSessionState(sessionId);
if (ss == null)
- throw new IllegalStateException(
- "Cannot add a consumer to a session that had not been registered: "
- + sessionId);
+ throw new IllegalStateException("Cannot add a consumer to a session that had not been registered: " + sessionId);
// Avoid replaying dup commands
if (!ss.getConsumerIds().contains(info.getConsumerId())) {
broker.addConsumer(cs.getContext(), info);
@@ -562,9 +552,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
TransportConnectionState cs = lookupConnectionState(connectionId);
SessionState ss = cs.getSessionState(sessionId);
if (ss == null)
- throw new IllegalStateException(
- "Cannot remove a consumer from a session that had not been registered: "
- + sessionId);
+ throw new IllegalStateException("Cannot remove a consumer from a session that had not been registered: " + sessionId);
ConsumerState consumerState = ss.removeConsumer(id);
if (consumerState == null)
throw new IllegalStateException("Cannot remove a consumer that had not been registered: " + id);
@@ -641,8 +629,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
if (state.getConnection() != this) {
LOG.debug("Killing previous stale connection: " + state.getConnection().getRemoteAddress());
state.getConnection().stop();
- LOG.debug("Connection " + getRemoteAddress() + " taking over previous connection: "
- + state.getConnection().getRemoteAddress());
+ LOG.debug("Connection " + getRemoteAddress() + " taking over previous connection: " + state.getConnection().getRemoteAddress());
state.setConnection(this);
state.reset(info);
}
@@ -765,8 +752,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
}
protected void processDispatch(Command command) throws IOException {
- final MessageDispatch messageDispatch = (MessageDispatch)(command.isMessageDispatch()
- ? command : null);
+ final MessageDispatch messageDispatch = (MessageDispatch)(command.isMessageDispatch() ? command : null);
try {
if (!disposed.get()) {
if (messageDispatch != null) {
@@ -846,8 +832,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
transport.start();
if (taskRunnerFactory != null) {
- taskRunner = taskRunnerFactory.createTaskRunner(this, "ActiveMQ Connection Dispatcher: "
- + getRemoteAddress());
+ taskRunner = taskRunnerFactory.createTaskRunner(this, "ActiveMQ Connection Dispatcher: " + getRemoteAddress());
} else {
taskRunner = null;
}
@@ -1114,8 +1099,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map));
Transport localTransport = TransportFactory.connect(uri);
Transport remoteBridgeTransport = new ResponseCorrelator(transport);
- duplexBridge = NetworkBridgeFactory.createBridge(config, localTransport,
- remoteBridgeTransport);
+ duplexBridge = NetworkBridgeFactory.createBridge(config, localTransport, remoteBridgeTransport);
// now turn duplex off this side
info.setDuplexConnection(false);
duplexBridge.setCreatedByDuplex(true);
@@ -1180,8 +1164,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
ProducerState producerState = ss.getProducerState(id);
if (producerState != null && producerState.getInfo() != null) {
ProducerInfo info = producerState.getInfo();
- result.setMutable(info.getDestination() == null
- || info.getDestination().isComposite());
+ result.setMutable(info.getDestination() == null || info.getDestination().isComposite());
}
}
producerExchanges.put(id, result);
@@ -1285,8 +1268,7 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
//
// /////////////////////////////////////////////////////////////////
- protected TransportConnectionState registerConnectionState(ConnectionId connectionId,
- TransportConnectionState state) {
+ protected TransportConnectionState registerConnectionState(ConnectionId connectionId, TransportConnectionState state) {
TransportConnectionState rc = connectionState;
connectionState = state;
return rc;
@@ -1309,44 +1291,35 @@ public class TransportConnection implements Service, Connection, Task, CommandVi
protected TransportConnectionState lookupConnectionState(String connectionId) {
TransportConnectionState cs = connectionState;
if (cs == null)
- throw new IllegalStateException(
- "Cannot lookup a connectionId for a connection that had not been registered: "
- + connectionId);
+ throw new IllegalStateException("Cannot lookup a connectionId for a connection that had not been registered: " + connectionId);
return cs;
}
protected TransportConnectionState lookupConnectionState(ConsumerId id) {
TransportConnectionState cs = connectionState;
if (cs == null)
- throw new IllegalStateException(
- "Cannot lookup a consumer from a connection that had not been registered: "
- + id.getParentId().getParentId());
+ throw new IllegalStateException("Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId());
return cs;
}
protected TransportConnectionState lookupConnectionState(ProducerId id) {
TransportConnectionState cs = connectionState;
if (cs == null)
- throw new IllegalStateException(
- "Cannot lookup a producer from a connection that had not been registered: "
- + id.getParentId().getParentId());
+ throw new IllegalStateException("Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId());
return cs;
}
protected TransportConnectionState lookupConnectionState(SessionId id) {
TransportConnectionState cs = connectionState;
if (cs == null)
- throw new IllegalStateException(
- "Cannot lookup a session from a connection that had not been registered: "
- + id.getParentId());
+ throw new IllegalStateException("Cannot lookup a session from a connection that had not been registered: " + id.getParentId());
return cs;
}
protected TransportConnectionState lookupConnectionState(ConnectionId connectionId) {
TransportConnectionState cs = connectionState;
if (cs == null)
- throw new IllegalStateException("Cannot lookup a connection that had not been registered: "
- + connectionId);
+ throw new IllegalStateException("Cannot lookup a connection that had not been registered: " + connectionId);
return cs;
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java b/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
index 00956998d4..6fab60019a 100755
--- a/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Iterator;
+import java.util.concurrent.CopyOnWriteArrayList;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -40,8 +41,6 @@ import org.apache.activemq.util.ServiceSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CopyOnWriteArrayList;
-
/**
* @org.apache.xbean.XBean
* @version $Revision: 1.6 $
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/TransportStatusDetector.java b/activemq-core/src/main/java/org/apache/activemq/broker/TransportStatusDetector.java
index b144a89b96..06546b7d2a 100755
--- a/activemq-core/src/main/java/org/apache/activemq/broker/TransportStatusDetector.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/TransportStatusDetector.java
@@ -16,6 +16,8 @@
*/
package org.apache.activemq.broker;
+import java.util.Iterator;
+import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -24,9 +26,6 @@ import org.apache.activemq.ThreadPriorities;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.Iterator;
-import java.util.Set;
-
/**
* Used to provide information on the status of the Connection
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java b/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java
index 8700f78acd..e1522cbffa 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.activemq.Service;
import org.apache.activemq.broker.BrokerService;
@@ -43,7 +44,6 @@ import org.apache.activemq.util.ServiceStopper;
import org.apache.activemq.util.ServiceSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.atomic.AtomicBoolean;
/**
* Connects a Slave Broker to a Master when using Virtual
- * Topics.
+ * href="http://activemq.apache.org/virtual-destinations.html">Virtual Topics.
*
* @org.apache.xbean.XBean
- *
* @version $Revision$
*/
public class VirtualDestinationInterceptor implements DestinationInterceptor {
@@ -46,15 +44,14 @@ public class VirtualDestinationInterceptor implements DestinationInterceptor {
Set virtualDestinations = destinationMap.get(destination.getActiveMQDestination());
List destinations = new ArrayList();
for (Iterator iter = virtualDestinations.iterator(); iter.hasNext();) {
- VirtualDestination virtualDestination = (VirtualDestination) iter.next();
+ VirtualDestination virtualDestination = (VirtualDestination)iter.next();
Destination newNestination = virtualDestination.intercept(destination);
destinations.add(newNestination);
}
if (!destinations.isEmpty()) {
if (destinations.size() == 1) {
- return (Destination) destinations.get(0);
- }
- else {
+ return (Destination)destinations.get(0);
+ } else {
// should rarely be used but here just in case
return createCompositeDestination(destination, destinations);
}
@@ -79,7 +76,7 @@ public class VirtualDestinationInterceptor implements DestinationInterceptor {
return new DestinationFilter(destination) {
public void send(ProducerBrokerExchange context, Message messageSend) throws Exception {
for (Iterator iter = destinations.iterator(); iter.hasNext();) {
- Destination destination = (Destination) iter.next();
+ Destination destination = (Destination)iter.next();
destination.send(context, messageSend);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java b/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
index 47bc6ca224..ac0f01f230 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
@@ -16,16 +16,6 @@
*/
package org.apache.activemq.broker.util;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.Service;
-import org.apache.activemq.advisory.AdvisorySupport;
-import org.apache.activemq.util.ServiceStopper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.FactoryBean;
-
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
@@ -33,9 +23,19 @@ import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.Session;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.Service;
+import org.apache.activemq.advisory.AdvisorySupport;
+import org.apache.activemq.util.ServiceStopper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.FactoryBean;
+import org.springframework.beans.factory.InitializingBean;
+
/**
* An agent which listens to commands on a JMS destination
- *
+ *
* @version $Revision$
* @org.apache.xbean.XBean
*/
@@ -50,7 +50,6 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean,
private Session session;
private MessageConsumer consumer;
-
public void start() throws Exception {
session = getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
listener = new CommandMessageListener(session);
@@ -68,8 +67,7 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean,
try {
consumer.close();
consumer = null;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
stopper.onException(this, e);
}
}
@@ -77,8 +75,7 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean,
try {
session.close();
session = null;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
stopper.onException(this, e);
}
}
@@ -86,15 +83,15 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean,
try {
connection.close();
connection = null;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
stopper.onException(this, e);
}
}
stopper.throwFirstException();
}
- // the following methods ensure that we are created on startup and the lifecycles respected
+ // the following methods ensure that we are created on startup and the
+ // lifecycles respected
// TODO there must be a simpler way?
public void afterPropertiesSet() throws Exception {
start();
@@ -116,10 +113,8 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean,
return true;
}
-
-
// Properties
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public String getBrokerUrl() {
return brokerUrl;
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandHandler.java b/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandHandler.java
index be3c1a2de6..331bb597a1 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandHandler.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandHandler.java
@@ -17,7 +17,6 @@
package org.apache.activemq.broker.util;
import javax.jms.TextMessage;
-import javax.jms.JMSException;
/**
* Represents a processor of text based commands
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java b/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java
index aeb430245e..437106550e 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java
@@ -17,7 +17,6 @@
package org.apache.activemq.broker.util;
import org.apache.activemq.broker.BrokerPluginSupport;
-import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.broker.ConsumerBrokerExchange;
import org.apache.activemq.broker.ProducerBrokerExchange;
import org.apache.activemq.command.Message;
diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/view/DotFileInterceptorSupport.java b/activemq-core/src/main/java/org/apache/activemq/broker/view/DotFileInterceptorSupport.java
index a8711bc45d..549ea0fb93 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/view/DotFileInterceptorSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/view/DotFileInterceptorSupport.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.broker.view;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerFilter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-
/**
* Useful base class
*
@@ -46,8 +46,7 @@ public abstract class DotFileInterceptorSupport extends BrokerFilter {
PrintWriter writer = new PrintWriter(new FileWriter(file));
try {
generateFile(writer);
- }
- finally {
+ } finally {
writer.close();
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/camel/CamelDestination.java b/activemq-core/src/main/java/org/apache/activemq/camel/CamelDestination.java
index fbf5f6825f..6f44706f99 100644
--- a/activemq-core/src/main/java/org/apache/activemq/camel/CamelDestination.java
+++ b/activemq-core/src/main/java/org/apache/activemq/camel/CamelDestination.java
@@ -16,14 +16,6 @@
*/
package org.apache.activemq.camel;
-import org.apache.activemq.ActiveMQConnection;
-import org.apache.activemq.ActiveMQSession;
-import org.apache.activemq.CustomDestination;
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
-import org.apache.camel.Endpoint;
-import org.apache.camel.component.jms.JmsBinding;
-
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
@@ -32,6 +24,14 @@ import javax.jms.QueueSender;
import javax.jms.TopicPublisher;
import javax.jms.TopicSubscriber;
+import org.apache.activemq.ActiveMQConnection;
+import org.apache.activemq.ActiveMQSession;
+import org.apache.activemq.CustomDestination;
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.Endpoint;
+import org.apache.camel.component.jms.JmsBinding;
+
/**
* @version $Revision: $
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageConsumer.java b/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageConsumer.java
index d1bc2ecfa2..960d531133 100644
--- a/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageConsumer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageConsumer.java
@@ -16,6 +16,12 @@
*/
package org.apache.activemq.camel;
+import javax.jms.IllegalStateException;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.util.JMSExceptionSupport;
import org.apache.camel.Consumer;
@@ -24,13 +30,10 @@ import org.apache.camel.Exchange;
import org.apache.camel.PollingConsumer;
import org.apache.camel.Processor;
-import javax.jms.*;
-import javax.jms.IllegalStateException;
-
/**
- * A JMS {@link javax.jms.MessageConsumer} which consumes message exchanges from a
- * Camel {@link Endpoint}
- *
+ * A JMS {@link javax.jms.MessageConsumer} which consumes message exchanges from
+ * a Camel {@link Endpoint}
+ *
* @version $Revision: $
*/
public class CamelMessageConsumer implements MessageConsumer {
@@ -62,11 +65,9 @@ public class CamelMessageConsumer implements MessageConsumer {
if (pollingConsumer != null) {
pollingConsumer.stop();
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw e;
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSExceptionSupport.create(e);
}
}
@@ -99,7 +100,7 @@ public class CamelMessageConsumer implements MessageConsumer {
}
// Properties
- //-----------------------------------------------------------------------
+ // -----------------------------------------------------------------------
public CamelDestination getDestination() {
return destination;
@@ -122,7 +123,7 @@ public class CamelMessageConsumer implements MessageConsumer {
}
// Implementation methods
- //-----------------------------------------------------------------------
+ // -----------------------------------------------------------------------
protected PollingConsumer getPollingConsumer() throws JMSException {
try {
@@ -131,11 +132,9 @@ public class CamelMessageConsumer implements MessageConsumer {
pollingConsumer.start();
}
return pollingConsumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw e;
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSExceptionSupport.create(e);
}
}
@@ -144,8 +143,7 @@ public class CamelMessageConsumer implements MessageConsumer {
if (exchange != null) {
Message message = destination.getBinding().makeJmsMessage(exchange, session);
return message;
- }
- else {
+ } else {
return null;
}
}
@@ -160,11 +158,9 @@ public class CamelMessageConsumer implements MessageConsumer {
});
answer.start();
return answer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw e;
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSExceptionSupport.create(e);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageProducer.java b/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageProducer.java
index 8202b4179b..26f0f83700 100644
--- a/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageProducer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageProducer.java
@@ -16,6 +16,11 @@
*/
package org.apache.activemq.camel;
+import javax.jms.Destination;
+import javax.jms.IllegalStateException;
+import javax.jms.JMSException;
+import javax.jms.Message;
+
import org.apache.activemq.ActiveMQMessageProducerSupport;
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.util.JMSExceptionSupport;
@@ -24,11 +29,6 @@ import org.apache.camel.Producer;
import org.apache.camel.component.jms.JmsExchange;
import org.apache.camel.util.ObjectHelper;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-
/**
* A JMS {@link javax.jms.MessageProducer} which sends message exchanges to a
* Camel {@link Endpoint}
@@ -47,11 +47,9 @@ public class CamelMessageProducer extends ActiveMQMessageProducerSupport {
this.endpoint = endpoint;
try {
this.producer = endpoint.createProducer();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw e;
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSExceptionSupport.create(e);
}
}
@@ -69,33 +67,28 @@ public class CamelMessageProducer extends ActiveMQMessageProducerSupport {
closed = true;
try {
producer.stop();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw e;
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSExceptionSupport.create(e);
}
}
}
public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException {
- CamelDestination camelDestination = null;
+ CamelDestination camelDestination = null;
if (ObjectHelper.equals(destination, this.destination)) {
camelDestination = this.destination;
- }
- else {
+ } else {
// TODO support any CamelDestination?
throw new IllegalArgumentException("Invalid destination setting: " + destination + " when expected: " + this.destination);
}
try {
JmsExchange exchange = new JmsExchange(endpoint.getContext(), camelDestination.getBinding(), message);
producer.process(exchange);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw e;
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSExceptionSupport.create(e);
}
}
@@ -105,4 +98,4 @@ public class CamelMessageProducer extends ActiveMQMessageProducerSupport {
throw new IllegalStateException("The producer is closed");
}
}
-}
\ No newline at end of file
+}
diff --git a/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueue.java b/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueue.java
index 940a944e98..4a4c218733 100644
--- a/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueue.java
+++ b/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueue.java
@@ -16,12 +16,12 @@
*/
package org.apache.activemq.camel;
-import org.apache.activemq.ActiveMQSession;
-
import javax.jms.JMSException;
import javax.jms.Queue;
-import javax.jms.QueueSender;
import javax.jms.QueueReceiver;
+import javax.jms.QueueSender;
+
+import org.apache.activemq.ActiveMQSession;
/**
* A JMS {@link Queue} object which refers to a Camel endpoint
diff --git a/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueueReceiver.java b/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueueReceiver.java
index fc3355ae69..f22b7d749d 100644
--- a/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueueReceiver.java
+++ b/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueueReceiver.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.camel;
-import org.apache.activemq.ActiveMQSession;
-import org.apache.camel.Endpoint;
-
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueReceiver;
+import org.apache.activemq.ActiveMQSession;
+import org.apache.camel.Endpoint;
+
/**
* A JMS {@link javax.jms.QueueReceiver} which consumes message exchanges from a
* Camel {@link org.apache.camel.Endpoint}
diff --git a/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopic.java b/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopic.java
index 9c4a82e0bf..86ccb6b864 100644
--- a/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopic.java
+++ b/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopic.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.camel;
-import org.apache.activemq.ActiveMQSession;
-
import javax.jms.JMSException;
import javax.jms.Topic;
import javax.jms.TopicPublisher;
import javax.jms.TopicSubscriber;
+import org.apache.activemq.ActiveMQSession;
+
/**
* A JMS {@link javax.jms.Topic} object which refers to a Camel endpoint
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicPublisher.java b/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicPublisher.java
index f054af6b97..0e9210f795 100644
--- a/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicPublisher.java
+++ b/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicPublisher.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.camel;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Topic;
+import javax.jms.TopicPublisher;
+
import org.apache.activemq.ActiveMQSession;
import org.apache.camel.Endpoint;
-import javax.jms.JMSException;
-import javax.jms.TopicPublisher;
-import javax.jms.Topic;
-import javax.jms.Message;
-
/**
* A JMS {@link javax.jms.TopicPublisher} which sends message exchanges to a
* Camel {@link Endpoint}
diff --git a/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicSubscriber.java b/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicSubscriber.java
index 77406f060d..7c958b4513 100644
--- a/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicSubscriber.java
+++ b/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicSubscriber.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.camel;
-import org.apache.activemq.ActiveMQSession;
-import org.apache.camel.Endpoint;
-
import javax.jms.JMSException;
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
+import org.apache.activemq.ActiveMQSession;
+import org.apache.camel.Endpoint;
+
/**
* A JMS {@link javax.jms.TopicSubscriber} which consumes message exchanges from a
* Camel {@link Endpoint}
diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java
index e47763c509..0e831f1b53 100644
--- a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java
+++ b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBlobMessage.java
@@ -16,19 +16,20 @@
*/
package org.apache.activemq.command;
-import org.apache.activemq.BlobMessage;
-import org.apache.activemq.blob.BlobUploader;
-import org.apache.activemq.util.JMSExceptionSupport;
-
-import javax.jms.JMSException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
+import javax.jms.JMSException;
+
+import org.apache.activemq.BlobMessage;
+import org.apache.activemq.blob.BlobUploader;
+import org.apache.activemq.util.JMSExceptionSupport;
+
/**
* An implementation of {@link BlobMessage} for out of band BLOB transfer
- *
+ *
* @version $Revision: $
* @openwire:marshaller code="29"
*/
@@ -45,7 +46,6 @@ public class ActiveMQBlobMessage extends ActiveMQMessage implements BlobMessage
private transient BlobUploader blobUploader;
private transient URL url;
-
public Message copy() {
ActiveMQBlobMessage copy = new ActiveMQBlobMessage();
copy(copy);
@@ -76,8 +76,9 @@ public class ActiveMQBlobMessage extends ActiveMQMessage implements BlobMessage
}
/**
- * The MIME type of the BLOB which can be used to apply different content types to messages.
- *
+ * The MIME type of the BLOB which can be used to apply different content
+ * types to messages.
+ *
* @openwire:property version=3 cache=true
*/
public String getMimeType() {
@@ -96,8 +97,9 @@ public class ActiveMQBlobMessage extends ActiveMQMessage implements BlobMessage
}
/**
- * The name of the attachment which can be useful information if transmitting files over ActiveMQ
- *
+ * The name of the attachment which can be useful information if
+ * transmitting files over ActiveMQ
+ *
* @openwire:property version=3 cache=false
*/
public void setName(String name) {
@@ -131,8 +133,7 @@ public class ActiveMQBlobMessage extends ActiveMQMessage implements BlobMessage
if (url == null && remoteBlobUrl != null) {
try {
url = new URL(remoteBlobUrl);
- }
- catch (MalformedURLException e) {
+ } catch (MalformedURLException e) {
throw JMSExceptionSupport.create(e);
}
}
@@ -144,7 +145,6 @@ public class ActiveMQBlobMessage extends ActiveMQMessage implements BlobMessage
remoteBlobUrl = url != null ? url.toExternalForm() : null;
}
-
public BlobUploader getBlobUploader() {
return blobUploader;
}
@@ -156,13 +156,13 @@ public class ActiveMQBlobMessage extends ActiveMQMessage implements BlobMessage
public void onSend() throws JMSException {
super.onSend();
- // lets ensure we upload the BLOB first out of band before we send the message
+ // lets ensure we upload the BLOB first out of band before we send the
+ // message
if (blobUploader != null) {
try {
URL value = blobUploader.upload(this);
setURL(value);
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw JMSExceptionSupport.create(e);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
index b0dcf5322f..237448c971 100755
--- a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
+++ b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
@@ -16,17 +16,29 @@
*/
package org.apache.activemq.command;
-import org.apache.activemq.ActiveMQConnection;
-import org.apache.activemq.util.ByteArrayInputStream;
-import org.apache.activemq.util.ByteArrayOutputStream;
-import org.apache.activemq.util.*;
-
-import javax.jms.*;
-import java.io.*;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.EOFException;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.util.zip.Deflater;
import java.util.zip.DeflaterOutputStream;
import java.util.zip.InflaterInputStream;
+import javax.jms.BytesMessage;
+import javax.jms.JMSException;
+import javax.jms.MessageFormatException;
+import javax.jms.MessageNotReadableException;
+
+import org.apache.activemq.ActiveMQConnection;
+import org.apache.activemq.util.ByteArrayInputStream;
+import org.apache.activemq.util.ByteArrayOutputStream;
+import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.ByteSequenceData;
+import org.apache.activemq.util.JMSExceptionSupport;
+
/**
* A BytesMessage
object is used to send a message containing a
* stream of uninterpreted bytes. It inherits from the Message
diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQDestination.java b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQDestination.java
index bb04a187e7..ac39b265b9 100755
--- a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQDestination.java
+++ b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQDestination.java
@@ -16,9 +16,15 @@
*/
package org.apache.activemq.command;
-import org.apache.activemq.jndi.JNDIBaseStorable;
-import org.apache.activemq.util.IntrospectionSupport;
-import org.apache.activemq.util.URISupport;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
import javax.jms.Destination;
import javax.jms.JMSException;
@@ -26,16 +32,10 @@ import javax.jms.Queue;
import javax.jms.TemporaryQueue;
import javax.jms.TemporaryTopic;
import javax.jms.Topic;
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.StringTokenizer;
+
+import org.apache.activemq.jndi.JNDIBaseStorable;
+import org.apache.activemq.util.IntrospectionSupport;
+import org.apache.activemq.util.URISupport;
/**
* @openwire:marshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java
index c589ba1c69..29d785f627 100755
--- a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java
+++ b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java
@@ -142,7 +142,6 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
* Builds the message body from data
*
* @throws JMSException
- *
* @throws IOException
*/
private void loadContent() throws JMSException {
@@ -503,7 +502,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
*/
public void setBoolean(String name, boolean value) throws JMSException {
initializeWriting();
- put(name, (value) ? Boolean.TRUE : Boolean.FALSE);
+ put(name, value ? Boolean.TRUE : Boolean.FALSE);
}
/**
diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
index ec067c3c71..64d3a2179a 100755
--- a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
+++ b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
@@ -415,8 +415,11 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess
}
protected void checkValidObject(Object value) throws MessageFormatException {
- if (!(value instanceof Boolean || value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long || value instanceof Float
- || value instanceof Double || value instanceof Character || value instanceof String || value == null)) {
+
+ boolean valid = value instanceof Boolean || value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long ;
+ valid = valid || value instanceof Float || value instanceof Double || value instanceof Character || value instanceof String || value == null;
+
+ if (!valid) {
ActiveMQConnection conn = getConnection();
// conn is null if we are in the broker rather than a JMS client
diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java
index 16f4973556..a564f16d6f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java
+++ b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java
@@ -17,15 +17,6 @@
package org.apache.activemq.command;
-import org.apache.activemq.ActiveMQConnection;
-import org.apache.activemq.util.ByteArrayInputStream;
-import org.apache.activemq.util.ByteArrayOutputStream;
-import org.apache.activemq.util.ByteSequence;
-import org.apache.activemq.util.ClassLoadingAwareObjectInputStream;
-import org.apache.activemq.util.JMSExceptionSupport;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -36,6 +27,16 @@ import java.io.Serializable;
import java.util.zip.DeflaterOutputStream;
import java.util.zip.InflaterInputStream;
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+
+import org.apache.activemq.ActiveMQConnection;
+import org.apache.activemq.util.ByteArrayInputStream;
+import org.apache.activemq.util.ByteArrayOutputStream;
+import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.ClassLoadingAwareObjectInputStream;
+import org.apache.activemq.util.JMSExceptionSupport;
+
/**
* An ObjectMessage
object is used to send a message that
* contains a serializable object in the Java programming language ("Java
diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
index 9daaa67ee8..660bb0956a 100755
--- a/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
+++ b/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
@@ -16,17 +16,6 @@
*/
package org.apache.activemq.command;
-import org.apache.activemq.ActiveMQConnection;
-import org.apache.activemq.util.ByteArrayInputStream;
-import org.apache.activemq.util.ByteArrayOutputStream;
-import org.apache.activemq.util.ByteSequence;
-import org.apache.activemq.util.JMSExceptionSupport;
-import org.apache.activemq.util.MarshallingSupport;
-import org.apache.activemq.wireformat.WireFormat;
-
-import javax.jms.JMSException;
-import javax.jms.MessageNotWriteableException;
-import javax.jms.TextMessage;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -35,6 +24,18 @@ import java.io.OutputStream;
import java.util.zip.DeflaterOutputStream;
import java.util.zip.InflaterInputStream;
+import javax.jms.JMSException;
+import javax.jms.MessageNotWriteableException;
+import javax.jms.TextMessage;
+
+import org.apache.activemq.ActiveMQConnection;
+import org.apache.activemq.util.ByteArrayInputStream;
+import org.apache.activemq.util.ByteArrayOutputStream;
+import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.JMSExceptionSupport;
+import org.apache.activemq.util.MarshallingSupport;
+import org.apache.activemq.wireformat.WireFormat;
+
/**
* @openwire:marshaller code="28"
* @version $Revision$
diff --git a/activemq-core/src/main/java/org/apache/activemq/command/RemoveSubscriptionInfo.java b/activemq-core/src/main/java/org/apache/activemq/command/RemoveSubscriptionInfo.java
index f4775ecbea..d236f29c3b 100755
--- a/activemq-core/src/main/java/org/apache/activemq/command/RemoveSubscriptionInfo.java
+++ b/activemq-core/src/main/java/org/apache/activemq/command/RemoveSubscriptionInfo.java
@@ -19,19 +19,17 @@ package org.apache.activemq.command;
import org.apache.activemq.state.CommandVisitor;
/**
- *
* @openwire:marshaller code="9"
* @version $Revision: 1.7 $
*/
public class RemoveSubscriptionInfo extends BaseCommand {
- public static final byte DATA_STRUCTURE_TYPE=CommandTypes.REMOVE_SUBSCRIPTION_INFO;
+ public static final byte DATA_STRUCTURE_TYPE = CommandTypes.REMOVE_SUBSCRIPTION_INFO;
protected ConnectionId connectionId;
protected String clientId;
protected String subscriptionName;
-
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@@ -42,6 +40,7 @@ public class RemoveSubscriptionInfo extends BaseCommand {
public ConnectionId getConnectionId() {
return connectionId;
}
+
public void setConnectionId(ConnectionId connectionId) {
this.connectionId = connectionId;
}
@@ -60,7 +59,7 @@ public class RemoveSubscriptionInfo extends BaseCommand {
public void setSubcriptionName(String subscriptionName) {
this.subscriptionName = subscriptionName;
}
-
+
public String getSubscriptionName() {
return subscriptionName;
}
@@ -81,7 +80,7 @@ public class RemoveSubscriptionInfo extends BaseCommand {
}
public Response visit(CommandVisitor visitor) throws Exception {
- return visitor.processRemoveSubscription( this );
+ return visitor.processRemoveSubscription(this);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/command/Response.java b/activemq-core/src/main/java/org/apache/activemq/command/Response.java
index f2d25c6b8c..c1072aa0c1 100755
--- a/activemq-core/src/main/java/org/apache/activemq/command/Response.java
+++ b/activemq-core/src/main/java/org/apache/activemq/command/Response.java
@@ -23,10 +23,10 @@ import org.apache.activemq.state.CommandVisitor;
* @version $Revision: 1.6 $
*/
public class Response extends BaseCommand {
-
- public static final byte DATA_STRUCTURE_TYPE=CommandTypes.RESPONSE;
+
+ public static final byte DATA_STRUCTURE_TYPE = CommandTypes.RESPONSE;
int correlationId;
-
+
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
@@ -37,11 +37,11 @@ public class Response extends BaseCommand {
public int getCorrelationId() {
return correlationId;
}
-
+
public void setCorrelationId(int responseId) {
this.correlationId = responseId;
}
-
+
public boolean isResponse() {
return true;
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/filter/CompositeDestinationFilter.java b/activemq-core/src/main/java/org/apache/activemq/filter/CompositeDestinationFilter.java
index f208c17b68..74e5352e01 100755
--- a/activemq-core/src/main/java/org/apache/activemq/filter/CompositeDestinationFilter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/filter/CompositeDestinationFilter.java
@@ -20,11 +20,11 @@ import org.apache.activemq.command.ActiveMQDestination;
/**
* A {@link DestinationFilter} used for composite destinations
- *
+ *
* @version $Revision: 1.3 $
*/
public class CompositeDestinationFilter extends DestinationFilter {
-
+
private DestinationFilter filters[];
public CompositeDestinationFilter(ActiveMQDestination destination) {
@@ -32,7 +32,7 @@ public class CompositeDestinationFilter extends DestinationFilter {
filters = new DestinationFilter[destinations.length];
for (int i = 0; i < destinations.length; i++) {
ActiveMQDestination childDestination = destinations[i];
- filters[i]= DestinationFilter.parseFilter(childDestination);
+ filters[i] = DestinationFilter.parseFilter(childDestination);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMap.java b/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMap.java
index 6fcad088b2..0527725c0f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMap.java
+++ b/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMap.java
@@ -51,8 +51,7 @@ public class DestinationMap {
* or composite destinations this will typically be a List of matching
* values.
*
- * @param key
- * the destination to lookup
+ * @param key the destination to lookup
* @return a List of matching values or an empty list if there are no
* matching values.
*/
@@ -64,9 +63,8 @@ public class DestinationMap {
ActiveMQDestination childDestination = destinations[i];
Object value = get(childDestination);
if (value instanceof Set) {
- answer.addAll((Set) value);
- }
- else if (value != null) {
+ answer.addAll((Set)value);
+ } else if (value != null) {
answer.add(value);
}
}
@@ -108,7 +106,7 @@ public class DestinationMap {
public int getTopicRootChildCount() {
return topicRootNode.getChildCount();
}
-
+
public int getQueueRootChildCount() {
return queueRootNode.getChildCount();
}
@@ -121,7 +119,6 @@ public class DestinationMap {
return topicRootNode;
}
-
// Implementation methods
// -------------------------------------------------------------------------
@@ -131,13 +128,12 @@ public class DestinationMap {
*/
protected void setEntries(List entries) {
for (Iterator iter = entries.iterator(); iter.hasNext();) {
- Object element = (Object) iter.next();
+ Object element = (Object)iter.next();
Class type = getEntryClass();
if (type.isInstance(element)) {
- DestinationMapEntry entry = (DestinationMapEntry) element;
+ DestinationMapEntry entry = (DestinationMapEntry)element;
put(entry.getDestination(), entry.getValue());
- }
- else {
+ } else {
throw new IllegalArgumentException("Each entry must be an instance of type: " + type.getName() + " but was: " + element);
}
}
@@ -162,14 +158,14 @@ public class DestinationMap {
/**
* @param key
- * @return
+ * @return
*/
public Set removeAll(ActiveMQDestination key) {
Set rc = new HashSet();
if (key.isComposite()) {
ActiveMQDestination[] destinations = key.getCompositeDestinations();
for (int i = 0; i < destinations.length; i++) {
- rc.add( removeAll(destinations[i]) );
+ rc.add(removeAll(destinations[i]));
}
return rc;
}
@@ -183,8 +179,7 @@ public class DestinationMap {
* no matching value. If there are multiple values, the results are sorted
* and the last item (the biggest) is returned.
*
- * @param destination
- * the destination to find the value for
+ * @param destination the destination to find the value for
* @return the largest matching value or null if no value matches
*/
public Object chooseValue(ActiveMQDestination destination) {
@@ -202,8 +197,7 @@ public class DestinationMap {
protected DestinationMapNode getRootNode(ActiveMQDestination key) {
if (key.isQueue()) {
return queueRootNode;
- }
- else {
+ } else {
return topicRootNode;
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapEntry.java b/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapEntry.java
index 03f1fe1aa1..4505d441a3 100644
--- a/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapEntry.java
+++ b/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapEntry.java
@@ -31,16 +31,13 @@ public abstract class DestinationMapEntry implements InitializingBean, Comparabl
private ActiveMQDestination destination;
-
public int compareTo(Object that) {
if (that instanceof DestinationMapEntry) {
- DestinationMapEntry thatEntry = (DestinationMapEntry) that;
+ DestinationMapEntry thatEntry = (DestinationMapEntry)that;
return ActiveMQDestination.compare(destination, thatEntry.destination);
- }
- else if (that == null) {
+ } else if (that == null) {
return 1;
- }
- else {
+ } else {
return getClass().getName().compareTo(that.getClass().getName());
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapNode.java b/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapNode.java
index 9030ae9429..d433734871 100755
--- a/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapNode.java
+++ b/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapNode.java
@@ -20,10 +20,10 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.Iterator;
/**
* An implementation class used to implement {@link DestinationMap}
diff --git a/activemq-core/src/main/java/org/apache/activemq/filter/DestinationPath.java b/activemq-core/src/main/java/org/apache/activemq/filter/DestinationPath.java
index 281773ee7e..d6488e505c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/filter/DestinationPath.java
+++ b/activemq-core/src/main/java/org/apache/activemq/filter/DestinationPath.java
@@ -27,7 +27,7 @@ import org.apache.activemq.command.Message;
/**
* Helper class for decomposing a Destination into a number of paths
- *
+ *
* @version $Revision: 1.3 $
*/
public class DestinationPath {
@@ -61,7 +61,7 @@ public class DestinationPath {
/**
* Converts the paths to a single String seperated by dots.
- *
+ *
* @param paths
* @return
*/
@@ -74,8 +74,7 @@ public class DestinationPath {
String path = paths[i];
if (path == null) {
buffer.append("*");
- }
- else {
+ } else {
buffer.append(path);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/filter/LogicExpression.java b/activemq-core/src/main/java/org/apache/activemq/filter/LogicExpression.java
index bf15b64d98..9910ee155f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/filter/LogicExpression.java
+++ b/activemq-core/src/main/java/org/apache/activemq/filter/LogicExpression.java
@@ -27,17 +27,17 @@ public abstract class LogicExpression extends BinaryExpression implements Boolea
public static BooleanExpression createOR(BooleanExpression lvalue, BooleanExpression rvalue) {
return new LogicExpression(lvalue, rvalue) {
-
+
public Object evaluate(MessageEvaluationContext message) throws JMSException {
-
- Boolean lv = (Boolean) left.evaluate(message);
+
+ Boolean lv = (Boolean)left.evaluate(message);
// Can we do an OR shortcut??
- if (lv !=null && lv.booleanValue()) {
+ if (lv != null && lv.booleanValue()) {
return Boolean.TRUE;
}
-
- Boolean rv = (Boolean) right.evaluate(message);
- return rv==null ? null : rv;
+
+ Boolean rv = (Boolean)right.evaluate(message);
+ return rv == null ? null : rv;
}
public String getExpressionSymbol() {
@@ -51,7 +51,7 @@ public abstract class LogicExpression extends BinaryExpression implements Boolea
public Object evaluate(MessageEvaluationContext message) throws JMSException {
- Boolean lv = (Boolean) left.evaluate(message);
+ Boolean lv = (Boolean)left.evaluate(message);
// Can we do an AND shortcut??
if (lv == null)
@@ -60,7 +60,7 @@ public abstract class LogicExpression extends BinaryExpression implements Boolea
return Boolean.FALSE;
}
- Boolean rv = (Boolean) right.evaluate(message);
+ Boolean rv = (Boolean)right.evaluate(message);
return rv == null ? null : rv;
}
@@ -82,7 +82,7 @@ public abstract class LogicExpression extends BinaryExpression implements Boolea
public boolean matches(MessageEvaluationContext message) throws JMSException {
Object object = evaluate(message);
- return object!=null && object==Boolean.TRUE;
+ return object != null && object == Boolean.TRUE;
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/filter/XalanXPathEvaluator.java b/activemq-core/src/main/java/org/apache/activemq/filter/XalanXPathEvaluator.java
index f3caf311ff..bb09b4cd86 100755
--- a/activemq-core/src/main/java/org/apache/activemq/filter/XalanXPathEvaluator.java
+++ b/activemq-core/src/main/java/org/apache/activemq/filter/XalanXPathEvaluator.java
@@ -28,9 +28,11 @@ import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.activemq.command.Message;
import org.apache.activemq.util.ByteArrayInputStream;
import org.apache.xpath.CachedXPathAPI;
+
+import org.xml.sax.InputSource;
+
import org.w3c.dom.Document;
import org.w3c.dom.traversal.NodeIterator;
-import org.xml.sax.InputSource;
public class XalanXPathEvaluator implements XPathExpression.XPathEvaluator {
diff --git a/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java b/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
index 20c2f8bfe7..197e019473 100755
--- a/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
@@ -24,8 +24,8 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
+import java.util.concurrent.ConcurrentHashMap;
-import javax.jms.ConnectionFactory;
import javax.jms.Queue;
import javax.jms.Topic;
import javax.naming.Context;
@@ -33,12 +33,9 @@ import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;
import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.Broker;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* A factory of the ActiveMQ InitialContext which contains
* {@link ConnectionFactory} instances as well as a child context called
diff --git a/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.java b/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.java
index 16307e2541..b145ab3675 100644
--- a/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQWASInitialContextFactory.java
@@ -16,12 +16,13 @@
*/
package org.apache.activemq.jndi;
-import javax.naming.Context;
-import javax.naming.NamingException;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
/**
* This implementation of InitialContextFactory
should be used
* when ActiveMQ is used as WebSphere Generic JMS Provider. It is proved that it
@@ -30,7 +31,8 @@ import java.util.Map;
* only if it begins with java.naming or javax.naming prefix. Additionaly
* provider url for the JMS provider can not contain ',' character that is
* necessary when the list of nodes is provided. So the role of this class is to
- * transform properties before passing it to ActiveMQInitialContextFactory
.
+ * transform properties before passing it to
+ * ActiveMQInitialContextFactory
.
*
* @author Pawel Tucholski
*/
@@ -53,8 +55,7 @@ public class ActiveMQWASInitialContextFactory extends ActiveMQInitialContextFact
* (java.naming.provider.url,url1;url2)=>java.naming.provider.url,url1,url1)
*
*
- * @param environment
- * properties for transformation
+ * @param environment properties for transformation
* @return environment after transformation
*/
protected Hashtable transformEnvironment(Hashtable environment) {
@@ -64,36 +65,31 @@ public class ActiveMQWASInitialContextFactory extends ActiveMQInitialContextFact
Iterator it = environment.entrySet().iterator();
while (it.hasNext()) {
- Map.Entry entry = (Map.Entry) it.next();
- String key = (String) entry.getKey();
- String value = (String) entry.getValue();
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ String value = (String)entry.getValue();
if (key.startsWith("java.naming.queue")) {
String key1 = key.substring("java.naming.queue.".length());
key1 = key1.replace('.', '/');
environment1.put("queue." + key1, value);
- }
- else if (key.startsWith("java.naming.topic")) {
+ } else if (key.startsWith("java.naming.topic")) {
String key1 = key.substring("java.naming.topic.".length());
key1 = key1.replace('.', '/');
environment1.put("topic." + key1, value);
- }
- else if (key.startsWith("java.naming.connectionFactoryNames")) {
+ } else if (key.startsWith("java.naming.connectionFactoryNames")) {
String key1 = key.substring("java.naming.".length());
environment1.put(key1, value);
- }
- else if (key.startsWith("java.naming.connection")) {
+ } else if (key.startsWith("java.naming.connection")) {
String key1 = key.substring("java.naming.".length());
environment1.put(key1, value);
- }
- else if (key.startsWith(Context.PROVIDER_URL)) {
+ } else if (key.startsWith(Context.PROVIDER_URL)) {
// websphere administration console does not exept , character
// in provider url, so ; must be used
// all ; to ,
value = value.replace(';', ',');
environment1.put(Context.PROVIDER_URL, value);
- }
- else {
+ } else {
environment1.put(key, value);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIBaseStorable.java b/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIBaseStorable.java
index 603fba5257..483e6ab434 100644
--- a/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIBaseStorable.java
+++ b/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIBaseStorable.java
@@ -16,14 +16,15 @@
*/
package org.apache.activemq.jndi;
-import javax.naming.NamingException;
-import javax.naming.Reference;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Properties;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+
/**
* Facilitates objects to be stored in JNDI as properties
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIReferenceFactory.java b/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIReferenceFactory.java
index d4cd9b0a2d..0a0c14d840 100644
--- a/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIReferenceFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIReferenceFactory.java
@@ -16,18 +16,19 @@
*/
package org.apache.activemq.jndi;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.naming.spi.ObjectFactory;
-import javax.naming.Name;
-import javax.naming.Context;
-import javax.naming.Reference;
-import javax.naming.StringRefAddr;
-import javax.naming.NamingException;
+import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Properties;
-import java.util.Enumeration;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.StringRefAddr;
+import javax.naming.spi.ObjectFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* Converts objects implementing JNDIStorable into a property fields so they can
@@ -40,19 +41,19 @@ public class JNDIReferenceFactory implements ObjectFactory {
/**
* This will be called by a JNDIprovider when a Reference is retrieved from
* a JNDI store - and generates the orignal instance
- *
- * @param object the Reference object
- * @param name the JNDI name
- * @param nameCtx the context
+ *
+ * @param object the Reference object
+ * @param name the JNDI name
+ * @param nameCtx the context
* @param environment the environment settings used by JNDI
* @return the instance built from the Reference object
- * @throws Exception if building the instance from Reference fails (usually class
- * not found)
+ * @throws Exception if building the instance from Reference fails (usually
+ * class not found)
*/
public Object getObjectInstance(Object object, Name name, Context nameCtx, Hashtable environment) throws Exception {
Object result = null;
if (object instanceof Reference) {
- Reference reference = (Reference) object;
+ Reference reference = (Reference)object;
if (log.isTraceEnabled()) {
log.trace("Getting instance of " + reference.getClassName());
@@ -61,19 +62,18 @@ public class JNDIReferenceFactory implements ObjectFactory {
Class theClass = loadClass(this, reference.getClassName());
if (JNDIStorableInterface.class.isAssignableFrom(theClass)) {
- JNDIStorableInterface store = (JNDIStorableInterface) theClass.newInstance();
+ JNDIStorableInterface store = (JNDIStorableInterface)theClass.newInstance();
Properties properties = new Properties();
for (Enumeration iter = reference.getAll(); iter.hasMoreElements();) {
- StringRefAddr addr = (StringRefAddr) iter.nextElement();
+ StringRefAddr addr = (StringRefAddr)iter.nextElement();
properties.put(addr.getType(), (addr.getContent() == null) ? "" : addr.getContent());
}
store.setProperties(properties);
result = store;
}
- }
- else {
+ } else {
log.error("Object " + object + " is not a reference - cannot load");
throw new RuntimeException("Object " + object + " is not a reference");
}
@@ -82,11 +82,11 @@ public class JNDIReferenceFactory implements ObjectFactory {
/**
* Create a Reference instance from a JNDIStorable object
- *
+ *
* @param instanceClassName
* @param po
- * @return @throws
- * NamingException
+ * @return
+ * @throws NamingException
*/
public static Reference createReference(String instanceClassName, JNDIStorableInterface po) throws NamingException {
@@ -97,13 +97,12 @@ public class JNDIReferenceFactory implements ObjectFactory {
try {
Properties props = po.getProperties();
for (Enumeration iter = props.propertyNames(); iter.hasMoreElements();) {
- String key = (String) iter.nextElement();
+ String key = (String)iter.nextElement();
String value = props.getProperty(key);
javax.naming.StringRefAddr addr = new javax.naming.StringRefAddr(key, value);
result.add(addr);
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.error(e.getMessage(), e);
throw new NamingException(e.getMessage());
}
@@ -112,11 +111,11 @@ public class JNDIReferenceFactory implements ObjectFactory {
/**
* Retrieve the class loader for a named class
- *
+ *
* @param thisObj
* @param className
- * @return @throws
- * ClassNotFoundException
+ * @return
+ * @throws ClassNotFoundException
*/
public static Class loadClass(Object thisObj, String className) throws ClassNotFoundException {
@@ -125,8 +124,7 @@ public class JNDIReferenceFactory implements ObjectFactory {
Class theClass;
if (loader != null) {
theClass = loader.loadClass(className);
- }
- else {
+ } else {
// Will be null in jdk1.1.8
// use default classLoader
theClass = Class.forName(className);
diff --git a/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIStorableInterface.java b/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIStorableInterface.java
index 659b9e6e95..426a2a4b44 100644
--- a/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIStorableInterface.java
+++ b/activemq-core/src/main/java/org/apache/activemq/jndi/JNDIStorableInterface.java
@@ -16,9 +16,10 @@
*/
package org.apache.activemq.jndi;
-import javax.naming.Referenceable;
import java.util.Properties;
+import javax.naming.Referenceable;
+
/**
* Faciliates objects to be stored in JNDI as properties
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/jndi/LazyCreateContext.java b/activemq-core/src/main/java/org/apache/activemq/jndi/LazyCreateContext.java
index 96a6169f7f..5562c26d4e 100755
--- a/activemq-core/src/main/java/org/apache/activemq/jndi/LazyCreateContext.java
+++ b/activemq-core/src/main/java/org/apache/activemq/jndi/LazyCreateContext.java
@@ -21,15 +21,14 @@ import javax.naming.NamingException;
/**
* Allows users to dynamically create items
- *
+ *
* @version $Revision: 1.2 $
*/
public abstract class LazyCreateContext extends ReadOnlyContext {
public Object lookup(String name) throws NamingException {
try {
return super.lookup(name);
- }
- catch (NameNotFoundException e) {
+ } catch (NameNotFoundException e) {
Object answer = createEntry(name);
if (answer == null) {
throw e;
diff --git a/activemq-core/src/main/java/org/apache/activemq/jndi/ReadOnlyContext.java b/activemq-core/src/main/java/org/apache/activemq/jndi/ReadOnlyContext.java
index da6a32d755..dce23394aa 100755
--- a/activemq-core/src/main/java/org/apache/activemq/jndi/ReadOnlyContext.java
+++ b/activemq-core/src/main/java/org/apache/activemq/jndi/ReadOnlyContext.java
@@ -17,8 +17,6 @@
package org.apache.activemq.jndi;
-import javax.naming.*;
-import javax.naming.spi.NamingManager;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
@@ -26,6 +24,21 @@ import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
+import javax.naming.Binding;
+import javax.naming.CompositeName;
+import javax.naming.Context;
+import javax.naming.LinkRef;
+import javax.naming.Name;
+import javax.naming.NameClassPair;
+import javax.naming.NameNotFoundException;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.NotContextException;
+import javax.naming.OperationNotSupportedException;
+import javax.naming.Reference;
+import javax.naming.spi.NamingManager;
+
/**
* A read-only Context This version assumes it and all its subcontext are
* read-only and any attempt to modify (e.g. through bind) will result in an
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/MessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/kaha/MessageMarshaller.java
index 0dc595d550..53a7ddf73b 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/MessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/MessageMarshaller.java
@@ -22,21 +22,25 @@ import java.io.IOException;
import org.apache.activemq.command.Message;
import org.apache.activemq.util.ByteSequence;
import org.apache.activemq.wireformat.WireFormat;
+
/**
* Implementation of a Marshaller for MessageIds
*
* @version $Revision: 1.2 $
*/
public class MessageMarshaller implements Marshaller {
-
+
private WireFormat wireFormat;
+
/**
* Constructor
+ *
* @param wireFormat
*/
public MessageMarshaller(WireFormat wireFormat) {
- this.wireFormat=wireFormat;
+ this.wireFormat = wireFormat;
}
+
/**
* Write the payload of this entry to the RawContainer
*
@@ -44,7 +48,7 @@ public class MessageMarshaller implements Marshaller {
* @param dataOut
* @throws IOException
*/
- public void writePayload(Message message,DataOutput dataOut) throws IOException{
+ public void writePayload(Message message, DataOutput dataOut) throws IOException {
ByteSequence packet = wireFormat.marshal(message);
dataOut.writeInt(packet.length);
dataOut.write(packet.data, packet.offset, packet.length);
@@ -57,9 +61,9 @@ public class MessageMarshaller implements Marshaller {
* @return unmarshalled object
* @throws IOException
*/
- public Message readPayload(DataInput dataIn) throws IOException{
- int size=dataIn.readInt();
- byte[] data=new byte[size];
+ public Message readPayload(DataInput dataIn) throws IOException {
+ int size = dataIn.readInt();
+ byte[] data = new byte[size];
dataIn.readFully(data);
return (Message)wireFormat.unmarshal(new ByteSequence(data));
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/StoreEntry.java b/activemq-core/src/main/java/org/apache/activemq/kaha/StoreEntry.java
index 50d44d527d..de1db58dae 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/StoreEntry.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/StoreEntry.java
@@ -17,11 +17,11 @@
package org.apache.activemq.kaha;
/**
-* Entry for Store data
-*
-* @version $Revision: 1.2 $
-*/
-public interface StoreEntry{
+ * Entry for Store data
+ *
+ * @version $Revision: 1.2 $
+ */
+public interface StoreEntry {
public abstract StoreLocation getKeyDataItem();
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java b/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java
index 61f9a7c254..2ea9a7678a 100755
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java
@@ -16,8 +16,8 @@
*/
package org.apache.activemq.kaha;
-import java.io.File;
import java.io.IOException;
+
import org.apache.activemq.kaha.impl.KahaStore;
/**
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/StoreLocation.java b/activemq-core/src/main/java/org/apache/activemq/kaha/StoreLocation.java
index 78c7ae9758..0482ea29c1 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/StoreLocation.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/StoreLocation.java
@@ -23,7 +23,7 @@ package org.apache.activemq.kaha;
*
* @version $Revision: 1.2 $
*/
-public interface StoreLocation{
+public interface StoreLocation {
/**
* @return Returns the size.
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/IndexRootContainer.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/IndexRootContainer.java
index 98643ccc68..a4a5fca058 100755
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/IndexRootContainer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/IndexRootContainer.java
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import org.apache.activemq.kaha.ContainerId;
import org.apache.activemq.kaha.Marshaller;
@@ -32,8 +33,6 @@ import org.apache.activemq.kaha.impl.index.IndexManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* A container of roots for other Containers
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
index 3f473b7070..956c7caef3 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
@@ -36,7 +36,6 @@ import org.apache.activemq.kaha.RuntimeStoreException;
import org.apache.activemq.kaha.Store;
import org.apache.activemq.kaha.StoreLocation;
import org.apache.activemq.kaha.impl.async.AsyncDataManager;
-import org.apache.activemq.kaha.impl.async.ControlFile;
import org.apache.activemq.kaha.impl.async.DataManagerFacade;
import org.apache.activemq.kaha.impl.container.ListContainerImpl;
import org.apache.activemq.kaha.impl.container.MapContainerImpl;
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java
index 4c323be310..9cafa64ab0 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFile.java
@@ -104,6 +104,7 @@ class DataFile extends LinkedNode implements Comparable {
return dataFileId - df.dataFileId;
}
+ @Override
public boolean equals(Object o) {
boolean result = false;
if (o instanceof DataFile) {
@@ -112,4 +113,8 @@ class DataFile extends LinkedNode implements Comparable {
return result;
}
+ @Override
+ public int hashCode() {
+ return dataFileId;
+ }
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java
index c68c37cec8..6a206bf8e9 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java
@@ -230,7 +230,7 @@ class DataFileAppender {
public void close() throws IOException {
synchronized (enqueueMutex) {
- if (shutdown == false) {
+ if (!shutdown) {
shutdown = true;
if (running) {
enqueueMutex.notifyAll();
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java
index e6cf1532d7..c055f01226 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java
@@ -21,9 +21,9 @@ package org.apache.activemq.kaha.impl.container;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+
import org.apache.activemq.kaha.ContainerId;
import org.apache.activemq.kaha.RuntimeStoreException;
-import org.apache.activemq.kaha.Store;
import org.apache.activemq.kaha.StoreEntry;
import org.apache.activemq.kaha.impl.DataManager;
import org.apache.activemq.kaha.impl.data.Item;
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerCollectionSupport.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerCollectionSupport.java
index 0b8cb30d9a..f054a0c325 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerCollectionSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerCollectionSupport.java
@@ -16,26 +16,24 @@
*/
package org.apache.activemq.kaha.impl.container;
-
/**
* Base class for container collections
*
* @version $Revision: 1.2 $
*/
-class ContainerCollectionSupport{
-
+class ContainerCollectionSupport {
+
protected MapContainerImpl container;
-
- protected ContainerCollectionSupport(MapContainerImpl container){
+
+ protected ContainerCollectionSupport(MapContainerImpl container) {
this.container = container;
}
-
- public int size(){
+
+ public int size() {
return container.size();
}
-
- public boolean isEmpty(){
+ public boolean isEmpty() {
return container.isEmpty();
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerKeySet.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerKeySet.java
index 52b1750f86..f3b724c9e2 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerKeySet.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerKeySet.java
@@ -21,8 +21,8 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+
import org.apache.activemq.kaha.impl.index.IndexItem;
-import org.apache.activemq.kaha.impl.index.IndexLinkedList;
/**
* A Set of keys for the container
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollection.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollection.java
index 7e73e0ea2d..b68597f41b 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollection.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollection.java
@@ -19,7 +19,6 @@ package org.apache.activemq.kaha.impl.container;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import org.apache.activemq.kaha.impl.index.IndexItem;
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java
index 4c132da684..4c98e7987f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java
@@ -18,9 +18,9 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
+
import org.apache.activemq.kaha.ContainerId;
import org.apache.activemq.kaha.ListContainer;
import org.apache.activemq.kaha.Marshaller;
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexManager.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexManager.java
index a26f2c0df6..98a0b1205a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexManager.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexManager.java
@@ -15,12 +15,9 @@
package org.apache.activemq.kaha.impl.index;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
-import java.nio.channels.FileLock;
-import java.util.LinkedList;
-import org.apache.activemq.kaha.StoreEntry;
+
import org.apache.activemq.kaha.impl.DataManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndexLinkedList.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndexLinkedList.java
index 3ba7d9bff7..df23e1dd2c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndexLinkedList.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndexLinkedList.java
@@ -161,7 +161,7 @@ public final class VMIndexLinkedList implements Cloneable, IndexLinkedList {
* org.apache.activemq.kaha.impl.IndexItem)
*/
public void add(int index, IndexItem element) {
- addBefore(element, (index == size ? root : entry(index)));
+ addBefore(element, index == size ? root : entry(index));
}
/*
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java
index 1f277796d0..200d325737 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java
@@ -13,13 +13,13 @@
*/
package org.apache.activemq.kaha.impl.index.hash;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* Bin in a HashIndex
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
index 5631b27985..1b59c66608 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
@@ -13,16 +13,16 @@
*/
package org.apache.activemq.kaha.impl.index.hash;
-import org.apache.activemq.kaha.Marshaller;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import org.apache.activemq.kaha.Marshaller;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* A Page within a HashPage
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java
index 8e271fa166..969bf4a09d 100644
--- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java
+++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java
@@ -13,10 +13,6 @@
*/
package org.apache.activemq.kaha.impl.index.tree;
-import org.apache.activemq.kaha.Marshaller;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
@@ -25,9 +21,13 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import org.apache.activemq.kaha.Marshaller;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* Page in a BTree
- *
+ *
* @version $Revision: 1.1.1.1 $
*/
class TreePage {
@@ -52,7 +52,7 @@ class TreePage {
/**
* Constructor
- *
+ *
* @param tree
* @param id
* @param parentId
@@ -67,7 +67,7 @@ class TreePage {
/**
* Constructor
- *
+ *
* @param maximumEntries
*/
public TreePage(int maximumEntries) {
@@ -82,14 +82,14 @@ class TreePage {
public boolean equals(Object o) {
boolean result = false;
if (o instanceof TreePage) {
- TreePage other = (TreePage) o;
+ TreePage other = (TreePage)o;
result = other.id == id;
}
return result;
}
public int hashCode() {
- return (int) id;
+ return (int)id;
}
boolean isActive() {
@@ -190,8 +190,7 @@ class TreePage {
void setParentId(long newId) throws IOException {
if (newId == this.id) {
- throw new IllegalStateException("Cannot set page as a child of itself " + this + " trying to set parentId = "
- + newId);
+ throw new IllegalStateException("Cannot set page as a child of itself " + this + " trying to set parentId = " + newId);
}
this.parentId = newId;
tree.writePage(this);
@@ -242,12 +241,10 @@ class TreePage {
int cmp = te.compareTo(key);
if (cmp == 0) {
return te;
- }
- else if (cmp < 0) {
+ } else if (cmp < 0) {
low = mid + 1;
pageId = te.getNextPageId();
- }
- else {
+ } else {
high = mid - 1;
pageId = te.getPrevPageId();
}
@@ -264,12 +261,10 @@ class TreePage {
if (isRoot()) {
if (isEmpty()) {
insertTreeEntry(0, newEntry);
- }
- else {
+ } else {
result = doInsert(null, newEntry);
}
- }
- else {
+ } else {
throw new IllegalStateException("insert() should not be called on non root page - " + this);
}
return result;
@@ -281,8 +276,7 @@ class TreePage {
if (!isEmpty()) {
result = doRemove(entry);
}
- }
- else {
+ } else {
throw new IllegalStateException("remove() should not be called on non root page");
}
return result;
@@ -302,27 +296,23 @@ class TreePage {
newEntry.setIndexOffset(oldValue);
result = newEntry;
save();
- }
- else if (closestPage != null) {
+ } else if (closestPage != null) {
result = closestPage.doInsert(closest.getFlavour(), newEntry);
- }
- else {
+ } else {
if (!isFull()) {
insertTreeEntry(closest.getIndex(), newEntry);
save();
- }
- else {
+ } else {
doOverflow(flavour, newEntry);
}
}
- }
- else {
+ } else {
if (!isFull()) {
doInsertEntry(newEntry);
save();
- }
- else {
- // need to insert the new entry and propogate up the hightest value
+ } else {
+ // need to insert the new entry and propogate up the hightest
+ // value
doOverflow(flavour, newEntry);
}
}
@@ -335,10 +325,10 @@ class TreePage {
if (!isFull()) {
doInsertEntry(newEntry);
save();
- }
- else {
+ } else {
if (!isRoot() && flavour != null) {
- // we aren't the root, but to ensure the correct distribution we need to
+ // we aren't the root, but to ensure the correct distribution we
+ // need to
// insert the new entry and take a node of the end of the page
// and pass that up the tree to find a home
doInsertEntry(newEntry);
@@ -346,8 +336,7 @@ class TreePage {
theEntry = removeTreeEntry(0);
theEntry.reset();
theEntry.setNextPageId(getId());
- }
- else {
+ } else {
theEntry = removeTreeEntry(size() - 1);
theEntry.reset();
theEntry.setPrevPageId(getId());
@@ -356,11 +345,10 @@ class TreePage {
result = getParent().doOverflow(flavour, theEntry);
if (!theEntry.equals(newEntry)) {
- //the newEntry stayed here
+ // the newEntry stayed here
result = this;
}
- }
- else {
+ } else {
// so we are the root and need to split
doInsertEntry(newEntry);
int midIndex = (size() / 2);
@@ -370,7 +358,8 @@ class TreePage {
TreePage newRoot = tree.createRoot();
newRoot.setLeaf(false);
this.setParentId(newRoot.getId());
- save(); // we are no longer root - need to save - we maybe looked up v. soon!
+ save(); // we are no longer root - need to save - we maybe
+ // looked up v. soon!
TreePage rightPage = tree.createPage(newRoot.getId());
rightPage.setEntries(subList);
rightPage.checkLeaf();
@@ -402,8 +391,7 @@ class TreePage {
save();
// ensure we don't loose children
doUnderflow(result, index);
- }
- else if (closestPage != null) {
+ } else if (closestPage != null) {
closestPage.doRemove(entry);
}
}
@@ -441,8 +429,7 @@ class TreePage {
if (!page.isEmpty()) {
copy.setNextPageId(page.getId());
page.setParentId(this.id);
- }
- else {
+ } else {
page.setLeaf(true);
}
int replacementIndex = doInsertEntry(copy);
@@ -450,8 +437,7 @@ class TreePage {
// page removed so update our replacement
resetPageReference(replacementIndex, copy.getNextPageId());
copy.setNextPageId(TreeEntry.NOT_SET);
- }
- else {
+ } else {
page.save();
}
save();
@@ -466,16 +452,17 @@ class TreePage {
if (page != null && !page.isEmpty()) {
TreeEntry replacement = page.removeTreeEntry(page.getEntries().size() - 1);
TreeEntry copy = replacement.copy();
- // check children pages of the replacement point to the correct place
+ // check children pages of the replacement point to the
+ // correct place
checkParentIdForRemovedPageEntry(copy, page.getId(), getId());
if (!page.isEmpty()) {
copy.setPrevPageId(page.getId());
- }
- else {
+ } else {
page.setLeaf(true);
}
insertTreeEntry(index, copy);
- TreePage landed = null;// if we overflow - the page the replacement ends up on
+ TreePage landed = null;// if we overflow - the page the
+ // replacement ends up on
TreeEntry removed = null;
if (isOverflowed()) {
TreePage parent = getParent();
@@ -485,8 +472,7 @@ class TreePage {
if (flavour == Flavour.LESS) {
removed = removeTreeEntry(0);
landed = parent.doOverflow(flavour, removed);
- }
- else {
+ } else {
removed = removeTreeEntry(size() - 1);
landed = parent.doOverflow(Flavour.MORE, removed);
}
@@ -501,8 +487,7 @@ class TreePage {
landed.resetPageReference(copy.getNextPageId());
copy.setPrevPageId(TreeEntry.NOT_SET);
landed.save();
- }
- else {
+ } else {
page.save();
}
save();
@@ -522,13 +507,15 @@ class TreePage {
private boolean doUnderflowLeaf() throws IOException {
boolean result = false;
- // if we have unerflowed - and we are a leaf - push entries further up the tree
+ // if we have unerflowed - and we are a leaf - push entries further up
+ // the tree
// and delete ourselves
if (isUnderflowed() && isLeaf()) {
List list = new ArrayList(treeEntries);
treeEntries.clear();
for (TreeEntry entry : list) {
- // need to check for each iteration - we might get promoted to root
+ // need to check for each iteration - we might get promoted to
+ // root
TreePage parent = getParent();
if (parent != null) {
Flavour flavour = getFlavour(parent, entry);
@@ -555,8 +542,7 @@ class TreePage {
TreeEntry last = page.getEntries().get(page.getEntries().size() - 1);
if (last.compareTo(entry) > 0) {
result = Flavour.MORE;
- }
- else {
+ } else {
result = Flavour.LESS;
}
}
@@ -614,13 +600,11 @@ class TreePage {
low = mid + 1;
pageId = treeEntry.getNextPageId();
flavour = Flavour.LESS;
- }
- else if (cmp > 0) {
+ } else if (cmp > 0) {
high = mid - 1;
pageId = treeEntry.getPrevPageId();
flavour = Flavour.MORE;
- }
- else {
+ } else {
// got exact match
low = mid;
break;
@@ -642,8 +626,7 @@ class TreePage {
int cmp = midVal.compareTo(newEntry);
if (cmp < 0) {
low = mid + 1;
- }
- else if (cmp > 0) {
+ } else if (cmp > 0) {
high = mid - 1;
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/management/CountStatisticImpl.java b/activemq-core/src/main/java/org/apache/activemq/management/CountStatisticImpl.java
index abd743a89d..4e44d6952e 100755
--- a/activemq-core/src/main/java/org/apache/activemq/management/CountStatisticImpl.java
+++ b/activemq-core/src/main/java/org/apache/activemq/management/CountStatisticImpl.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.management;
-import javax.management.j2ee.statistics.CountStatistic;
-
import java.util.concurrent.atomic.AtomicLong;
+import javax.management.j2ee.statistics.CountStatistic;
+
/**
* A count statistic implementation
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/management/JMSConnectionStatsImpl.java b/activemq-core/src/main/java/org/apache/activemq/management/JMSConnectionStatsImpl.java
index 6c59f5098b..273add152a 100755
--- a/activemq-core/src/main/java/org/apache/activemq/management/JMSConnectionStatsImpl.java
+++ b/activemq-core/src/main/java/org/apache/activemq/management/JMSConnectionStatsImpl.java
@@ -16,13 +16,14 @@
*/
package org.apache.activemq.management;
+import java.util.List;
+
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.util.IndentPrinter;
-import java.util.List;
/**
* Statistics for a JMS connection
- *
+ *
* @version $Revision: 1.2 $
*/
public class JMSConnectionStatsImpl extends StatsImpl {
@@ -40,7 +41,7 @@ public class JMSConnectionStatsImpl extends StatsImpl {
int size = sessionArray.length;
JMSSessionStatsImpl[] answer = new JMSSessionStatsImpl[size];
for (int i = 0; i < size; i++) {
- ActiveMQSession session = (ActiveMQSession) sessionArray[i];
+ ActiveMQSession session = (ActiveMQSession)sessionArray[i];
answer[i] = session.getSessionStats();
}
return answer;
@@ -53,19 +54,18 @@ public class JMSConnectionStatsImpl extends StatsImpl {
stats[i].reset();
}
}
-
+
/**
* @param enabled the enabled to set
*/
- public void setEnabled(boolean enabled){
+ public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
JMSSessionStatsImpl[] stats = getSessions();
for (int i = 0, size = stats.length; i < size; i++) {
stats[i].setEnabled(enabled);
}
-
- }
+ }
public boolean isTransactional() {
return transactional;
@@ -92,7 +92,7 @@ public class JMSConnectionStatsImpl extends StatsImpl {
out.incrementIndent();
JMSSessionStatsImpl[] array = getSessions();
for (int i = 0; i < array.length; i++) {
- JMSSessionStatsImpl sessionStat = (JMSSessionStatsImpl) array[i];
+ JMSSessionStatsImpl sessionStat = (JMSSessionStatsImpl)array[i];
out.printIndent();
out.println("session {");
out.incrementIndent();
diff --git a/activemq-core/src/main/java/org/apache/activemq/management/JMSSessionStatsImpl.java b/activemq-core/src/main/java/org/apache/activemq/management/JMSSessionStatsImpl.java
index 91b6857faf..03f44d706c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/management/JMSSessionStatsImpl.java
+++ b/activemq-core/src/main/java/org/apache/activemq/management/JMSSessionStatsImpl.java
@@ -17,7 +17,6 @@
package org.apache.activemq.management;
import java.util.List;
-import javax.management.j2ee.statistics.*;
import org.apache.activemq.ActiveMQMessageConsumer;
import org.apache.activemq.ActiveMQMessageProducer;
@@ -65,7 +64,7 @@ public class JMSSessionStatsImpl extends StatsImpl {
int size = producerArray.length;
JMSProducerStatsImpl[] answer = new JMSProducerStatsImpl[size];
for (int i = 0; i < size; i++) {
- ActiveMQMessageProducer producer = (ActiveMQMessageProducer) producerArray[i];
+ ActiveMQMessageProducer producer = (ActiveMQMessageProducer)producerArray[i];
answer[i] = producer.getProducerStats();
}
return answer;
@@ -77,12 +76,12 @@ public class JMSSessionStatsImpl extends StatsImpl {
int size = consumerArray.length;
JMSConsumerStatsImpl[] answer = new JMSConsumerStatsImpl[size];
for (int i = 0; i < size; i++) {
- ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer) consumerArray[i];
+ ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer)consumerArray[i];
answer[i] = consumer.getConsumerStats();
}
return answer;
}
-
+
public void reset() {
super.reset();
JMSConsumerStatsImpl[] cstats = getConsumers();
@@ -94,11 +93,11 @@ public class JMSSessionStatsImpl extends StatsImpl {
pstats[i].reset();
}
}
-
+
/**
* @param enabled the enabled to set
*/
- public void setEnabled(boolean enabled){
+ public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
JMSConsumerStatsImpl[] cstats = getConsumers();
for (int i = 0, size = cstats.length; i < size; i++) {
@@ -108,7 +107,7 @@ public class JMSSessionStatsImpl extends StatsImpl {
for (int i = 0, size = pstats.length; i < size; i++) {
pstats[i].setEnabled(enabled);
}
-
+
}
public CountStatisticImpl getMessageCount() {
@@ -193,7 +192,7 @@ public class JMSSessionStatsImpl extends StatsImpl {
out.incrementIndent();
JMSProducerStatsImpl[] producerArray = getProducers();
for (int i = 0; i < producerArray.length; i++) {
- JMSProducerStatsImpl producer = (JMSProducerStatsImpl) producerArray[i];
+ JMSProducerStatsImpl producer = (JMSProducerStatsImpl)producerArray[i];
producer.dump(out);
}
out.decrementIndent();
@@ -205,7 +204,7 @@ public class JMSSessionStatsImpl extends StatsImpl {
out.incrementIndent();
JMSConsumerStatsImpl[] consumerArray = getConsumers();
for (int i = 0; i < consumerArray.length; i++) {
- JMSConsumerStatsImpl consumer = (JMSConsumerStatsImpl) consumerArray[i];
+ JMSConsumerStatsImpl consumer = (JMSConsumerStatsImpl)consumerArray[i];
consumer.dump(out);
}
out.decrementIndent();
diff --git a/activemq-core/src/main/java/org/apache/activemq/management/JMSStatsImpl.java b/activemq-core/src/main/java/org/apache/activemq/management/JMSStatsImpl.java
index b070388c15..8146fb398e 100755
--- a/activemq-core/src/main/java/org/apache/activemq/management/JMSStatsImpl.java
+++ b/activemq-core/src/main/java/org/apache/activemq/management/JMSStatsImpl.java
@@ -17,15 +17,14 @@
package org.apache.activemq.management;
import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.util.IndentPrinter;
-import java.util.concurrent.CopyOnWriteArrayList;
-
/**
* Statistics for a number of JMS connections
- *
+ *
* @version $Revision: 1.2 $
*/
public class JMSStatsImpl extends StatsImpl {
@@ -39,7 +38,7 @@ public class JMSStatsImpl extends StatsImpl {
int size = connectionArray.length;
JMSConnectionStatsImpl[] answer = new JMSConnectionStatsImpl[size];
for (int i = 0; i < size; i++) {
- ActiveMQConnection connection = (ActiveMQConnection) connectionArray[i];
+ ActiveMQConnection connection = (ActiveMQConnection)connectionArray[i];
answer[i] = connection.getConnectionStats();
}
return answer;
@@ -59,7 +58,7 @@ public class JMSStatsImpl extends StatsImpl {
out.incrementIndent();
JMSConnectionStatsImpl[] array = getConnections();
for (int i = 0; i < array.length; i++) {
- JMSConnectionStatsImpl connectionStat = (JMSConnectionStatsImpl) array[i];
+ JMSConnectionStatsImpl connectionStat = (JMSConnectionStatsImpl)array[i];
connectionStat.dump(out);
}
out.decrementIndent();
@@ -67,16 +66,16 @@ public class JMSStatsImpl extends StatsImpl {
out.println("}");
out.flush();
}
-
+
/**
* @param enabled the enabled to set
*/
- public void setEnabled(boolean enabled){
+ public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
JMSConnectionStatsImpl[] stats = getConnections();
for (int i = 0, size = stats.length; i < size; i++) {
stats[i].setEnabled(enabled);
}
-
+
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/management/StatsImpl.java b/activemq-core/src/main/java/org/apache/activemq/management/StatsImpl.java
index c46182ad6c..9aee1a5e87 100755
--- a/activemq-core/src/main/java/org/apache/activemq/management/StatsImpl.java
+++ b/activemq-core/src/main/java/org/apache/activemq/management/StatsImpl.java
@@ -20,13 +20,12 @@ import java.util.*;
import javax.management.j2ee.statistics.Statistic;
import javax.management.j2ee.statistics.Stats;
-
/**
* Base class for a Stats implementation
- *
+ *
* @version $Revision: 1.2 $
*/
-public class StatsImpl extends StatisticImpl implements Stats, Resettable{
+public class StatsImpl extends StatisticImpl implements Stats, Resettable {
private Map map;
public StatsImpl() {
@@ -43,14 +42,14 @@ public class StatsImpl extends StatisticImpl implements Stats, Resettable{
for (int i = 0, size = stats.length; i < size; i++) {
Statistic stat = stats[i];
if (stat instanceof Resettable) {
- Resettable r = (Resettable) stat;
+ Resettable r = (Resettable)stat;
r.reset();
}
}
}
public Statistic getStatistic(String name) {
- return (Statistic) map.get(name);
+ return (Statistic)map.get(name);
}
public String[] getStatisticNames() {
diff --git a/activemq-core/src/main/java/org/apache/activemq/memory/CacheEvictionUsageListener.java b/activemq-core/src/main/java/org/apache/activemq/memory/CacheEvictionUsageListener.java
index bfb2e9e38c..15dc8f9146 100755
--- a/activemq-core/src/main/java/org/apache/activemq/memory/CacheEvictionUsageListener.java
+++ b/activemq-core/src/main/java/org/apache/activemq/memory/CacheEvictionUsageListener.java
@@ -18,6 +18,7 @@ package org.apache.activemq.memory;
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.activemq.thread.Task;
import org.apache.activemq.thread.TaskRunner;
@@ -25,8 +26,6 @@ import org.apache.activemq.thread.TaskRunnerFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CopyOnWriteArrayList;
-
public class CacheEvictionUsageListener implements UsageListener {
private final static Log log = LogFactory.getLog(CacheEvictionUsageListener.class);
diff --git a/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java b/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
index 8c50c529e9..fdba260873 100755
--- a/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
+++ b/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.memory;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.ArrayList;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.activemq.Service;
diff --git a/activemq-core/src/main/java/org/apache/activemq/memory/buffer/MessageQueue.java b/activemq-core/src/main/java/org/apache/activemq/memory/buffer/MessageQueue.java
index 067320cf5f..7672ee1a55 100644
--- a/activemq-core/src/main/java/org/apache/activemq/memory/buffer/MessageQueue.java
+++ b/activemq-core/src/main/java/org/apache/activemq/memory/buffer/MessageQueue.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.memory.buffer;
-import org.apache.activemq.broker.region.MessageReference;
-import org.apache.activemq.command.ActiveMQMessage;
-import org.apache.activemq.command.Message;
-
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import org.apache.activemq.broker.region.MessageReference;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.Message;
+
/**
* Allows messages to be added to the end of the buffer such that they are kept
* around and evicted in a FIFO manner.
diff --git a/activemq-core/src/main/java/org/apache/activemq/memory/buffer/SizeBasedMessageBuffer.java b/activemq-core/src/main/java/org/apache/activemq/memory/buffer/SizeBasedMessageBuffer.java
index 15eab6a004..b266e634ff 100644
--- a/activemq-core/src/main/java/org/apache/activemq/memory/buffer/SizeBasedMessageBuffer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/memory/buffer/SizeBasedMessageBuffer.java
@@ -69,7 +69,7 @@ public class SizeBasedMessageBuffer implements MessageBuffer {
size += delta;
while (size > limit) {
- MessageQueue biggest = (MessageQueue) bubbleList.get(0);
+ MessageQueue biggest = (MessageQueue)bubbleList.get(0);
size -= biggest.evictMessage();
bubbleDown(biggest, 0);
@@ -80,7 +80,7 @@ public class SizeBasedMessageBuffer implements MessageBuffer {
public void clear() {
synchronized (lock) {
for (Iterator iter = bubbleList.iterator(); iter.hasNext();) {
- MessageQueue queue = (MessageQueue) iter.next();
+ MessageQueue queue = (MessageQueue)iter.next();
queue.clear();
}
size = 0;
@@ -91,11 +91,10 @@ public class SizeBasedMessageBuffer implements MessageBuffer {
// lets bubble up to head of queueif we need to
int position = queue.getPosition();
while (--position >= 0) {
- MessageQueue pivot = (MessageQueue) bubbleList.get(position);
+ MessageQueue pivot = (MessageQueue)bubbleList.get(position);
if (pivot.getSize() < queueSize) {
swap(position, pivot, position + 1, queue);
- }
- else {
+ } else {
break;
}
}
@@ -104,11 +103,10 @@ public class SizeBasedMessageBuffer implements MessageBuffer {
protected void bubbleDown(MessageQueue biggest, int position) {
int queueSize = biggest.getSize();
for (int second = position + 1, end = bubbleList.size(); second < end; second++) {
- MessageQueue pivot = (MessageQueue) bubbleList.get(second);
+ MessageQueue pivot = (MessageQueue)bubbleList.get(second);
if (pivot.getSize() > queueSize) {
swap(position, biggest, second, pivot);
- }
- else {
+ } else {
break;
}
position = second;
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/CompositeDemandForwardingBridge.java b/activemq-core/src/main/java/org/apache/activemq/network/CompositeDemandForwardingBridge.java
index 176eaeba43..55dfd46bc2 100644
--- a/activemq-core/src/main/java/org/apache/activemq/network/CompositeDemandForwardingBridge.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/CompositeDemandForwardingBridge.java
@@ -16,6 +16,8 @@
*/
package org.apache.activemq.network;
+import java.io.IOException;
+
import org.apache.activemq.command.BrokerId;
import org.apache.activemq.command.BrokerInfo;
import org.apache.activemq.command.Command;
@@ -25,8 +27,6 @@ import org.apache.activemq.command.NetworkBridgeFilter;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.util.ServiceSupport;
-import java.io.IOException;
-
/**
* A demand forwarding bridge which works with multicast style transports where
* a single Transport could be communicating with multiple remote brokers
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/ConduitBridge.java b/activemq-core/src/main/java/org/apache/activemq/network/ConduitBridge.java
index 59fb97c187..ff82ed9090 100644
--- a/activemq-core/src/main/java/org/apache/activemq/network/ConduitBridge.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/ConduitBridge.java
@@ -16,6 +16,11 @@
*/
package org.apache.activemq.network;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
import org.apache.activemq.command.ConsumerId;
import org.apache.activemq.command.ConsumerInfo;
import org.apache.activemq.filter.DestinationFilter;
@@ -23,11 +28,6 @@ import org.apache.activemq.transport.Transport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
/**
* Consolidates subscriptions
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java b/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
index a664affd93..48790b4aff 100755
--- a/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
@@ -16,6 +16,8 @@
*/
package org.apache.activemq.network;
+import java.io.IOException;
+
import org.apache.activemq.command.BrokerId;
import org.apache.activemq.command.BrokerInfo;
import org.apache.activemq.command.Command;
@@ -24,8 +26,6 @@ import org.apache.activemq.command.NetworkBridgeFilter;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.util.ServiceSupport;
-import java.io.IOException;
-
/**
* Forwards messages from the local broker to the remote broker based on demand.
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java b/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
index bd6f91e56e..556c67864e 100644
--- a/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
@@ -266,7 +266,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge {
protected void startRemoteBridge() throws Exception {
if (remoteBridgeStarted.compareAndSet(false, true)) {
synchronized (this) {
- if (isCreatedByDuplex() == false) {
+ if (!isCreatedByDuplex()) {
BrokerInfo brokerInfo = new BrokerInfo();
brokerInfo.setBrokerName(configuration.getBrokerName());
brokerInfo.setNetworkConnection(true);
@@ -436,7 +436,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge {
// Create a new local subscription
ConsumerInfo info = (ConsumerInfo)data;
BrokerId[] path = info.getBrokerPath();
- if ((path != null && path.length >= networkTTL)) {
+ if (path != null && path.length >= networkTTL) {
if (log.isDebugEnabled())
log.debug(configuration.getBrokerName() + " Ignoring Subscription " + info + " restricted to " + networkTTL + " network hops only");
return;
@@ -466,16 +466,18 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge {
// infomation about temporary destinations
DestinationInfo destInfo = (DestinationInfo)data;
BrokerId[] path = destInfo.getBrokerPath();
- if ((path != null && path.length >= networkTTL)) {
- if (log.isDebugEnabled())
+ if (path != null && path.length >= networkTTL) {
+ if (log.isDebugEnabled()) {
log.debug("Ignoring Subscription " + destInfo + " restricted to " + networkTTL + " network hops only");
+ }
return;
}
if (contains(destInfo.getBrokerPath(), localBrokerPath[0])) {
// Ignore this consumer as it's a consumer we locally sent to
// the broker.
- if (log.isDebugEnabled())
+ if (log.isDebugEnabled()) {
log.debug("Ignoring sub " + destInfo + " already routed through this broker once");
+ }
return;
}
destInfo.setConnectionId(localConnectionInfo.getConnectionId());
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java b/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java
index 495b5e45d7..1667d33a0d 100644
--- a/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java
@@ -16,14 +16,13 @@
*/
package org.apache.activemq.network;
+import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.command.ConsumerId;
import org.apache.activemq.command.ConsumerInfo;
-import java.util.Set;
-
/**
* Represents a network bridge interface
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java b/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
index c1c6c662c6..b6bf33ce10 100644
--- a/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
import org.apache.activemq.command.DiscoveryEvent;
import org.apache.activemq.transport.Transport;
@@ -30,8 +31,6 @@ import org.apache.activemq.transport.discovery.DiscoveryListener;
import org.apache.activemq.util.ServiceStopper;
import org.apache.activemq.util.ServiceSupport;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* A network connector which uses a discovery agent to detect the remote brokers
* available and setup a connection to each available remote broker
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/DurableConduitBridge.java b/activemq-core/src/main/java/org/apache/activemq/network/DurableConduitBridge.java
index bd148f1590..e6e99c77a6 100644
--- a/activemq-core/src/main/java/org/apache/activemq/network/DurableConduitBridge.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/DurableConduitBridge.java
@@ -16,6 +16,9 @@
*/
package org.apache.activemq.network;
+import java.io.IOException;
+import java.util.Iterator;
+
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ConsumerId;
import org.apache.activemq.command.ConsumerInfo;
@@ -24,9 +27,6 @@ import org.apache.activemq.transport.Transport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.io.IOException;
-import java.util.Iterator;
-
/**
* Consolidates subscriptions
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/MulticastNetworkConnector.java b/activemq-core/src/main/java/org/apache/activemq/network/MulticastNetworkConnector.java
index f4856e1fa1..b99266f971 100644
--- a/activemq-core/src/main/java/org/apache/activemq/network/MulticastNetworkConnector.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/MulticastNetworkConnector.java
@@ -16,12 +16,12 @@
*/
package org.apache.activemq.network;
+import java.net.URI;
+
import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportFactory;
import org.apache.activemq.util.ServiceStopper;
-import java.net.URI;
-
/**
* A network connector which uses some kind of multicast-like transport that
* communicates with potentially many remote brokers over a single logical
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java b/activemq-core/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java
index b7683afec0..c65952c783 100755
--- a/activemq-core/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java
@@ -18,10 +18,6 @@ package org.apache.activemq.network.jms;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.activemq.Service;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
@@ -31,6 +27,10 @@ import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.naming.NamingException;
+import org.apache.activemq.Service;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* A Destination bridge is used to bridge between to different JMS systems
*
@@ -53,8 +53,7 @@ public abstract class DestinationBridge implements Service, MessageListener {
}
/**
- * @param consumer
- * The consumer to set.
+ * @param consumer The consumer to set.
*/
public void setConsumer(MessageConsumer consumer) {
this.consumer = consumer;
@@ -121,25 +120,21 @@ public abstract class DestinationBridge implements Service, MessageListener {
Destination replyTo = message.getJMSReplyTo();
if (replyTo != null) {
converted = jmsMessageConvertor.convert(message, processReplyToDestination(replyTo));
- }
- else {
+ } else {
converted = jmsMessageConvertor.convert(message);
}
- }
- else {
+ } else {
message.setJMSReplyTo(null);
converted = jmsMessageConvertor.convert(message);
}
sendMessage(converted);
message.acknowledge();
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.error("failed to forward message on attempt: " + (++attempt) + " reason: " + e + " message: " + message, e);
if (maximumRetries > 0 && attempt >= maximumRetries) {
try {
stop();
- }
- catch (Exception e1) {
+ } catch (Exception e1) {
log.warn("Failed to stop cleanly", e1);
}
}
@@ -155,8 +150,7 @@ public abstract class DestinationBridge implements Service, MessageListener {
}
/**
- * @param doHandleReplyTo
- * The doHandleReplyTo to set.
+ * @param doHandleReplyTo The doHandleReplyTo to set.
*/
protected void setDoHandleReplyTo(boolean doHandleReplyTo) {
this.doHandleReplyTo = doHandleReplyTo;
@@ -175,8 +169,7 @@ public abstract class DestinationBridge implements Service, MessageListener {
protected void restartProducer() throws JMSException, NamingException {
try {
getConnectionForProducer().close();
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.debug("Ignoring failure to close producer connection: " + e, e);
}
jmsConnector.restartProducerConnection();
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsConnector.java b/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
index ee10236561..91e6d9b66d 100755
--- a/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
@@ -19,6 +19,8 @@ package org.apache.activemq.network.jms;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
import javax.jms.Connection;
import javax.jms.Destination;
@@ -33,9 +35,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.jndi.JndiTemplate;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* This bridge joins the gap between foreign JMS providers and ActiveMQ As some
* JMS providers are still only 1.0.1 compliant, this bridge itself aimed to be
@@ -62,29 +61,28 @@ public abstract class JmsConnector implements Service {
protected String localPassword;
private String name;
- protected LRUCache replyToBridges = createLRUCache();
-
- static private LRUCache createLRUCache() {
- return new LRUCache() {
- private static final long serialVersionUID = -7446792754185879286L;
-
- protected boolean removeEldestEntry(Map.Entry enty) {
- if (size() > maxCacheSize) {
- Iterator iter = entrySet().iterator();
- Map.Entry lru = (Map.Entry) iter.next();
- remove(lru.getKey());
- DestinationBridge bridge = (DestinationBridge) lru.getValue();
- try {
- bridge.stop();
- log.info("Expired bridge: " + bridge);
- }
- catch (Exception e) {
- log.warn("stopping expired bridge" + bridge + " caused an exception", e);
- }
- }
- return false;
- }
- };
+ protected LRUCache replyToBridges = createLRUCache();
+
+ static private LRUCache createLRUCache() {
+ return new LRUCache() {
+ private static final long serialVersionUID = -7446792754185879286L;
+
+ protected boolean removeEldestEntry(Map.Entry enty) {
+ if (size() > maxCacheSize) {
+ Iterator iter = entrySet().iterator();
+ Map.Entry lru = (Map.Entry)iter.next();
+ remove(lru.getKey());
+ DestinationBridge bridge = (DestinationBridge)lru.getValue();
+ try {
+ bridge.stop();
+ log.info("Expired bridge: " + bridge);
+ } catch (Exception e) {
+ log.warn("stopping expired bridge" + bridge + " caused an exception", e);
+ }
+ }
+ return false;
+ }
+ };
}
/**
@@ -113,11 +111,11 @@ public abstract class JmsConnector implements Service {
init();
if (started.compareAndSet(false, true)) {
for (int i = 0; i < inboundBridges.size(); i++) {
- DestinationBridge bridge = (DestinationBridge) inboundBridges.get(i);
+ DestinationBridge bridge = (DestinationBridge)inboundBridges.get(i);
bridge.start();
}
for (int i = 0; i < outboundBridges.size(); i++) {
- DestinationBridge bridge = (DestinationBridge) outboundBridges.get(i);
+ DestinationBridge bridge = (DestinationBridge)outboundBridges.get(i);
bridge.start();
}
log.info("JMS Connector " + getName() + " Started");
@@ -127,11 +125,11 @@ public abstract class JmsConnector implements Service {
public void stop() throws Exception {
if (started.compareAndSet(true, false)) {
for (int i = 0; i < inboundBridges.size(); i++) {
- DestinationBridge bridge = (DestinationBridge) inboundBridges.get(i);
+ DestinationBridge bridge = (DestinationBridge)inboundBridges.get(i);
bridge.stop();
}
for (int i = 0; i < outboundBridges.size(); i++) {
- DestinationBridge bridge = (DestinationBridge) outboundBridges.get(i);
+ DestinationBridge bridge = (DestinationBridge)outboundBridges.get(i);
bridge.stop();
}
log.info("JMS Connector " + getName() + " Stopped");
@@ -158,8 +156,7 @@ public abstract class JmsConnector implements Service {
}
/**
- * @param jndiTemplate
- * The jndiTemplate to set.
+ * @param jndiTemplate The jndiTemplate to set.
*/
public void setJndiLocalTemplate(JndiTemplate jndiTemplate) {
this.jndiLocalTemplate = jndiTemplate;
@@ -173,8 +170,7 @@ public abstract class JmsConnector implements Service {
}
/**
- * @param jndiOutboundTemplate
- * The jndiOutboundTemplate to set.
+ * @param jndiOutboundTemplate The jndiOutboundTemplate to set.
*/
public void setJndiOutboundTemplate(JndiTemplate jndiOutboundTemplate) {
this.jndiOutboundTemplate = jndiOutboundTemplate;
@@ -188,8 +184,7 @@ public abstract class JmsConnector implements Service {
}
/**
- * @param inboundMessageConvertor
- * The inboundMessageConvertor to set.
+ * @param inboundMessageConvertor The inboundMessageConvertor to set.
*/
public void setInboundMessageConvertor(JmsMesageConvertor jmsMessageConvertor) {
this.inboundMessageConvertor = jmsMessageConvertor;
@@ -203,8 +198,7 @@ public abstract class JmsConnector implements Service {
}
/**
- * @param outboundMessageConvertor
- * The outboundMessageConvertor to set.
+ * @param outboundMessageConvertor The outboundMessageConvertor to set.
*/
public void setOutboundMessageConvertor(JmsMesageConvertor outboundMessageConvertor) {
this.outboundMessageConvertor = outboundMessageConvertor;
@@ -218,8 +212,8 @@ public abstract class JmsConnector implements Service {
}
/**
- * @param replyToDestinationCacheSize
- * The replyToDestinationCacheSize to set.
+ * @param replyToDestinationCacheSize The replyToDestinationCacheSize to
+ * set.
*/
public void setReplyToDestinationCacheSize(int replyToDestinationCacheSize) {
this.replyToDestinationCacheSize = replyToDestinationCacheSize;
@@ -233,8 +227,7 @@ public abstract class JmsConnector implements Service {
}
/**
- * @param localPassword
- * The localPassword to set.
+ * @param localPassword The localPassword to set.
*/
public void setLocalPassword(String localPassword) {
this.localPassword = localPassword;
@@ -248,8 +241,7 @@ public abstract class JmsConnector implements Service {
}
/**
- * @param localUsername
- * The localUsername to set.
+ * @param localUsername The localUsername to set.
*/
public void setLocalUsername(String localUsername) {
this.localUsername = localUsername;
@@ -263,8 +255,7 @@ public abstract class JmsConnector implements Service {
}
/**
- * @param outboundPassword
- * The outboundPassword to set.
+ * @param outboundPassword The outboundPassword to set.
*/
public void setOutboundPassword(String outboundPassword) {
this.outboundPassword = outboundPassword;
@@ -278,8 +269,7 @@ public abstract class JmsConnector implements Service {
}
/**
- * @param outboundUsername
- * The outboundUsername to set.
+ * @param outboundUsername The outboundUsername to set.
*/
public void setOutboundUsername(String outboundUsername) {
this.outboundUsername = outboundUsername;
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java b/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java
index 69c2dbf520..c62a61d2c5 100755
--- a/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java
@@ -16,9 +16,6 @@
*/
package org.apache.activemq.network.jms;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
@@ -29,6 +26,9 @@ import javax.jms.QueueSession;
import javax.jms.Session;
import javax.naming.NamingException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* A Bridge to other JMS Queue providers
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/network/jms/QueueBridge.java b/activemq-core/src/main/java/org/apache/activemq/network/jms/QueueBridge.java
index a67e8a1b7f..4d15b4c13a 100755
--- a/activemq-core/src/main/java/org/apache/activemq/network/jms/QueueBridge.java
+++ b/activemq-core/src/main/java/org/apache/activemq/network/jms/QueueBridge.java
@@ -17,7 +17,6 @@
package org.apache.activemq.network.jms;
import javax.jms.Connection;
-import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
@@ -27,7 +26,6 @@ import javax.jms.QueueConnection;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
-import javax.jms.Topic;
/**
* A Destination bridge is used to bridge between to different JMS systems
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/BooleanStream.java b/activemq-core/src/main/java/org/apache/activemq/openwire/BooleanStream.java
index 10931b72bf..64af4c54ea 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/BooleanStream.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/BooleanStream.java
@@ -17,9 +17,7 @@
package org.apache.activemq.openwire;
import java.io.DataInput;
-import java.io.DataInputStream;
import java.io.DataOutput;
-import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/CommandIdComparator.java b/activemq-core/src/main/java/org/apache/activemq/openwire/CommandIdComparator.java
index bf14355777..419fbd0f71 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/CommandIdComparator.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/CommandIdComparator.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.openwire;
-import org.apache.activemq.command.Command;
-
import java.util.Comparator;
+import org.apache.activemq.command.Command;
+
/**
* A @{link Comparator} of commands using their {@link Command#getCommandId()}
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/DataStreamMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/DataStreamMarshaller.java
index 45a85e69c4..51073cbf74 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/DataStreamMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/DataStreamMarshaller.java
@@ -17,9 +17,7 @@
package org.apache.activemq.openwire;
import java.io.DataInput;
-import java.io.DataInputStream;
import java.io.DataOutput;
-import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.activemq.command.DataStructure;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQBytesMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQBytesMessageMarshaller.java
index 42b1de8ce4..0435d16ba7 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQBytesMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQBytesMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQBytesMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQDestinationMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQDestinationMarshaller.java
index 71d6f6e050..02da2cbe6c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQDestinationMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQDestinationMarshaller.java
@@ -21,8 +21,9 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMapMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMapMessageMarshaller.java
index 3cfbdc70d6..51677441aa 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMapMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMapMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQMapMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMessageMarshaller.java
index 48dae9b0af..e8b544d96e 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQObjectMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQObjectMessageMarshaller.java
index 596debe65d..b0359f4cdb 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQObjectMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQObjectMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQObjectMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQQueueMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQQueueMarshaller.java
index 8f8bd990bb..54fcd74bb1 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQQueueMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQQueueMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQStreamMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQStreamMessageMarshaller.java
index 3ea20fa5da..39dfcf6d7d 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQStreamMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQStreamMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQStreamMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempDestinationMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempDestinationMarshaller.java
index de14e15312..37d2417f88 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempDestinationMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempDestinationMarshaller.java
@@ -21,8 +21,8 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempQueueMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempQueueMarshaller.java
index dd395d5be4..e36c7125aa 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempQueueMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempQueueMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTempQueue;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempTopicMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempTopicMarshaller.java
index 355a3176e3..0b45140321 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempTopicMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempTopicMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTempTopic;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTextMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTextMessageMarshaller.java
index 8681537d2a..0ec8221374 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTextMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTextMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTextMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTopicMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTopicMarshaller.java
index acb95309d3..af26ec17b9 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTopicMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTopicMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseCommandMarshaller.java
index 474894f26f..15a7de0a13 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseCommandMarshaller.java
@@ -21,8 +21,9 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BaseCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java
index 6f97e2da75..15ea62a34e 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java
@@ -63,11 +63,11 @@ abstract public class BaseDataStreamMarshaller implements DataStreamMarshaller {
bs.writeBoolean(false);
bs.writeBoolean(false);
return 0;
- } else if ((o & 0xFFFFFFFFFFFF0000l) == 0) {
+ } else if ((o & 0xFFFFFFFFFFFF0000L) == 0) {
bs.writeBoolean(false);
bs.writeBoolean(true);
return 2;
- } else if ((o & 0xFFFFFFFF00000000l) == 0) {
+ } else if ((o & 0xFFFFFFFF00000000L) == 0) {
bs.writeBoolean(true);
bs.writeBoolean(false);
return 4;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerIdMarshaller.java
index b4b736e398..8b93636438 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerInfoMarshaller.java
index bc792214f0..3ed6f701b3 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerInfoMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.BrokerInfo;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for BrokerInfoMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for BrokerInfoMarshaller NOTE!: This
+ * file is auto generated - do not modify! if you need to make a change, please
+ * see the modify the groovy scripts in the under src/gram/script and then use
+ * maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class BrokerInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return BrokerInfo.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,18 +63,17 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
BrokerInfo info = (BrokerInfo)o;
- info.setBrokerId((org.apache.activemq.command.BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setBrokerId((org.apache.activemq.command.BrokerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setBrokerURL(tightUnmarshalString(dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerInfo value[] = new org.apache.activemq.command.BrokerInfo[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerInfo) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerInfo)tightUnmarsalNestedObject(wireFormat, dataIn, bs);
}
info.setPeerBrokerInfos(value);
- }
- else {
+ } else {
info.setPeerBrokerInfos(null);
}
info.setBrokerName(tightUnmarshalString(dataIn, bs));
@@ -86,7 +83,6 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -108,7 +104,7 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -129,7 +125,7 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -138,18 +134,17 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
super.looseUnmarshal(wireFormat, o, dataIn);
BrokerInfo info = (BrokerInfo)o;
- info.setBrokerId((org.apache.activemq.command.BrokerId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setBrokerId((org.apache.activemq.command.BrokerId)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setBrokerURL(looseUnmarshalString(dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerInfo value[] = new org.apache.activemq.command.BrokerInfo[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerInfo) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerInfo)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setPeerBrokerInfos(value);
- }
- else {
+ } else {
info.setPeerBrokerInfos(null);
}
info.setBrokerName(looseUnmarshalString(dataIn));
@@ -159,7 +154,6 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionControlMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionControlMarshaller.java
index 9943a23070..17a9c50490 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionControlMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionControlMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionControl;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionErrorMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionErrorMarshaller.java
index 01dbb71d23..421549ec42 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionErrorMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionErrorMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionError;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionIdMarshaller.java
index 526e856ed4..11e39c8661 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionId;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionInfoMarshaller.java
index de07cbf05c..0613fdf32c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionInfo;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ConnectionInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerControlMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerControlMarshaller.java
index 11e20b4eb5..c9d4b32397 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerControlMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerControlMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerControl;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerIdMarshaller.java
index 793ef86df7..726aa86e8d 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerId;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ConsumerIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerInfoMarshaller.java
index 41d71c426a..e6fa54777f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerInfo;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ConsumerInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ControlCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ControlCommandMarshaller.java
index 49ce850127..08ffeb6738 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ControlCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ControlCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ControlCommand;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataArrayResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataArrayResponseMarshaller.java
index f0700b3635..67570b35bf 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataArrayResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataArrayResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataArrayResponse;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for DataArrayResponseMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataResponseMarshaller.java
index f80bfb7d1a..0a3da929d4 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataResponse;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataStructureSupportMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataStructureSupportMarshaller.java
index 9678337426..e59a560143 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataStructureSupportMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DataStructureSupportMarshaller.java
@@ -21,8 +21,8 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DestinationInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DestinationInfoMarshaller.java
index c341332c0e..231fcae56c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DestinationInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DestinationInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.DestinationInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for DestinationInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DiscoveryEventMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DiscoveryEventMarshaller.java
index 0557f87f5f..b7bb7847c0 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DiscoveryEventMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/DiscoveryEventMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.DiscoveryEvent;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ExceptionResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ExceptionResponseMarshaller.java
index 9d956eeb80..d2c425ca2c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ExceptionResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ExceptionResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ExceptionResponse;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/FlushCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/FlushCommandMarshaller.java
index 3a1a2270b3..8c8fc68319 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/FlushCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/FlushCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.FlushCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/IntegerResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/IntegerResponseMarshaller.java
index 0718e42da9..294a00bb46 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/IntegerResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/IntegerResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.IntegerResponse;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalQueueAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalQueueAckMarshaller.java
index 5213d81e8d..4c6b84dc5b 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalQueueAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalQueueAckMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalQueueAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTopicAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTopicAckMarshaller.java
index 52e2ec4872..6421e21e50 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTopicAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTopicAckMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalTopicAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for JournalTopicAckMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for JournalTopicAckMarshaller NOTE!:
+ * This file is auto generated - do not modify! if you need to make a change,
+ * please see the modify the groovy scripts in the under src/gram/script and
+ * then use maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return JournalTopicAck.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,16 +63,15 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
JournalTopicAck info = (JournalTopicAck)o;
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
- info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setMessageId((org.apache.activemq.command.MessageId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setSubscritionName(tightUnmarshalString(dataIn, bs));
info.setClientId(tightUnmarshalString(dataIn, bs));
- info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -85,7 +82,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getMessageSequenceId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getMessageSequenceId(), bs);
rc += tightMarshalString1(info.getSubscritionName(), bs);
rc += tightMarshalString1(info.getClientId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs);
@@ -95,7 +92,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -115,7 +112,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -124,16 +121,15 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
super.looseUnmarshal(wireFormat, o, dataIn);
JournalTopicAck info = (JournalTopicAck)o;
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
- info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setMessageId((org.apache.activemq.command.MessageId)looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageSequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setSubscritionName(looseUnmarshalString(dataIn));
info.setClientId(looseUnmarshalString(dataIn));
- info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)looseUnmarsalNestedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTraceMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTraceMarshaller.java
index 00f809a53d..3e11de7e48 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTraceMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTraceMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalTrace;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTransactionMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTransactionMarshaller.java
index 28224fd3cc..6cc204f65f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTransactionMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/JournalTransactionMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalTransaction;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/KeepAliveInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/KeepAliveInfoMarshaller.java
index 872d59ce6f..26927094b4 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/KeepAliveInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/KeepAliveInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.KeepAliveInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/LastPartialCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/LastPartialCommandMarshaller.java
index 27831427a3..da1905eb84 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/LastPartialCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/LastPartialCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.LastPartialCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/LocalTransactionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/LocalTransactionIdMarshaller.java
index 7e607e48d2..906416f87f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/LocalTransactionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/LocalTransactionIdMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.LocalTransactionId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for LocalTransactionIdMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for LocalTransactionIdMarshaller NOTE!:
+ * This file is auto generated - do not modify! if you need to make a change,
+ * please see the modify the groovy scripts in the under src/gram/script and
+ * then use maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return LocalTransactionId.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -66,11 +64,10 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
LocalTransactionId info = (LocalTransactionId)o;
info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
- info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -79,7 +76,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
LocalTransactionId info = (LocalTransactionId)o;
int rc = super.tightMarshal1(wireFormat, o, bs);
- rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
return rc + 0;
@@ -87,7 +84,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -103,7 +100,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -113,11 +110,10 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
LocalTransactionId info = (LocalTransactionId)o;
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
- info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)looseUnmarsalCachedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageAckMarshaller.java
index db761193e7..a143a8809c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageAckMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchMarshaller.java
index 51a09bb416..6fdbb8799a 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageDispatch;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationMarshaller.java
index 625e0d9ef8..678f6ea9b7 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationMarshaller.java
@@ -21,32 +21,31 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageDispatchNotification;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for MessageDispatchNotificationMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for
+ * MessageDispatchNotificationMarshaller NOTE!: This file is auto generated - do
+ * not modify! if you need to make a change, please see the modify the groovy
+ * scripts in the under src/gram/script and then use maven openwire:generate to
+ * regenerate this file.
+ *
* @version $Revision$
*/
public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessageDispatchNotification.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +55,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,14 +64,13 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessageDispatchNotification info = (MessageDispatchNotification)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDeliverySequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
- info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setMessageId((org.apache.activemq.command.MessageId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -83,7 +81,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
return rc + 0;
@@ -91,7 +89,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -109,7 +107,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -118,14 +116,13 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
super.looseUnmarshal(wireFormat, o, dataIn);
MessageDispatchNotification info = (MessageDispatchNotification)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDeliverySequenceId(looseUnmarshalLong(wireFormat, dataIn));
- info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setMessageId((org.apache.activemq.command.MessageId)looseUnmarsalNestedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageIdMarshaller.java
index 8e40c71c63..4a3b925dfc 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for MessageIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageMarshaller.java
index 7cc5942a58..783756e96e 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageMarshaller.java
@@ -21,27 +21,24 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.Message;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for MessageMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for MessageMarshaller NOTE!: This file
+ * is auto generated - do not modify! if you need to make a change, please see
+ * the modify the groovy scripts in the under src/gram/script and then use maven
+ * openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public abstract class MessageMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -52,38 +49,37 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
Message info = (Message)o;
info.beforeUnmarshall(wireFormat);
-
- info.setProducerId((org.apache.activemq.command.ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setOriginalDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
- info.setOriginalTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+
+ info.setProducerId((org.apache.activemq.command.ProducerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setOriginalDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setMessageId((org.apache.activemq.command.MessageId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setOriginalTransactionId((org.apache.activemq.command.TransactionId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setGroupID(tightUnmarshalString(dataIn, bs));
info.setGroupSequence(dataIn.readInt());
info.setCorrelationId(tightUnmarshalString(dataIn, bs));
info.setPersistent(bs.readBoolean());
info.setExpiration(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setPriority(dataIn.readByte());
- info.setReplyTo((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setReplyTo((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setTimestamp(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setType(tightUnmarshalString(dataIn, bs));
info.setContent(tightUnmarshalByteSequence(dataIn, bs));
info.setMarshalledProperties(tightUnmarshalByteSequence(dataIn, bs));
- info.setDataStructure((org.apache.activemq.command.DataStructure) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
- info.setTargetConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDataStructure((org.apache.activemq.command.DataStructure)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setTargetConsumerId((org.apache.activemq.command.ConsumerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setCompressed(bs.readBoolean());
info.setRedeliveryCounter(dataIn.readInt());
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)tightUnmarsalNestedObject(wireFormat, dataIn, bs);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setArrival(tightUnmarshalLong(wireFormat, dataIn, bs));
@@ -94,7 +90,6 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -114,9 +109,9 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
rc += tightMarshalString1(info.getGroupID(), bs);
rc += tightMarshalString1(info.getCorrelationId(), bs);
bs.writeBoolean(info.isPersistent());
- rc+=tightMarshalLong1(wireFormat, info.getExpiration(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getExpiration(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getReplyTo(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getTimestamp(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getTimestamp(), bs);
rc += tightMarshalString1(info.getType(), bs);
rc += tightMarshalByteSequence1(info.getContent(), bs);
rc += tightMarshalByteSequence1(info.getMarshalledProperties(), bs);
@@ -124,7 +119,7 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTargetConsumerId(), bs);
bs.writeBoolean(info.isCompressed());
rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getArrival(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getArrival(), bs);
rc += tightMarshalString1(info.getUserID(), bs);
bs.writeBoolean(info.isRecievedByDFBridge());
@@ -133,7 +128,7 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -174,7 +169,7 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -185,38 +180,37 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
Message info = (Message)o;
info.beforeUnmarshall(wireFormat);
-
- info.setProducerId((org.apache.activemq.command.ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setOriginalDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
- info.setOriginalTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
+
+ info.setProducerId((org.apache.activemq.command.ProducerId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setOriginalDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setMessageId((org.apache.activemq.command.MessageId)looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setOriginalTransactionId((org.apache.activemq.command.TransactionId)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setGroupID(looseUnmarshalString(dataIn));
info.setGroupSequence(dataIn.readInt());
info.setCorrelationId(looseUnmarshalString(dataIn));
info.setPersistent(dataIn.readBoolean());
info.setExpiration(looseUnmarshalLong(wireFormat, dataIn));
info.setPriority(dataIn.readByte());
- info.setReplyTo((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setReplyTo((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalNestedObject(wireFormat, dataIn));
info.setTimestamp(looseUnmarshalLong(wireFormat, dataIn));
info.setType(looseUnmarshalString(dataIn));
info.setContent(looseUnmarshalByteSequence(dataIn));
info.setMarshalledProperties(looseUnmarshalByteSequence(dataIn));
- info.setDataStructure((org.apache.activemq.command.DataStructure) looseUnmarsalNestedObject(wireFormat, dataIn));
- info.setTargetConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDataStructure((org.apache.activemq.command.DataStructure)looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setTargetConsumerId((org.apache.activemq.command.ConsumerId)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setCompressed(dataIn.readBoolean());
info.setRedeliveryCounter(dataIn.readInt());
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setArrival(looseUnmarshalLong(wireFormat, dataIn));
@@ -227,7 +221,6 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/NetworkBridgeFilterMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/NetworkBridgeFilterMarshaller.java
index 68d34e6860..5547516656 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/NetworkBridgeFilterMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/NetworkBridgeFilterMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.NetworkBridgeFilter;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/PartialCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/PartialCommandMarshaller.java
index 2671ad9d2b..2b0e5e0244 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/PartialCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/PartialCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.PartialCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java
index 8cc106ef13..76144ef847 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ProducerId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ProducerIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerInfoMarshaller.java
index 42f0bd91c1..92a504e496 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerInfoMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ProducerInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for ProducerInfoMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for ProducerInfoMarshaller NOTE!: This
+ * file is auto generated - do not modify! if you need to make a change, please
+ * see the modify the groovy scripts in the under src/gram/script and then use
+ * maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ProducerInfo.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,24 +63,22 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
ProducerInfo info = (ProducerInfo)o;
- info.setProducerId((org.apache.activemq.command.ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setProducerId((org.apache.activemq.command.ProducerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)tightUnmarsalNestedObject(wireFormat, dataIn, bs);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -100,7 +96,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -117,7 +113,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -126,24 +122,22 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
super.looseUnmarshal(wireFormat, o, dataIn);
ProducerInfo info = (ProducerInfo)o;
- info.setProducerId((org.apache.activemq.command.ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setProducerId((org.apache.activemq.command.ProducerId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveInfoMarshaller.java
index d4066f9657..43d53a8608 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.RemoveInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoMarshaller.java
index 80f1a5b3c1..8e0f8596b0 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.RemoveSubscriptionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ReplayCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ReplayCommandMarshaller.java
index 27dd24304e..ec2a0c98fc 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ReplayCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ReplayCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ReplayCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ResponseMarshaller.java
index ef091d7a38..5910b9f918 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.Response;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionIdMarshaller.java
index 8627decb84..e85a83cb5f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.SessionId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for SessionIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionInfoMarshaller.java
index 2a931e9a79..8ec88e3ec3 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.SessionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ShutdownInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ShutdownInfoMarshaller.java
index 95a51c0fc2..fa4cecdd0c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ShutdownInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ShutdownInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ShutdownInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SubscriptionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SubscriptionInfoMarshaller.java
index 2bd8fa2557..8b8198bf15 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SubscriptionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SubscriptionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.SubscriptionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionIdMarshaller.java
index a293e6724e..c160eef062 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionIdMarshaller.java
@@ -21,8 +21,8 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionInfoMarshaller.java
index 4ffdfc1cf2..c74095aa28 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.TransactionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/WireFormatInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/WireFormatInfoMarshaller.java
index 99f39e3bf8..1643c35d26 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/WireFormatInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/WireFormatInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.WireFormatInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/XATransactionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/XATransactionIdMarshaller.java
index 82eaa82d4d..171794ab49 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v1/XATransactionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v1/XATransactionIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.XATransactionId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQBytesMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQBytesMessageMarshaller.java
index 353d32f77f..8edb31aa47 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQBytesMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQBytesMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQBytesMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQDestinationMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQDestinationMarshaller.java
index cfb31b07db..25a7ba3b3a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQDestinationMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQDestinationMarshaller.java
@@ -21,8 +21,9 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQMapMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQMapMessageMarshaller.java
index 80342db332..0dab4302da 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQMapMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQMapMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQMapMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQMessageMarshaller.java
index 1cfaa299c1..8743bf7f8f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQObjectMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQObjectMessageMarshaller.java
index 9b7085e00d..27c7f2c7e7 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQObjectMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQObjectMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQObjectMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQQueueMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQQueueMarshaller.java
index c32cad4c93..59e664f5b4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQQueueMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQQueueMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQStreamMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQStreamMessageMarshaller.java
index bfde5fd672..1e3498d798 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQStreamMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQStreamMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQStreamMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempDestinationMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempDestinationMarshaller.java
index 136982d688..c5e79313b5 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempDestinationMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempDestinationMarshaller.java
@@ -21,8 +21,8 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempQueueMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempQueueMarshaller.java
index cf3d92ee0b..39ec19f39b 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempQueueMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempQueueMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTempQueue;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempTopicMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempTopicMarshaller.java
index e9120fa23c..aef2bbcea0 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempTopicMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTempTopicMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTempTopic;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTextMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTextMessageMarshaller.java
index d668b3b20b..b417e5cf8a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTextMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTextMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTextMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTopicMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTopicMarshaller.java
index 3848518ee9..7039656ad0 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTopicMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ActiveMQTopicMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BaseCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BaseCommandMarshaller.java
index bee4bf4d0d..25c7632b92 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BaseCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BaseCommandMarshaller.java
@@ -21,8 +21,9 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BaseCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BaseDataStreamMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BaseDataStreamMarshaller.java
index 573e06c16a..cc1a2c2396 100755
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BaseDataStreamMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BaseDataStreamMarshaller.java
@@ -63,11 +63,11 @@ abstract public class BaseDataStreamMarshaller implements DataStreamMarshaller {
bs.writeBoolean(false);
bs.writeBoolean(false);
return 0;
- } else if ((o & 0xFFFFFFFFFFFF0000l) == 0) {
+ } else if ((o & 0xFFFFFFFFFFFF0000L) == 0) {
bs.writeBoolean(false);
bs.writeBoolean(true);
return 2;
- } else if ((o & 0xFFFFFFFF00000000l) == 0) {
+ } else if ((o & 0xFFFFFFFF00000000L) == 0) {
bs.writeBoolean(true);
bs.writeBoolean(false);
return 4;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerIdMarshaller.java
index 08bafc3788..56be41bebc 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java
index b4468256ac..31de234653 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerInfo;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for BrokerInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionControlMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionControlMarshaller.java
index e1e1f0a1fb..000e299d59 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionControlMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionControlMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionControl;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionErrorMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionErrorMarshaller.java
index 7644f8bd55..4ff1d03ac4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionErrorMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionErrorMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionError;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionIdMarshaller.java
index 0a0f6a5b64..1f18dd0ec5 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionId;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionInfoMarshaller.java
index 03d30945a0..6826ff20bd 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionInfo;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ConnectionInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerControlMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerControlMarshaller.java
index 89edb4b417..880b4792fc 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerControlMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerControlMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerControl;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerIdMarshaller.java
index 0f19ba2579..a2d758e3d2 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerId;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ConsumerIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ControlCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ControlCommandMarshaller.java
index 9828cdc4c3..2bfa4cf466 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ControlCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ControlCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ControlCommand;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DataArrayResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DataArrayResponseMarshaller.java
index 6a753c0c5a..9b06911ee6 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DataArrayResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DataArrayResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataArrayResponse;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for DataArrayResponseMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DataResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DataResponseMarshaller.java
index 22fb5f58e3..00eb9e0e48 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DataResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DataResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataResponse;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DestinationInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DestinationInfoMarshaller.java
index bdd73721f3..e062f2b5b4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DestinationInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DestinationInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.DestinationInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for DestinationInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DiscoveryEventMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DiscoveryEventMarshaller.java
index 634b0a1a4d..68b5539f02 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DiscoveryEventMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/DiscoveryEventMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.DiscoveryEvent;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ExceptionResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ExceptionResponseMarshaller.java
index 64e84fec20..15b0cbd1fc 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ExceptionResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ExceptionResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ExceptionResponse;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/FlushCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/FlushCommandMarshaller.java
index 2cc12cc302..e61902bb79 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/FlushCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/FlushCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.FlushCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/IntegerResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/IntegerResponseMarshaller.java
index fad86b6408..873ac259d2 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/IntegerResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/IntegerResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.IntegerResponse;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalQueueAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalQueueAckMarshaller.java
index bc369f3787..33d404dec2 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalQueueAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalQueueAckMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalQueueAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTopicAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTopicAckMarshaller.java
index 9471d0813b..dd2710f0cd 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTopicAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTopicAckMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalTopicAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for JournalTopicAckMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for JournalTopicAckMarshaller NOTE!:
+ * This file is auto generated - do not modify! if you need to make a change,
+ * please see the modify the groovy scripts in the under src/gram/script and
+ * then use maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return JournalTopicAck.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,16 +63,15 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
JournalTopicAck info = (JournalTopicAck)o;
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
- info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setMessageId((org.apache.activemq.command.MessageId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setSubscritionName(tightUnmarshalString(dataIn, bs));
info.setClientId(tightUnmarshalString(dataIn, bs));
- info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -85,7 +82,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getMessageSequenceId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getMessageSequenceId(), bs);
rc += tightMarshalString1(info.getSubscritionName(), bs);
rc += tightMarshalString1(info.getClientId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs);
@@ -95,7 +92,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -115,7 +112,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -124,16 +121,15 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
super.looseUnmarshal(wireFormat, o, dataIn);
JournalTopicAck info = (JournalTopicAck)o;
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
- info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setMessageId((org.apache.activemq.command.MessageId)looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageSequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setSubscritionName(looseUnmarshalString(dataIn));
info.setClientId(looseUnmarshalString(dataIn));
- info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)looseUnmarsalNestedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTraceMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTraceMarshaller.java
index 04b47235e9..3dc1f6dfe0 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTraceMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTraceMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalTrace;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTransactionMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTransactionMarshaller.java
index 888303e997..e231dad301 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTransactionMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/JournalTransactionMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalTransaction;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/KeepAliveInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/KeepAliveInfoMarshaller.java
index 6d650dfc9c..cc02539b35 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/KeepAliveInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/KeepAliveInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.KeepAliveInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/LastPartialCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/LastPartialCommandMarshaller.java
index ca4de05700..399e5f06d6 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/LastPartialCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/LastPartialCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.LastPartialCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/LocalTransactionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/LocalTransactionIdMarshaller.java
index 18c9cb510d..92b93a6f71 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/LocalTransactionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/LocalTransactionIdMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.LocalTransactionId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for LocalTransactionIdMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for LocalTransactionIdMarshaller NOTE!:
+ * This file is auto generated - do not modify! if you need to make a change,
+ * please see the modify the groovy scripts in the under src/gram/script and
+ * then use maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return LocalTransactionId.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -66,11 +64,10 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
LocalTransactionId info = (LocalTransactionId)o;
info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
- info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -79,7 +76,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
LocalTransactionId info = (LocalTransactionId)o;
int rc = super.tightMarshal1(wireFormat, o, bs);
- rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
return rc + 0;
@@ -87,7 +84,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -103,7 +100,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -113,11 +110,10 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
LocalTransactionId info = (LocalTransactionId)o;
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
- info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)looseUnmarsalCachedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageAckMarshaller.java
index 5363ead8e8..91c8a84a69 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageAckMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageDispatchMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageDispatchMarshaller.java
index 35746079fc..c5e058bf35 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageDispatchMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageDispatchMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageDispatch;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageDispatchNotificationMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageDispatchNotificationMarshaller.java
index 0c794000cc..d9ca8ecccb 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageDispatchNotificationMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageDispatchNotificationMarshaller.java
@@ -21,32 +21,31 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageDispatchNotification;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for MessageDispatchNotificationMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for
+ * MessageDispatchNotificationMarshaller NOTE!: This file is auto generated - do
+ * not modify! if you need to make a change, please see the modify the groovy
+ * scripts in the under src/gram/script and then use maven openwire:generate to
+ * regenerate this file.
+ *
* @version $Revision$
*/
public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessageDispatchNotification.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +55,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,14 +64,13 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessageDispatchNotification info = (MessageDispatchNotification)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDeliverySequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
- info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setMessageId((org.apache.activemq.command.MessageId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -83,7 +81,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
return rc + 0;
@@ -91,7 +89,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -109,7 +107,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -118,14 +116,13 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
super.looseUnmarshal(wireFormat, o, dataIn);
MessageDispatchNotification info = (MessageDispatchNotification)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDeliverySequenceId(looseUnmarshalLong(wireFormat, dataIn));
- info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setMessageId((org.apache.activemq.command.MessageId)looseUnmarsalNestedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageIdMarshaller.java
index f2e8c265fd..17cb89817c 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for MessageIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageMarshaller.java
index a70949ac22..19b5a25ac6 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.Message;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessagePullMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessagePullMarshaller.java
index a1c7a212ec..83f91b0c06 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessagePullMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/MessagePullMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessagePull;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for MessagePullMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for MessagePullMarshaller NOTE!: This
+ * file is auto generated - do not modify! if you need to make a change, please
+ * see the modify the groovy scripts in the under src/gram/script and then use
+ * maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class MessagePullMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessagePull.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class MessagePullMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,13 +63,12 @@ public class MessagePullMarshaller extends BaseCommandMarshaller {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessagePull info = (MessagePull)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -82,14 +79,14 @@ public class MessagePullMarshaller extends BaseCommandMarshaller {
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getTimeout(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getTimeout(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -106,7 +103,7 @@ public class MessagePullMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -115,13 +112,12 @@ public class MessagePullMarshaller extends BaseCommandMarshaller {
super.looseUnmarshal(wireFormat, o, dataIn);
MessagePull info = (MessagePull)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setTimeout(looseUnmarshalLong(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/NetworkBridgeFilterMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/NetworkBridgeFilterMarshaller.java
index 28e45779c0..e1bf1cced5 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/NetworkBridgeFilterMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/NetworkBridgeFilterMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.NetworkBridgeFilter;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/PartialCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/PartialCommandMarshaller.java
index 4be372dc47..1c4d57bdfe 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/PartialCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/PartialCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.PartialCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerIdMarshaller.java
index 1f3f441e4f..8cf3880199 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ProducerId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ProducerIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerInfoMarshaller.java
index 99f6a1099f..ccbfe1af93 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerInfoMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ProducerInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for ProducerInfoMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for ProducerInfoMarshaller NOTE!: This
+ * file is auto generated - do not modify! if you need to make a change, please
+ * see the modify the groovy scripts in the under src/gram/script and then use
+ * maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ProducerInfo.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,25 +63,23 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
ProducerInfo info = (ProducerInfo)o;
- info.setProducerId((org.apache.activemq.command.ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setProducerId((org.apache.activemq.command.ProducerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)tightUnmarsalNestedObject(wireFormat, dataIn, bs);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setDispatchAsync(bs.readBoolean());
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -102,7 +98,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -120,7 +116,7 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -129,25 +125,23 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
super.looseUnmarshal(wireFormat, o, dataIn);
ProducerInfo info = (ProducerInfo)o;
- info.setProducerId((org.apache.activemq.command.ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setProducerId((org.apache.activemq.command.ProducerId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setDispatchAsync(dataIn.readBoolean());
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/RemoveInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/RemoveInfoMarshaller.java
index 7a54e847ff..32623d8c05 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/RemoveInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/RemoveInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.RemoveInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/RemoveSubscriptionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/RemoveSubscriptionInfoMarshaller.java
index 32be7f97f4..4146d58c36 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/RemoveSubscriptionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/RemoveSubscriptionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.RemoveSubscriptionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ReplayCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ReplayCommandMarshaller.java
index dbe317b51e..579eba9ee6 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ReplayCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ReplayCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ReplayCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ResponseMarshaller.java
index 0500c1e5c6..6d2644259f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.Response;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SessionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SessionIdMarshaller.java
index 007d2700f9..c1ff9292d4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SessionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SessionIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.SessionId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for SessionIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SessionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SessionInfoMarshaller.java
index 554b2baefe..ac99e3da42 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SessionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SessionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.SessionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ShutdownInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ShutdownInfoMarshaller.java
index 349f90f32d..ff34cc930e 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ShutdownInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ShutdownInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ShutdownInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SubscriptionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SubscriptionInfoMarshaller.java
index edb07e4527..98562ef16b 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SubscriptionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/SubscriptionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.SubscriptionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/TransactionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/TransactionIdMarshaller.java
index fc0555fd08..63e0430ad4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/TransactionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/TransactionIdMarshaller.java
@@ -21,8 +21,8 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/TransactionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/TransactionInfoMarshaller.java
index 755f9fe479..568a377820 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/TransactionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/TransactionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.TransactionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/WireFormatInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/WireFormatInfoMarshaller.java
index 011fa316a1..5808dc2848 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/WireFormatInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/WireFormatInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.WireFormatInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/XATransactionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/XATransactionIdMarshaller.java
index dc4b47fcd4..512adbca6a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/XATransactionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/XATransactionIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.XATransactionId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQBlobMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQBlobMessageMarshaller.java
index 81d7e4641a..41b0c40ad6 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQBlobMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQBlobMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQBlobMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQBytesMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQBytesMessageMarshaller.java
index 864a2bff69..79ee9670e5 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQBytesMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQBytesMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQBytesMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQDestinationMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQDestinationMarshaller.java
index 2c062170bf..4316c0f7c4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQDestinationMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQDestinationMarshaller.java
@@ -21,8 +21,9 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQMapMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQMapMessageMarshaller.java
index d4836c1d25..d7c2f18658 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQMapMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQMapMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQMapMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQMessageMarshaller.java
index e01e2e5fa5..8f6ed6a9ef 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQObjectMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQObjectMessageMarshaller.java
index 136a8dffe7..ee685852c4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQObjectMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQObjectMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQObjectMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQQueueMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQQueueMarshaller.java
index 898e4decd1..9ee70dfd17 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQQueueMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQQueueMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQStreamMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQStreamMessageMarshaller.java
index 3adc0d1e3c..5090e55501 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQStreamMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQStreamMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQStreamMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempDestinationMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempDestinationMarshaller.java
index 1f071b0e2b..4764b4b54c 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempDestinationMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempDestinationMarshaller.java
@@ -21,8 +21,8 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempQueueMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempQueueMarshaller.java
index 5b4750817f..93b39e3bcd 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempQueueMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempQueueMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTempQueue;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempTopicMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempTopicMarshaller.java
index c59029bfd1..d159f6aa0f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempTopicMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTempTopicMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTempTopic;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTextMessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTextMessageMarshaller.java
index af4475687e..cec94ba66b 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTextMessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTextMessageMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTextMessage;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTopicMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTopicMarshaller.java
index 21269fecc0..61694a1704 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTopicMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ActiveMQTopicMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseCommandMarshaller.java
index a05b88147e..00b14e13bc 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseCommandMarshaller.java
@@ -21,8 +21,9 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BaseCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseDataStreamMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseDataStreamMarshaller.java
index 2dced88684..342d2d38db 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseDataStreamMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseDataStreamMarshaller.java
@@ -16,17 +16,17 @@
*/
package org.apache.activemq.openwire.v3;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
import org.apache.activemq.openwire.DataStreamMarshaller;
import org.apache.activemq.openwire.OpenWireFormat;
-import org.apache.activemq.openwire.BooleanStream;
-import org.apache.activemq.command.DataStructure;
-import org.apache.activemq.util.ClassLoading;
import org.apache.activemq.util.ByteSequence;
-
-import java.lang.reflect.Constructor;
-import java.io.IOException;
-import java.io.DataOutput;
-import java.io.DataInput;
+import org.apache.activemq.util.ClassLoading;
abstract public class BaseDataStreamMarshaller implements DataStreamMarshaller {
@@ -60,11 +60,11 @@ abstract public class BaseDataStreamMarshaller implements DataStreamMarshaller {
bs.writeBoolean(false);
bs.writeBoolean(false);
return 0;
- } else if ((o & 0xFFFFFFFFFFFF0000l) == 0) {
+ } else if ((o & 0xFFFFFFFFFFFF0000L) == 0) {
bs.writeBoolean(false);
bs.writeBoolean(true);
return 2;
- } else if ((o & 0xFFFFFFFF00000000l) == 0) {
+ } else if ((o & 0xFFFFFFFF00000000L) == 0) {
bs.writeBoolean(true);
bs.writeBoolean(false);
return 4;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerIdMarshaller.java
index 3e5707e79f..224513ab3b 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java
index 31b3ac5954..a48055e15a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerInfo;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for BrokerInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionControlMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionControlMarshaller.java
index 647a52859c..31323c7819 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionControlMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionControlMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionControl;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionErrorMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionErrorMarshaller.java
index 350b5ec971..085fd55d31 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionErrorMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionErrorMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionError;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionIdMarshaller.java
index a26c6fea8f..3dcc8a7024 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionId;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionInfoMarshaller.java
index 9449fce5f0..21269e85ca 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionInfo;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ConnectionInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerControlMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerControlMarshaller.java
index caaa2a4310..1318d83afe 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerControlMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerControlMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerControl;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerIdMarshaller.java
index 847c339db6..4e3989ff12 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerId;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ConsumerIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerInfoMarshaller.java
index 469189f850..92a6f3d886 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerInfo;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ConsumerInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ControlCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ControlCommandMarshaller.java
index f5ff61baf9..77bf4af216 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ControlCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ControlCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ControlCommand;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataArrayResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataArrayResponseMarshaller.java
index 35da0f1137..2f901ff7a4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataArrayResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataArrayResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataArrayResponse;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for DataArrayResponseMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataResponseMarshaller.java
index 759f98115a..c11f6535ef 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataResponse;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DestinationInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DestinationInfoMarshaller.java
index f26e249365..b56ec75f6d 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DestinationInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DestinationInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.DestinationInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for DestinationInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DiscoveryEventMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DiscoveryEventMarshaller.java
index ece4f6deb4..63557b370f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DiscoveryEventMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DiscoveryEventMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.DiscoveryEvent;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ExceptionResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ExceptionResponseMarshaller.java
index 520fa5486b..cbd7a5d89f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ExceptionResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ExceptionResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ExceptionResponse;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/FlushCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/FlushCommandMarshaller.java
index 0826e904b2..40586a8e1a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/FlushCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/FlushCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.FlushCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/IntegerResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/IntegerResponseMarshaller.java
index 9049a378bf..ae930e2f47 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/IntegerResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/IntegerResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.IntegerResponse;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalQueueAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalQueueAckMarshaller.java
index fd61539d87..1f0068fd42 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalQueueAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalQueueAckMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalQueueAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTopicAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTopicAckMarshaller.java
index 1990d017eb..acfa747b7e 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTopicAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTopicAckMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalTopicAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for JournalTopicAckMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for JournalTopicAckMarshaller NOTE!:
+ * This file is auto generated - do not modify! if you need to make a change,
+ * please see the modify the groovy scripts in the under src/gram/script and
+ * then use maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return JournalTopicAck.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,16 +63,15 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
JournalTopicAck info = (JournalTopicAck)o;
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
- info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setMessageId((org.apache.activemq.command.MessageId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setSubscritionName(tightUnmarshalString(dataIn, bs));
info.setClientId(tightUnmarshalString(dataIn, bs));
- info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -85,7 +82,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getMessageSequenceId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getMessageSequenceId(), bs);
rc += tightMarshalString1(info.getSubscritionName(), bs);
rc += tightMarshalString1(info.getClientId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs);
@@ -95,7 +92,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -115,7 +112,7 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -124,16 +121,15 @@ public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
super.looseUnmarshal(wireFormat, o, dataIn);
JournalTopicAck info = (JournalTopicAck)o;
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
- info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setMessageId((org.apache.activemq.command.MessageId)looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageSequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setSubscritionName(looseUnmarshalString(dataIn));
info.setClientId(looseUnmarshalString(dataIn));
- info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)looseUnmarsalNestedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTraceMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTraceMarshaller.java
index 86c40cb635..a0f75a5d59 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTraceMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTraceMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalTrace;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTransactionMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTransactionMarshaller.java
index 909b60c896..c6ae15aa9f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTransactionMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/JournalTransactionMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.JournalTransaction;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/KeepAliveInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/KeepAliveInfoMarshaller.java
index 37831be2cc..980a6dda48 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/KeepAliveInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/KeepAliveInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.KeepAliveInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/LastPartialCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/LastPartialCommandMarshaller.java
index 5f951f89e3..b7b202fbd9 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/LastPartialCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/LastPartialCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.LastPartialCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/LocalTransactionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/LocalTransactionIdMarshaller.java
index 9dab319862..ab58340b9d 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/LocalTransactionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/LocalTransactionIdMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.LocalTransactionId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for LocalTransactionIdMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for LocalTransactionIdMarshaller NOTE!:
+ * This file is auto generated - do not modify! if you need to make a change,
+ * please see the modify the groovy scripts in the under src/gram/script and
+ * then use maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return LocalTransactionId.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -66,11 +64,10 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
LocalTransactionId info = (LocalTransactionId)o;
info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
- info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -79,7 +76,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
LocalTransactionId info = (LocalTransactionId)o;
int rc = super.tightMarshal1(wireFormat, o, bs);
- rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
return rc + 0;
@@ -87,7 +84,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -103,7 +100,7 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -113,11 +110,10 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
LocalTransactionId info = (LocalTransactionId)o;
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
- info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)looseUnmarsalCachedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageAckMarshaller.java
index 028380d9e2..db4c9d69b5 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageAckMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageDispatchMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageDispatchMarshaller.java
index 3180795eec..9678fae71a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageDispatchMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageDispatchMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageDispatch;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageDispatchNotificationMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageDispatchNotificationMarshaller.java
index 5f29a94b57..78dd49fe8b 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageDispatchNotificationMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageDispatchNotificationMarshaller.java
@@ -21,32 +21,31 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageDispatchNotification;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for MessageDispatchNotificationMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for
+ * MessageDispatchNotificationMarshaller NOTE!: This file is auto generated - do
+ * not modify! if you need to make a change, please see the modify the groovy
+ * scripts in the under src/gram/script and then use maven openwire:generate to
+ * regenerate this file.
+ *
* @version $Revision$
*/
public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessageDispatchNotification.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +55,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,14 +64,13 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessageDispatchNotification info = (MessageDispatchNotification)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDeliverySequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
- info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setMessageId((org.apache.activemq.command.MessageId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -83,7 +81,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
return rc + 0;
@@ -91,7 +89,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -109,7 +107,7 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -118,14 +116,13 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
super.looseUnmarshal(wireFormat, o, dataIn);
MessageDispatchNotification info = (MessageDispatchNotification)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDeliverySequenceId(looseUnmarshalLong(wireFormat, dataIn));
- info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setMessageId((org.apache.activemq.command.MessageId)looseUnmarsalNestedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageIdMarshaller.java
index 238dc6979a..99ea8c12de 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageIdMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessageId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for MessageIdMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for MessageIdMarshaller NOTE!: This
+ * file is auto generated - do not modify! if you need to make a change, please
+ * see the modify the groovy scripts in the under src/gram/script and then use
+ * maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class MessageIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessageId.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class MessageIdMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -65,13 +63,12 @@ public class MessageIdMarshaller extends BaseDataStreamMarshaller {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessageId info = (MessageId)o;
- info.setProducerId((org.apache.activemq.command.ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setProducerId((org.apache.activemq.command.ProducerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setProducerSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setBrokerSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -81,15 +78,15 @@ public class MessageIdMarshaller extends BaseDataStreamMarshaller {
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getProducerId(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getProducerSequenceId(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getBrokerSequenceId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getProducerSequenceId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getBrokerSequenceId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -106,7 +103,7 @@ public class MessageIdMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -115,13 +112,12 @@ public class MessageIdMarshaller extends BaseDataStreamMarshaller {
super.looseUnmarshal(wireFormat, o, dataIn);
MessageId info = (MessageId)o;
- info.setProducerId((org.apache.activemq.command.ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setProducerId((org.apache.activemq.command.ProducerId)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setProducerSequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setBrokerSequenceId(looseUnmarshalLong(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageMarshaller.java
index 370e7780aa..ffe41fb215 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessageMarshaller.java
@@ -21,27 +21,24 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.Message;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for MessageMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for MessageMarshaller NOTE!: This file
+ * is auto generated - do not modify! if you need to make a change, please see
+ * the modify the groovy scripts in the under src/gram/script and then use maven
+ * openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public abstract class MessageMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -52,38 +49,37 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
Message info = (Message)o;
info.beforeUnmarshall(wireFormat);
-
- info.setProducerId((org.apache.activemq.command.ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setOriginalDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
- info.setOriginalTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+
+ info.setProducerId((org.apache.activemq.command.ProducerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setOriginalDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setMessageId((org.apache.activemq.command.MessageId)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setOriginalTransactionId((org.apache.activemq.command.TransactionId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setGroupID(tightUnmarshalString(dataIn, bs));
info.setGroupSequence(dataIn.readInt());
info.setCorrelationId(tightUnmarshalString(dataIn, bs));
info.setPersistent(bs.readBoolean());
info.setExpiration(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setPriority(dataIn.readByte());
- info.setReplyTo((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setReplyTo((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setTimestamp(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setType(tightUnmarshalString(dataIn, bs));
info.setContent(tightUnmarshalByteSequence(dataIn, bs));
info.setMarshalledProperties(tightUnmarshalByteSequence(dataIn, bs));
- info.setDataStructure((org.apache.activemq.command.DataStructure) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
- info.setTargetConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setDataStructure((org.apache.activemq.command.DataStructure)tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setTargetConsumerId((org.apache.activemq.command.ConsumerId)tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setCompressed(bs.readBoolean());
info.setRedeliveryCounter(dataIn.readInt());
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)tightUnmarsalNestedObject(wireFormat, dataIn, bs);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setArrival(tightUnmarshalLong(wireFormat, dataIn, bs));
@@ -94,12 +90,11 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)tightUnmarsalNestedObject(wireFormat, dataIn, bs);
}
info.setCluster(value);
- }
- else {
+ } else {
info.setCluster(null);
}
info.setBrokerInTime(tightUnmarshalLong(wireFormat, dataIn, bs));
@@ -109,7 +104,6 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -129,9 +123,9 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
rc += tightMarshalString1(info.getGroupID(), bs);
rc += tightMarshalString1(info.getCorrelationId(), bs);
bs.writeBoolean(info.isPersistent());
- rc+=tightMarshalLong1(wireFormat, info.getExpiration(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getExpiration(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getReplyTo(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getTimestamp(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getTimestamp(), bs);
rc += tightMarshalString1(info.getType(), bs);
rc += tightMarshalByteSequence1(info.getContent(), bs);
rc += tightMarshalByteSequence1(info.getMarshalledProperties(), bs);
@@ -139,20 +133,20 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTargetConsumerId(), bs);
bs.writeBoolean(info.isCompressed());
rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getArrival(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getArrival(), bs);
rc += tightMarshalString1(info.getUserID(), bs);
bs.writeBoolean(info.isRecievedByDFBridge());
bs.writeBoolean(info.isDroppable());
rc += tightMarshalObjectArray1(wireFormat, info.getCluster(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getBrokerInTime(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getBrokerOutTime(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getBrokerInTime(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getBrokerOutTime(), bs);
return rc + 9;
}
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -197,7 +191,7 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -208,38 +202,37 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
Message info = (Message)o;
info.beforeUnmarshall(wireFormat);
-
- info.setProducerId((org.apache.activemq.command.ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setOriginalDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
- info.setOriginalTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
+
+ info.setProducerId((org.apache.activemq.command.ProducerId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setTransactionId((org.apache.activemq.command.TransactionId)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setOriginalDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setMessageId((org.apache.activemq.command.MessageId)looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setOriginalTransactionId((org.apache.activemq.command.TransactionId)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setGroupID(looseUnmarshalString(dataIn));
info.setGroupSequence(dataIn.readInt());
info.setCorrelationId(looseUnmarshalString(dataIn));
info.setPersistent(dataIn.readBoolean());
info.setExpiration(looseUnmarshalLong(wireFormat, dataIn));
info.setPriority(dataIn.readByte());
- info.setReplyTo((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setReplyTo((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalNestedObject(wireFormat, dataIn));
info.setTimestamp(looseUnmarshalLong(wireFormat, dataIn));
info.setType(looseUnmarshalString(dataIn));
info.setContent(looseUnmarshalByteSequence(dataIn));
info.setMarshalledProperties(looseUnmarshalByteSequence(dataIn));
- info.setDataStructure((org.apache.activemq.command.DataStructure) looseUnmarsalNestedObject(wireFormat, dataIn));
- info.setTargetConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setDataStructure((org.apache.activemq.command.DataStructure)looseUnmarsalNestedObject(wireFormat, dataIn));
+ info.setTargetConsumerId((org.apache.activemq.command.ConsumerId)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setCompressed(dataIn.readBoolean());
info.setRedeliveryCounter(dataIn.readInt());
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setArrival(looseUnmarshalLong(wireFormat, dataIn));
@@ -250,12 +243,11 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setCluster(value);
- }
- else {
+ } else {
info.setCluster(null);
}
info.setBrokerInTime(looseUnmarshalLong(wireFormat, dataIn));
@@ -265,7 +257,6 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessagePullMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessagePullMarshaller.java
index d96f5f24a1..7be7d45a03 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessagePullMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessagePullMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.MessagePull;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for MessagePullMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/NetworkBridgeFilterMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/NetworkBridgeFilterMarshaller.java
index 517c6f43ca..a646ecf73a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/NetworkBridgeFilterMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/NetworkBridgeFilterMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.NetworkBridgeFilter;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/PartialCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/PartialCommandMarshaller.java
index 44ddb595b5..1a8f2d30bc 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/PartialCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/PartialCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.PartialCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerAckMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerAckMarshaller.java
index 4281df378d..d81aaf0b25 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerAckMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerAckMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ProducerAck;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerIdMarshaller.java
index bfbb660996..2a10812a4f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerIdMarshaller.java
@@ -21,32 +21,30 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
-
-
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ProducerId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
- * Marshalling code for Open Wire Format for ProducerIdMarshaller
- *
- *
- * NOTE!: This file is auto generated - do not modify!
- * if you need to make a change, please see the modify the groovy scripts in the
- * under src/gram/script and then use maven openwire:generate to regenerate
- * this file.
- *
+ * Marshalling code for Open Wire Format for ProducerIdMarshaller NOTE!: This
+ * file is auto generated - do not modify! if you need to make a change, please
+ * see the modify the groovy scripts in the under src/gram/script and then use
+ * maven openwire:generate to regenerate this file.
+ *
* @version $Revision$
*/
public class ProducerIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ProducerId.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,7 +54,7 @@ public class ProducerIdMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -71,7 +69,6 @@ public class ProducerIdMarshaller extends BaseDataStreamMarshaller {
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -81,15 +78,15 @@ public class ProducerIdMarshaller extends BaseDataStreamMarshaller {
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalString1(info.getConnectionId(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getSessionId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getSessionId(), bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
- *
+ *
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
@@ -106,7 +103,7 @@ public class ProducerIdMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
- *
+ *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
@@ -121,7 +118,6 @@ public class ProducerIdMarshaller extends BaseDataStreamMarshaller {
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerInfoMarshaller.java
index bc36bca199..1304315b02 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ProducerInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for ProducerInfoMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/RemoveInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/RemoveInfoMarshaller.java
index 55d74b6c1d..57807fe903 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/RemoveInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/RemoveInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.RemoveInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/RemoveSubscriptionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/RemoveSubscriptionInfoMarshaller.java
index af615910b4..3fdf356893 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/RemoveSubscriptionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/RemoveSubscriptionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.RemoveSubscriptionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ReplayCommandMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ReplayCommandMarshaller.java
index 75a1603c34..9adce220b7 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ReplayCommandMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ReplayCommandMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ReplayCommand;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ResponseMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ResponseMarshaller.java
index 0032e59c65..e7ea8cbb3e 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ResponseMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ResponseMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.Response;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionIdMarshaller.java
index 09ee6a1e4d..ae3c042abf 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.SessionId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
/**
* Marshalling code for Open Wire Format for SessionIdMarshaller
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionInfoMarshaller.java
index 975613555d..fd9ecd192c 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.SessionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ShutdownInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ShutdownInfoMarshaller.java
index 0e28eb7c9a..cbd414bd8e 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ShutdownInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ShutdownInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.ShutdownInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SubscriptionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SubscriptionInfoMarshaller.java
index b7308da283..89e3df7b33 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SubscriptionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SubscriptionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.SubscriptionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/TransactionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/TransactionIdMarshaller.java
index b073a68455..d8ab76cac7 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/TransactionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/TransactionIdMarshaller.java
@@ -21,8 +21,8 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/TransactionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/TransactionInfoMarshaller.java
index 03becfe5b8..7acabe5930 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/TransactionInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/TransactionInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.TransactionInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/WireFormatInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/WireFormatInfoMarshaller.java
index 9d77b8c922..d4fc1494dc 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/WireFormatInfoMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/WireFormatInfoMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.WireFormatInfo;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/XATransactionIdMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/XATransactionIdMarshaller.java
index 16342ebf0e..1b5b65bcd9 100644
--- a/activemq-core/src/main/java/org/apache/activemq/openwire/v3/XATransactionIdMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v3/XATransactionIdMarshaller.java
@@ -21,8 +21,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.command.XATransactionId;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.OpenWireFormat;
diff --git a/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionPool.java b/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionPool.java
index ab410c36fc..499bda7fd2 100644
--- a/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionPool.java
+++ b/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionPool.java
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
import javax.jms.JMSException;
import javax.jms.Session;
@@ -33,8 +34,6 @@ import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.transport.TransportListener;
import org.apache.commons.pool.ObjectPoolFactory;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* Holds a real JMS connection along with the session pools associated with it.
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnection.java b/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnection.java
index 3136f17211..5b3707714e 100755
--- a/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnection.java
+++ b/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnection.java
@@ -16,10 +16,6 @@
*/
package org.apache.activemq.pool;
-import org.apache.activemq.ActiveMQConnection;
-import org.apache.activemq.ActiveMQSession;
-import org.apache.activemq.AlreadyClosedException;
-
import javax.jms.Connection;
import javax.jms.ConnectionConsumer;
import javax.jms.ConnectionMetaData;
@@ -35,6 +31,10 @@ import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicSession;
+import org.apache.activemq.ActiveMQConnection;
+import org.apache.activemq.ActiveMQSession;
+import org.apache.activemq.AlreadyClosedException;
+
/**
* Represents a proxy {@link Connection} which is-a {@link TopicConnection} and
* {@link QueueConnection} which is pooled and on {@link #close()} will return
diff --git a/activemq-core/src/main/java/org/apache/activemq/pool/PooledProducer.java b/activemq-core/src/main/java/org/apache/activemq/pool/PooledProducer.java
index 02c9113d17..802b170085 100644
--- a/activemq-core/src/main/java/org/apache/activemq/pool/PooledProducer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/pool/PooledProducer.java
@@ -16,16 +16,16 @@
*/
package org.apache.activemq.pool;
-import org.apache.activemq.ActiveMQMessageProducer;
-
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageProducer;
+import org.apache.activemq.ActiveMQMessageProducer;
+
/**
* A pooled {@link MessageProducer}
- *
+ *
* @version $Revision: 1.1 $
*/
public class PooledProducer implements MessageProducer {
@@ -120,13 +120,13 @@ public class PooledProducer implements MessageProducer {
}
// Implementation methods
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
protected ActiveMQMessageProducer getMessageProducer() {
return messageProducer;
}
-
+
public String toString() {
- return "PooledProducer { "+messageProducer+" }";
+ return "PooledProducer { " + messageProducer + " }";
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/pool/PooledQueueSender.java b/activemq-core/src/main/java/org/apache/activemq/pool/PooledQueueSender.java
index ba62229ed9..fb1bab3c6b 100644
--- a/activemq-core/src/main/java/org/apache/activemq/pool/PooledQueueSender.java
+++ b/activemq-core/src/main/java/org/apache/activemq/pool/PooledQueueSender.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.pool;
-import org.apache.activemq.ActiveMQQueueSender;
-
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueSender;
+import org.apache.activemq.ActiveMQQueueSender;
+
/**
* @version $Revision: 1.1 $
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/pool/PooledSession.java b/activemq-core/src/main/java/org/apache/activemq/pool/PooledSession.java
index d444f591e4..3dac2a2740 100644
--- a/activemq-core/src/main/java/org/apache/activemq/pool/PooledSession.java
+++ b/activemq-core/src/main/java/org/apache/activemq/pool/PooledSession.java
@@ -18,6 +18,7 @@ package org.apache.activemq.pool;
import java.io.Serializable;
import java.util.Iterator;
+import java.util.concurrent.CopyOnWriteArrayList;
import javax.jms.BytesMessage;
import javax.jms.Destination;
@@ -50,8 +51,6 @@ import org.apache.activemq.AlreadyClosedException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CopyOnWriteArrayList;
-
/**
* @version $Revision: 1.1 $
*/
@@ -65,11 +64,10 @@ public class PooledSession implements TopicSession, QueueSession {
private ActiveMQTopicPublisher topicPublisher;
private boolean transactional = true;
private boolean ignoreClose = false;
-
+
private final CopyOnWriteArrayList consumers = new CopyOnWriteArrayList();
private final CopyOnWriteArrayList browsers = new CopyOnWriteArrayList();
-
public PooledSession(ActiveMQSession aSession, SessionPool sessionPool) {
this.session = aSession;
this.sessionPool = sessionPool;
@@ -87,43 +85,42 @@ public class PooledSession implements TopicSession, QueueSession {
public void close() throws JMSException {
if (!ignoreClose) {
// TODO a cleaner way to reset??
-
+
// lets reset the session
getSession().setMessageListener(null);
-
+
// Close any consumers and browsers that may have been created.
for (Iterator iter = consumers.iterator(); iter.hasNext();) {
- MessageConsumer consumer = (MessageConsumer) iter.next();
+ MessageConsumer consumer = (MessageConsumer)iter.next();
consumer.close();
}
consumers.clear();
-
+
for (Iterator iter = browsers.iterator(); iter.hasNext();) {
- QueueBrowser browser = (QueueBrowser) iter.next();
+ QueueBrowser browser = (QueueBrowser)iter.next();
browser.close();
}
browsers.clear();
-
+
// maybe do a rollback?
if (transactional) {
try {
getSession().rollback();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
log.warn("Caught exception trying rollback() when putting session back into the pool: " + e, e);
-
- // lets close the session and not put the session back into the pool
+
+ // lets close the session and not put the session back into
+ // the pool
try {
session.close();
- }
- catch (JMSException e1) {
+ } catch (JMSException e1) {
log.trace("Ignoring exception as discarding session: " + e1, e1);
}
session = null;
return;
}
}
-
+
sessionPool.returnSession(this);
}
}
@@ -206,9 +203,8 @@ public class PooledSession implements TopicSession, QueueSession {
}
}
-
// Consumer related methods
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public QueueBrowser createBrowser(Queue queue) throws JMSException {
return addQueueBrowser(getSession().createBrowser(queue));
}
@@ -233,7 +229,6 @@ public class PooledSession implements TopicSession, QueueSession {
return addTopicSubscriber(getSession().createDurableSubscriber(topic, selector));
}
-
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String selector, boolean noLocal) throws JMSException {
return addTopicSubscriber(getSession().createDurableSubscriber(topic, name, selector, noLocal));
}
@@ -262,9 +257,8 @@ public class PooledSession implements TopicSession, QueueSession {
return addQueueReceiver(getSession().createReceiver(queue, selector));
}
-
// Producer related methods
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public MessageProducer createProducer(Destination destination) throws JMSException {
return new PooledProducer(getMessageProducer(), destination);
}
@@ -278,7 +272,7 @@ public class PooledSession implements TopicSession, QueueSession {
}
// Implementation methods
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
protected ActiveMQSession getSession() throws AlreadyClosedException {
if (session == null) {
throw new AlreadyClosedException("The session has already been closed");
@@ -288,21 +282,21 @@ public class PooledSession implements TopicSession, QueueSession {
public ActiveMQMessageProducer getMessageProducer() throws JMSException {
if (messageProducer == null) {
- messageProducer = (ActiveMQMessageProducer) getSession().createProducer(null);
+ messageProducer = (ActiveMQMessageProducer)getSession().createProducer(null);
}
return messageProducer;
}
public ActiveMQQueueSender getQueueSender() throws JMSException {
if (queueSender == null) {
- queueSender = (ActiveMQQueueSender) getSession().createSender(null);
+ queueSender = (ActiveMQQueueSender)getSession().createSender(null);
}
return queueSender;
}
public ActiveMQTopicPublisher getTopicPublisher() throws JMSException {
if (topicPublisher == null) {
- topicPublisher = (ActiveMQTopicPublisher) getSession().createPublisher(null);
+ topicPublisher = (ActiveMQTopicPublisher)getSession().createPublisher(null);
}
return topicPublisher;
}
@@ -311,20 +305,23 @@ public class PooledSession implements TopicSession, QueueSession {
browsers.add(browser);
return browser;
}
+
private MessageConsumer addConsumer(MessageConsumer consumer) {
consumers.add(consumer);
return consumer;
- }
+ }
+
private TopicSubscriber addTopicSubscriber(TopicSubscriber subscriber) {
consumers.add(subscriber);
return subscriber;
}
+
private QueueReceiver addQueueReceiver(QueueReceiver receiver) {
consumers.add(receiver);
return receiver;
}
public String toString() {
- return "PooledSession { "+session+" }";
+ return "PooledSession { " + session + " }";
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/pool/PooledTopicPublisher.java b/activemq-core/src/main/java/org/apache/activemq/pool/PooledTopicPublisher.java
index 064618845e..60db293df6 100644
--- a/activemq-core/src/main/java/org/apache/activemq/pool/PooledTopicPublisher.java
+++ b/activemq-core/src/main/java/org/apache/activemq/pool/PooledTopicPublisher.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.pool;
-import org.apache.activemq.ActiveMQTopicPublisher;
-
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Topic;
import javax.jms.TopicPublisher;
+import org.apache.activemq.ActiveMQTopicPublisher;
+
/**
* @version $Revision: 1.1 $
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/pool/SessionPool.java b/activemq-core/src/main/java/org/apache/activemq/pool/SessionPool.java
index 6ef81a11fa..9290ddcaaf 100644
--- a/activemq-core/src/main/java/org/apache/activemq/pool/SessionPool.java
+++ b/activemq-core/src/main/java/org/apache/activemq/pool/SessionPool.java
@@ -16,15 +16,14 @@
*/
package org.apache.activemq.pool;
+import javax.jms.JMSException;
+
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.AlreadyClosedException;
import org.apache.activemq.util.JMSExceptionSupport;
import org.apache.commons.pool.ObjectPool;
import org.apache.commons.pool.PoolableObjectFactory;
-import org.apache.commons.pool.impl.GenericObjectPool;
-
-import javax.jms.JMSException;
/**
* Represents the session pool for a given JMS connection.
@@ -53,12 +52,10 @@ public class SessionPool implements PoolableObjectFactory {
public PooledSession borrowSession() throws JMSException {
try {
Object object = getSessionPool().borrowObject();
- return (PooledSession) object;
- }
- catch (JMSException e) {
+ return (PooledSession)object;
+ } catch (JMSException e) {
throw e;
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSExceptionSupport.create(e);
}
}
@@ -68,8 +65,7 @@ public class SessionPool implements PoolableObjectFactory {
getConnection();
try {
getSessionPool().returnObject(session);
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSExceptionSupport.create("Failed to return session to pool: " + e, e);
}
}
@@ -81,7 +77,7 @@ public class SessionPool implements PoolableObjectFactory {
}
public void destroyObject(Object o) throws Exception {
- PooledSession session = (PooledSession) o;
+ PooledSession session = (PooledSession)o;
session.getSession().close();
}
@@ -109,7 +105,7 @@ public class SessionPool implements PoolableObjectFactory {
}
protected ActiveMQSession createSession() throws JMSException {
- return (ActiveMQSession) getConnection().createSession(key.isTransacted(), key.getAckMode());
+ return (ActiveMQSession)getConnection().createSession(key.isTransacted(), key.getAckMode());
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnection.java b/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnection.java
index 39549e093e..4791772acc 100644
--- a/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnection.java
+++ b/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnection.java
@@ -17,21 +17,21 @@
package org.apache.activemq.proxy;
import java.io.IOException;
+import java.util.concurrent.atomic.AtomicBoolean;
+
import org.apache.activemq.Service;
import org.apache.activemq.command.ShutdownInfo;
import org.apache.activemq.transport.DefaultTransportListener;
import org.apache.activemq.transport.Transport;
-import org.apache.activemq.transport.TransportListener;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.ServiceStopper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.atomic.AtomicBoolean;
class ProxyConnection implements Service {
static final private Log log = LogFactory.getLog(ProxyConnection.class);
-
+
private final Transport localTransport;
private final Transport remoteTransport;
private AtomicBoolean shuttingDown = new AtomicBoolean(false);
@@ -43,8 +43,8 @@ class ProxyConnection implements Service {
}
public void onFailure(IOException e) {
- if( !shuttingDown.get() ) {
- log.debug("Transport error: "+e,e);
+ if (!shuttingDown.get()) {
+ log.debug("Transport error: " + e, e);
try {
stop();
} catch (Exception ignore) {
@@ -53,20 +53,20 @@ class ProxyConnection implements Service {
}
public void start() throws Exception {
- if( !running.compareAndSet(false, true) ) {
- return;
+ if (!running.compareAndSet(false, true)) {
+ return;
}
-
+
this.localTransport.setTransportListener(new DefaultTransportListener() {
public void onCommand(Object command) {
- boolean shutdown=false;
- if( command.getClass() == ShutdownInfo.class ) {
+ boolean shutdown = false;
+ if (command.getClass() == ShutdownInfo.class) {
shuttingDown.set(true);
- shutdown=true;
+ shutdown = true;
}
try {
remoteTransport.oneway(command);
- if( shutdown )
+ if (shutdown)
stop();
} catch (IOException error) {
onFailure(error);
@@ -74,11 +74,12 @@ class ProxyConnection implements Service {
onFailure(IOExceptionSupport.create(error));
}
}
+
public void onException(IOException error) {
onFailure(error);
}
});
-
+
this.remoteTransport.setTransportListener(new DefaultTransportListener() {
public void onCommand(Object command) {
try {
@@ -87,17 +88,18 @@ class ProxyConnection implements Service {
onFailure(error);
}
}
+
public void onException(IOException error) {
onFailure(error);
}
});
-
+
localTransport.start();
remoteTransport.start();
}
-
+
public void stop() throws Exception {
- if( !running.compareAndSet(true, false) ) {
+ if (!running.compareAndSet(true, false)) {
return;
}
shuttingDown.set(true);
@@ -106,5 +108,5 @@ class ProxyConnection implements Service {
ss.stop(remoteTransport);
ss.throwFirstException();
}
-
+
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnector.java b/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnector.java
index 25b422f3f6..34ba393bed 100644
--- a/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnector.java
+++ b/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnector.java
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Iterator;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.activemq.Service;
import org.apache.activemq.transport.CompositeTransport;
@@ -32,8 +33,6 @@ import org.apache.activemq.util.ServiceStopper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CopyOnWriteArrayList;
-
/**
* @org.apache.xbean.XBean
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationBroker.java b/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationBroker.java
index 01d78e878d..2b0fb2f4b9 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationBroker.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationBroker.java
@@ -146,7 +146,7 @@ public class AuthorizationBroker extends BrokerFilter implements SecurityAdminMB
} else {
allowedACLs = authorizationMap.getTempDestinationWriteACLs();
}
- if (allowedACLs != null && !subject.isInOneOf(allowedACLs)){
+ if (allowedACLs != null && !subject.isInOneOf(allowedACLs)) {
throw new SecurityException("User " + subject.getUserName() + " is not authorized to write to: " + info.getDestination());
}
subject.getAuthorizedWriteDests().put(info.getDestination(), info.getDestination());
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationMap.java b/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationMap.java
index 033656f678..4ed51657bf 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationMap.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationMap.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.security;
-import org.apache.activemq.command.ActiveMQDestination;
-
import java.util.Set;
+import org.apache.activemq.command.ActiveMQDestination;
+
/**
*
* @version $Revision$
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java b/activemq-core/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java
index ed2c3e66c0..07ba2c9aea 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/DefaultAuthorizationMap.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.security;
-import org.apache.activemq.command.ActiveMQDestination;
-import org.apache.activemq.filter.DestinationMap;
-
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.filter.DestinationMap;
+
/**
* Represents a destination based configuration of policies so that individual
* destinations or wildcard hierarchies of destinations can be configured using
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/JaasAuthenticationBroker.java b/activemq-core/src/main/java/org/apache/activemq/security/JaasAuthenticationBroker.java
index 3f309c80e8..18cdc2d9ce 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/JaasAuthenticationBroker.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/JaasAuthenticationBroker.java
@@ -18,6 +18,7 @@ package org.apache.activemq.security;
import java.util.Iterator;
import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
import javax.security.auth.Subject;
import javax.security.auth.login.LoginContext;
@@ -26,11 +27,8 @@ import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerFilter;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.ConnectionInfo;
-
import org.apache.activemq.jaas.JassCredentialCallbackHandler;
-import java.util.concurrent.CopyOnWriteArrayList;
-
/**
* Logs a user in using JAAS.
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/JaasAuthenticationPlugin.java b/activemq-core/src/main/java/org/apache/activemq/security/JaasAuthenticationPlugin.java
index 92fd1d07f0..f873294327 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/JaasAuthenticationPlugin.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/JaasAuthenticationPlugin.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.security;
+import java.net.URL;
+
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerPlugin;
-import java.net.URL;
-
/**
* Adds a JAAS based authentication security plugin
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/JaasCertificateAuthenticationBroker.java b/activemq-core/src/main/java/org/apache/activemq/security/JaasCertificateAuthenticationBroker.java
index 0efab01a9c..12c266ad14 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/JaasCertificateAuthenticationBroker.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/JaasCertificateAuthenticationBroker.java
@@ -17,14 +17,6 @@
package org.apache.activemq.security;
-import org.apache.activemq.broker.Broker;
-import org.apache.activemq.broker.BrokerFilter;
-import org.apache.activemq.broker.ConnectionContext;
-import org.apache.activemq.command.ConnectionInfo;
-import org.apache.activemq.jaas.JaasCertificateCallbackHandler;
-import org.apache.activemq.jaas.UserPrincipal;
-import org.apache.activemq.security.JaasAuthenticationBroker.JaasSecurityContext;
-
import java.security.Principal;
import java.security.cert.X509Certificate;
import java.util.Iterator;
@@ -33,6 +25,13 @@ import javax.security.auth.Subject;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.login.LoginContext;
+import org.apache.activemq.broker.Broker;
+import org.apache.activemq.broker.BrokerFilter;
+import org.apache.activemq.broker.ConnectionContext;
+import org.apache.activemq.command.ConnectionInfo;
+import org.apache.activemq.jaas.JaasCertificateCallbackHandler;
+import org.apache.activemq.jaas.UserPrincipal;
+
/**
* A JAAS Authentication Broker that uses SSL Certificates.
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/LDAPAuthorizationMap.java b/activemq-core/src/main/java/org/apache/activemq/security/LDAPAuthorizationMap.java
index 2a71d9841e..6d035de702 100755
--- a/activemq-core/src/main/java/org/apache/activemq/security/LDAPAuthorizationMap.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/LDAPAuthorizationMap.java
@@ -43,7 +43,6 @@ import org.apache.commons.logging.LogFactory;
* An {@link AuthorizationMap} which uses LDAP
*
* @org.apache.xbean.XBean
- *
* @author ngcutura
*/
public class LDAPAuthorizationMap implements AuthorizationMap {
@@ -112,24 +111,24 @@ public class LDAPAuthorizationMap implements AuthorizationMap {
}
public LDAPAuthorizationMap(Map options) {
- initialContextFactory = (String) options.get(INITIAL_CONTEXT_FACTORY);
- connectionURL = (String) options.get(CONNECTION_URL);
- connectionUsername = (String) options.get(CONNECTION_USERNAME);
- connectionPassword = (String) options.get(CONNECTION_PASSWORD);
- connectionProtocol = (String) options.get(CONNECTION_PROTOCOL);
- authentication = (String) options.get(AUTHENTICATION);
+ initialContextFactory = (String)options.get(INITIAL_CONTEXT_FACTORY);
+ connectionURL = (String)options.get(CONNECTION_URL);
+ connectionUsername = (String)options.get(CONNECTION_USERNAME);
+ connectionPassword = (String)options.get(CONNECTION_PASSWORD);
+ connectionProtocol = (String)options.get(CONNECTION_PROTOCOL);
+ authentication = (String)options.get(AUTHENTICATION);
- adminBase = (String) options.get(ADMIN_BASE);
- adminAttribute = (String) options.get(ADMIN_ATTRIBUTE);
- readBase = (String) options.get(READ_BASE);
- readAttribute = (String) options.get(READ_ATTRIBUTE);
- writeBase = (String) options.get(WRITE_BASE);
- writeAttribute = (String) options.get(WRITE_ATTRIBUTE);
+ adminBase = (String)options.get(ADMIN_BASE);
+ adminAttribute = (String)options.get(ADMIN_ATTRIBUTE);
+ readBase = (String)options.get(READ_BASE);
+ readAttribute = (String)options.get(READ_ATTRIBUTE);
+ writeBase = (String)options.get(WRITE_BASE);
+ writeAttribute = (String)options.get(WRITE_ATTRIBUTE);
- String topicSearchMatching = (String) options.get(TOPIC_SEARCH_MATCHING);
- String topicSearchSubtree = (String) options.get(TOPIC_SEARCH_SUBTREE);
- String queueSearchMatching = (String) options.get(QUEUE_SEARCH_MATCHING);
- String queueSearchSubtree = (String) options.get(QUEUE_SEARCH_SUBTREE);
+ String topicSearchMatching = (String)options.get(TOPIC_SEARCH_MATCHING);
+ String topicSearchSubtree = (String)options.get(TOPIC_SEARCH_SUBTREE);
+ String queueSearchMatching = (String)options.get(QUEUE_SEARCH_MATCHING);
+ String queueSearchSubtree = (String)options.get(QUEUE_SEARCH_SUBTREE);
topicSearchMatchingFormat = new MessageFormat(topicSearchMatching);
queueSearchMatchingFormat = new MessageFormat(queueSearchMatching);
topicSearchSubtreeBool = Boolean.valueOf(topicSearchSubtree).booleanValue();
@@ -137,21 +136,21 @@ public class LDAPAuthorizationMap implements AuthorizationMap {
}
public Set getTempDestinationAdminACLs() {
- //TODO insert implementation
-
- return null;
- }
-
- public Set getTempDestinationReadACLs() {
- // TODO insert implementation
+ // TODO insert implementation
+
return null;
}
-
- public Set getTempDestinationWriteACLs() {
- // TODO insert implementation
+
+ public Set getTempDestinationReadACLs() {
+ // TODO insert implementation
return null;
- }
-
+ }
+
+ public Set getTempDestinationWriteACLs() {
+ // TODO insert implementation
+ return null;
+ }
+
public Set getAdminACLs(ActiveMQDestination destination) {
return getACLs(destination, adminBase, adminAttribute);
}
@@ -308,8 +307,7 @@ public class LDAPAuthorizationMap implements AuthorizationMap {
protected Set getACLs(ActiveMQDestination destination, String roleBase, String roleAttribute) {
try {
context = open();
- }
- catch (NamingException e) {
+ } catch (NamingException e) {
log.error(e);
return new HashSet();
}
@@ -323,32 +321,30 @@ public class LDAPAuthorizationMap implements AuthorizationMap {
SearchControls constraints = new SearchControls();
if ((destination.getDestinationType() & ActiveMQDestination.QUEUE_TYPE) == ActiveMQDestination.QUEUE_TYPE) {
- destinationBase = queueSearchMatchingFormat.format(new String[] { destination.getPhysicalName() });
+ destinationBase = queueSearchMatchingFormat.format(new String[] {destination.getPhysicalName()});
if (queueSearchSubtreeBool) {
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
- }
- else {
+ } else {
constraints.setSearchScope(SearchControls.ONELEVEL_SCOPE);
}
}
if ((destination.getDestinationType() & ActiveMQDestination.TOPIC_TYPE) == ActiveMQDestination.TOPIC_TYPE) {
- destinationBase = topicSearchMatchingFormat.format(new String[] { destination.getPhysicalName() });
+ destinationBase = topicSearchMatchingFormat.format(new String[] {destination.getPhysicalName()});
if (topicSearchSubtreeBool) {
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
- }
- else {
+ } else {
constraints.setSearchScope(SearchControls.ONELEVEL_SCOPE);
}
}
- constraints.setReturningAttributes(new String[] { roleAttribute });
+ constraints.setReturningAttributes(new String[] {roleAttribute});
try {
Set roles = new HashSet();
Set acls = new HashSet();
NamingEnumeration results = context.search(destinationBase, roleBase, constraints);
while (results.hasMore()) {
- SearchResult result = (SearchResult) results.next();
+ SearchResult result = (SearchResult)results.next();
Attributes attrs = result.getAttributes();
if (attrs == null) {
continue;
@@ -356,12 +352,11 @@ public class LDAPAuthorizationMap implements AuthorizationMap {
acls = addAttributeValues(roleAttribute, attrs, acls);
}
for (Iterator iter = acls.iterator(); iter.hasNext();) {
- String roleName = (String) iter.next();
+ String roleName = (String)iter.next();
roles.add(new GroupPrincipal(roleName));
}
return roles;
- }
- catch (NamingException e) {
+ } catch (NamingException e) {
log.error(e);
return new HashSet();
}
@@ -376,11 +371,11 @@ public class LDAPAuthorizationMap implements AuthorizationMap {
}
Attribute attr = attrs.get(attrId);
if (attr == null) {
- return (values);
+ return values;
}
NamingEnumeration e = attr.getAll();
while (e.hasMore()) {
- String value = (String) e.next();
+ String value = (String)e.next();
values.add(value);
}
return values;
@@ -405,8 +400,7 @@ public class LDAPAuthorizationMap implements AuthorizationMap {
env.put(Context.SECURITY_AUTHENTICATION, authentication);
context = new InitialDirContext(env);
- }
- catch (NamingException e) {
+ } catch (NamingException e) {
log.error(e);
throw e;
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/SecurityContext.java b/activemq-core/src/main/java/org/apache/activemq/security/SecurityContext.java
index 93b7a1cbe3..2cb081dbfb 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/SecurityContext.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/SecurityContext.java
@@ -16,9 +16,9 @@
*/
package org.apache.activemq.security;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
-import java.util.Collections;
import java.util.concurrent.ConcurrentHashMap;
/**
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthenticationBroker.java b/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthenticationBroker.java
index 19dcf9978c..539c49491f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthenticationBroker.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthenticationBroker.java
@@ -19,14 +19,13 @@ package org.apache.activemq.security;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerFilter;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.ConnectionInfo;
-import java.util.concurrent.CopyOnWriteArrayList;
-
/**
* Handles authenticating a users against a simple user name/password map.
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthenticationPlugin.java b/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthenticationPlugin.java
index 31c6dd7444..5e6351ab59 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthenticationPlugin.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthenticationPlugin.java
@@ -24,12 +24,9 @@ import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
-import org.apache.activemq.jaas.GroupPrincipal;
-
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerPlugin;
-
-import java.util.Map;
+import org.apache.activemq.jaas.GroupPrincipal;
/**
* A simple authentication plugin
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthorizationMap.java b/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthorizationMap.java
index 5d1a2626c8..c58903a3c7 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthorizationMap.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/SimpleAuthorizationMap.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.security;
+import java.util.Set;
+
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.filter.DestinationMap;
-import java.util.Set;
-
/**
* An AuthorizationMap which is configured with individual DestinationMaps for
* each operation.
diff --git a/activemq-core/src/main/java/org/apache/activemq/security/TempDestinationAuthorizationEntry.java b/activemq-core/src/main/java/org/apache/activemq/security/TempDestinationAuthorizationEntry.java
index 4e59afe5e9..bd33dcf408 100644
--- a/activemq-core/src/main/java/org/apache/activemq/security/TempDestinationAuthorizationEntry.java
+++ b/activemq-core/src/main/java/org/apache/activemq/security/TempDestinationAuthorizationEntry.java
@@ -16,29 +16,20 @@
*/
package org.apache.activemq.security;
-import org.apache.activemq.filter.DestinationMapEntry;
-import org.apache.activemq.jaas.GroupPrincipal;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.StringTokenizer;
-
/**
* Represents an entry in a {@link DefaultAuthorizationMap} for assigning
- * different operations (read, write, admin) of user roles to
- * a temporary destination
+ * different operations (read, write, admin) of user roles to a temporary
+ * destination
*
* @org.apache.xbean.XBean
- *
* @version $Revision: 426366 $
*/
public class TempDestinationAuthorizationEntry extends AuthorizationEntry {
-
public void afterPropertiesSet() throws Exception {
- //we don't need to check if destination is specified since
- //the TempDestinationAuthorizationEntry should map to all temp destinations
- }
+ // we don't need to check if destination is specified since
+ // the TempDestinationAuthorizationEntry should map to all temp
+ // destinations
+ }
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/state/SessionState.java b/activemq-core/src/main/java/org/apache/activemq/state/SessionState.java
index 95deca8a05..0c7b0f4e4b 100755
--- a/activemq-core/src/main/java/org/apache/activemq/state/SessionState.java
+++ b/activemq-core/src/main/java/org/apache/activemq/state/SessionState.java
@@ -19,6 +19,8 @@ package org.apache.activemq.state;
import java.util.Collection;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.activemq.command.ConsumerId;
import org.apache.activemq.command.ConsumerInfo;
@@ -26,9 +28,6 @@ import org.apache.activemq.command.ProducerId;
import org.apache.activemq.command.ProducerInfo;
import org.apache.activemq.command.SessionInfo;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-
public class SessionState {
final SessionInfo info;
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/PersistenceAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/PersistenceAdapter.java
index be3924558d..0f87941433 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/PersistenceAdapter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/PersistenceAdapter.java
@@ -16,6 +16,10 @@
*/
package org.apache.activemq.store;
+import java.io.File;
+import java.io.IOException;
+import java.util.Set;
+
import org.apache.activemq.Service;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.ActiveMQDestination;
@@ -23,10 +27,6 @@ import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.apache.activemq.memory.UsageManager;
-import java.io.File;
-import java.io.IOException;
-import java.util.Set;
-
/**
* Adapter to the actual persistence mechanism used with ActiveMQ
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
index b8cee6d443..b8325bdc6c 100644
--- a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
@@ -23,7 +23,6 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.activeio.journal.Journal;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.BrokerServiceAware;
import org.apache.activemq.broker.ConnectionContext;
@@ -182,7 +181,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
// store, but they still
// need to be recovered when the broker starts up.
- if (referenceStoreAdapter.isStoreValid() == false) {
+ if (!referenceStoreAdapter.isStoreValid()) {
log.warn("The ReferenceStore is not valid - recovering ...");
recover();
log.info("Finished recovering the ReferenceStore");
@@ -514,6 +513,8 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
case JournalTransaction.XA_ROLLBACK:
transactionStore.replayRollback(command.getTransactionId());
break;
+ default:
+ throw new IOException("Invalid journal command type: " + command.getType());
}
} catch (IOException e) {
log.error("Recovery Failure: Could not replay: " + c + ", reason: " + e, e);
@@ -558,7 +559,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
* @throws IOException
*/
public Location writeCommand(DataStructure command, boolean syncHint) throws IOException {
- return asyncDataManager.write(wireFormat.marshal(command), (syncHint && syncOnWrite));
+ return asyncDataManager.write(wireFormat.marshal(command), syncHint && syncOnWrite);
}
private Location writeTraceMessage(String message, boolean sync) throws IOException {
@@ -568,8 +569,8 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
}
public void onMemoryUseChanged(UsageManager memoryManager, int oldPercentUsage, int newPercentUsage) {
- newPercentUsage = ((newPercentUsage) / 10) * 10;
- oldPercentUsage = ((oldPercentUsage) / 10) * 10;
+ newPercentUsage = (newPercentUsage / 10) * 10;
+ oldPercentUsage = (oldPercentUsage / 10) * 10;
if (newPercentUsage >= 70 && oldPercentUsage < newPercentUsage) {
checkpoint(false);
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTransactionStore.java b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTransactionStore.java
index 6e230ce849..a1d061c4c9 100644
--- a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTransactionStore.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTransactionStore.java
@@ -22,8 +22,6 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
-import javax.transaction.xa.XAException;
-
import org.apache.activemq.command.JournalTopicAck;
import org.apache.activemq.command.JournalTransaction;
import org.apache.activemq.command.Message;
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DataSourceSupport.java b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DataSourceSupport.java
index b02ff0d380..77acf1da15 100644
--- a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DataSourceSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DataSourceSupport.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.store.jdbc;
-import org.apache.derby.jdbc.EmbeddedDataSource;
-import org.apache.activemq.util.IOHelper;
+import java.io.File;
+import java.io.IOException;
import javax.sql.DataSource;
-import java.io.File;
-import java.io.IOException;
+import org.apache.activemq.util.IOHelper;
+import org.apache.derby.jdbc.EmbeddedDataSource;
/**
* A helper class which provides a factory method to create a default
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
index 1abb5399cc..2d1de6449c 100644
--- a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
@@ -16,18 +16,19 @@
*/
package org.apache.activemq.store.jdbc;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
+import javax.sql.DataSource;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
- * Represents an exclusive lock on a database to avoid multiple brokers
- * running against the same logical database.
- *
+ * Represents an exclusive lock on a database to avoid multiple brokers running
+ * against the same logical database.
+ *
* @version $Revision: $
*/
public class DefaultDatabaseLocker implements DatabaseLocker {
@@ -57,8 +58,7 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
statement = connection.prepareStatement(sql);
statement.execute();
break;
- }
- catch (Exception e) {
+ } catch (Exception e) {
if (stopping) {
throw new Exception("Cannot start broker as being asked to shut down. Interrupted attempt to acquire lock: " + e, e);
}
@@ -66,8 +66,7 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
if (null != statement) {
try {
statement.close();
- }
- catch (SQLException e1) {
+ } catch (SQLException e1) {
log.warn("Caught while closing statement: " + e1, e1);
}
statement = null;
@@ -75,8 +74,7 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
if (null != connection) {
try {
connection.close();
- }
- catch (SQLException e1) {
+ } catch (SQLException e1) {
log.warn("Caught while closing connection: " + e1, e1);
}
connection = null;
@@ -106,8 +104,7 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
if (rows == 1) {
return true;
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.error("Failed to update database lock: " + e, e);
}
return false;
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java
index c7facd05c9..6ac529a42c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java
@@ -16,11 +16,18 @@
*/
package org.apache.activemq.store.jdbc;
+import java.io.File;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.Collections;
+import java.util.Set;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
+import javax.sql.DataSource;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.BrokerServiceAware;
import org.apache.activemq.broker.ConnectionContext;
@@ -40,14 +47,6 @@ import org.apache.activemq.wireformat.WireFormat;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.sql.DataSource;
-
-import java.io.File;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.Collections;
-import java.util.Set;
-
/**
* A {@link PersistenceAdapter} implementation using JDBC for persistence
* storage.
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/Statements.java b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/Statements.java
index ba16997597..c056543ddc 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/Statements.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/Statements.java
@@ -71,25 +71,23 @@ public class Statements {
public String[] getCreateSchemaStatements() {
if (createSchemaStatements == null) {
createSchemaStatements = new String[] {
- "CREATE TABLE " + getFullMessageTableName() + "(" + "ID " + sequenceDataType + " NOT NULL"
- + ", CONTAINER " + containerNameDataType + ", MSGID_PROD " + msgIdDataType + ", MSGID_SEQ "
- + sequenceDataType + ", EXPIRATION " + longDataType + ", MSG "
- + (useExternalMessageReferences ? stringIdDataType : binaryDataType)
- + ", PRIMARY KEY ( ID ) )",
- "CREATE INDEX " + getFullMessageTableName() + "_MIDX ON " + getFullMessageTableName()
- + " (MSGID_PROD,MSGID_SEQ)",
- "CREATE INDEX " + getFullMessageTableName() + "_CIDX ON " + getFullMessageTableName()
- + " (CONTAINER)",
- "CREATE INDEX " + getFullMessageTableName() + "_EIDX ON " + getFullMessageTableName()
- + " (EXPIRATION)",
- "CREATE TABLE " + getFullAckTableName() + "(" + "CONTAINER " + containerNameDataType + " NOT NULL"
- + ", SUB_DEST " + stringIdDataType
- + ", CLIENT_ID " + stringIdDataType + " NOT NULL" + ", SUB_NAME " + stringIdDataType
- + " NOT NULL" + ", SELECTOR " + stringIdDataType + ", LAST_ACKED_ID " + sequenceDataType
- + ", PRIMARY KEY ( CONTAINER, CLIENT_ID, SUB_NAME))",
- "CREATE TABLE " + getFullLockTableName() + "( ID " + longDataType + " NOT NULL, TIME " + longDataType
- + ", BROKER_NAME " + stringIdDataType + ", PRIMARY KEY (ID) )",
- "INSERT INTO " + getFullLockTableName() + "(ID) VALUES (1)",
+ "CREATE TABLE " + getFullMessageTableName() + "(" + "ID " + sequenceDataType + " NOT NULL"
+ + ", CONTAINER " + containerNameDataType + ", MSGID_PROD " + msgIdDataType + ", MSGID_SEQ "
+ + sequenceDataType + ", EXPIRATION " + longDataType + ", MSG "
+ + (useExternalMessageReferences ? stringIdDataType : binaryDataType)
+ + ", PRIMARY KEY ( ID ) )",
+ "CREATE INDEX " + getFullMessageTableName() + "_MIDX ON " + getFullMessageTableName() + " (MSGID_PROD,MSGID_SEQ)",
+ "CREATE INDEX " + getFullMessageTableName() + "_CIDX ON " + getFullMessageTableName() + " (CONTAINER)",
+ "CREATE INDEX " + getFullMessageTableName() + "_EIDX ON " + getFullMessageTableName() + " (EXPIRATION)",
+ "CREATE TABLE " + getFullAckTableName() + "(" + "CONTAINER " + containerNameDataType + " NOT NULL"
+ + ", SUB_DEST " + stringIdDataType
+ + ", CLIENT_ID " + stringIdDataType + " NOT NULL" + ", SUB_NAME " + stringIdDataType
+ + " NOT NULL" + ", SELECTOR " + stringIdDataType + ", LAST_ACKED_ID " + sequenceDataType
+ + ", PRIMARY KEY ( CONTAINER, CLIENT_ID, SUB_NAME))",
+ "CREATE TABLE " + getFullLockTableName()
+ + "( ID " + longDataType + " NOT NULL, TIME " + longDataType
+ + ", BROKER_NAME " + stringIdDataType + ", PRIMARY KEY (ID) )",
+ "INSERT INTO " + getFullLockTableName() + "(ID) VALUES (1)",
};
}
return createSchemaStatements;
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/AxionJDBCAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/AxionJDBCAdapter.java
index 5e5113bca7..2bd09a23b3 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/AxionJDBCAdapter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/AxionJDBCAdapter.java
@@ -32,30 +32,29 @@ public class AxionJDBCAdapter extends StreamJDBCAdapter {
public void setStatements(Statements statements) {
- statements.setCreateSchemaStatements(
- new String[]{
- "CREATE TABLE "+statements.getFullMessageTableName()+"("
- +"ID "+statements.getSequenceDataType()+" NOT NULL"
- +", CONTAINER "+statements.getContainerNameDataType()
- +", MSGID_PROD "+statements.getMsgIdDataType()
- +", MSGID_SEQ "+statements.getSequenceDataType()
- +", EXPIRATION "+statements.getLongDataType()
- +", MSG "+(statements.isUseExternalMessageReferences() ? statements.getStringIdDataType() : statements.getBinaryDataType())
- +", PRIMARY KEY ( ID ) )",
- "CREATE INDEX "+statements.getFullMessageTableName()+"_MIDX ON "+statements.getFullMessageTableName()+" (MSGID_PROD,MSGID_SEQ)",
- "CREATE INDEX "+statements.getFullMessageTableName()+"_CIDX ON "+statements.getFullMessageTableName()+" (CONTAINER)",
- "CREATE INDEX "+statements.getFullMessageTableName()+"_EIDX ON "+statements.getFullMessageTableName()+" (EXPIRATION)",
- "CREATE TABLE "+statements.getFullAckTableName()+"("
- +"CONTAINER "+statements.getContainerNameDataType()+" NOT NULL"
- +", SUB_DEST " + statements.getContainerNameDataType()
- +", CLIENT_ID "+statements.getStringIdDataType()+" NOT NULL"
- +", SUB_NAME "+statements.getStringIdDataType()+" NOT NULL"
- +", SELECTOR "+statements.getStringIdDataType()
- +", LAST_ACKED_ID "+statements.getSequenceDataType()
- +", PRIMARY KEY ( CONTAINER, CLIENT_ID, SUB_NAME))",
- }
- );
- statements.setDeleteOldMessagesStatement("DELETE FROM "+statements.getFullMessageTableName()+ " WHERE ( EXPIRATION<>0 AND EXPIRATION)");
+ String[] createStatements = new String[]{
+ "CREATE TABLE " + statements.getFullMessageTableName() + "("
+ + "ID " + statements.getSequenceDataType() + " NOT NULL"
+ + ", CONTAINER " + statements.getContainerNameDataType()
+ + ", MSGID_PROD " + statements.getMsgIdDataType()
+ + ", MSGID_SEQ " + statements.getSequenceDataType()
+ + ", EXPIRATION " + statements.getLongDataType()
+ + ", MSG " + (statements.isUseExternalMessageReferences() ? statements.getStringIdDataType() : statements.getBinaryDataType())
+ + ", PRIMARY KEY ( ID ) )",
+ "CREATE INDEX " + statements.getFullMessageTableName() + "_MIDX ON " + statements.getFullMessageTableName() + " (MSGID_PROD,MSGID_SEQ)",
+ "CREATE INDEX " + statements.getFullMessageTableName() + "_CIDX ON " + statements.getFullMessageTableName() + " (CONTAINER)",
+ "CREATE INDEX " + statements.getFullMessageTableName() + "_EIDX ON " + statements.getFullMessageTableName() + " (EXPIRATION)",
+ "CREATE TABLE " + statements.getFullAckTableName() + "("
+ + "CONTAINER " + statements.getContainerNameDataType() + " NOT NULL"
+ + ", SUB_DEST " + statements.getContainerNameDataType()
+ + ", CLIENT_ID " + statements.getStringIdDataType() + " NOT NULL"
+ + ", SUB_NAME " + statements.getStringIdDataType() + " NOT NULL"
+ + ", SELECTOR " + statements.getStringIdDataType()
+ + ", LAST_ACKED_ID " + statements.getSequenceDataType()
+ + ", PRIMARY KEY ( CONTAINER, CLIENT_ID, SUB_NAME))"
+ };
+ statements.setCreateSchemaStatements(createStatements);
+ statements.setDeleteOldMessagesStatement("DELETE FROM " + statements.getFullMessageTableName() + " WHERE ( EXPIRATION<>0 AND EXPIRATION)");
statements.setLongDataType("LONG");
super.setStatements(statements);
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/DB2JDBCAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/DB2JDBCAdapter.java
index f511ade21f..26f0b7c5a4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/DB2JDBCAdapter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/DB2JDBCAdapter.java
@@ -16,12 +16,12 @@
*/
package org.apache.activemq.store.jdbc.adapter;
-import org.apache.activemq.store.jdbc.Statements;
-
import java.sql.Blob;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.apache.activemq.store.jdbc.Statements;
+
/**
* @version $Revision: 1.2 $
* @org.apache.xbean.XBean element="db2JDBCAdapter"
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
index a8cc8e08ea..de81fea6d4 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
@@ -543,6 +543,8 @@ public class JournalPersistenceAdapter implements PersistenceAdapter, JournalEve
case JournalTransaction.XA_ROLLBACK:
transactionStore.replayRollback(command.getTransactionId());
break;
+ default:
+ throw new IOException("Invalid journal command type: " + command.getType());
}
} catch (IOException e) {
log.error("Recovery Failure: Could not replay: " + c + ", reason: " + e, e);
@@ -600,8 +602,8 @@ public class JournalPersistenceAdapter implements PersistenceAdapter, JournalEve
}
public void onMemoryUseChanged(UsageManager memoryManager, int oldPercentUsage, int newPercentUsage) {
- newPercentUsage = ((newPercentUsage) / 10) * 10;
- oldPercentUsage = ((oldPercentUsage) / 10) * 10;
+ newPercentUsage = (newPercentUsage / 10) * 10;
+ oldPercentUsage = (oldPercentUsage / 10) * 10;
if (newPercentUsage >= 70 && oldPercentUsage < newPercentUsage) {
boolean sync = newPercentUsage >= 90;
checkpoint(sync, true);
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java b/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java
index f01ae6eba9..ad45fd3f6b 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java
@@ -18,12 +18,12 @@ package org.apache.activemq.store.journal;
import java.io.File;
import java.io.IOException;
+
import org.apache.activeio.journal.Journal;
import org.apache.activeio.journal.active.JournalImpl;
import org.apache.activeio.journal.active.JournalLockedException;
import org.apache.activemq.store.PersistenceAdapter;
import org.apache.activemq.store.PersistenceAdapterFactory;
-import org.apache.activemq.store.amq.AMQPersistenceAdapter;
import org.apache.activemq.store.jdbc.DataSourceSupport;
import org.apache.activemq.store.jdbc.JDBCAdapter;
import org.apache.activemq.store.jdbc.JDBCPersistenceAdapter;
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalTransactionStore.java b/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalTransactionStore.java
index b457b33e40..2d7a305036 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalTransactionStore.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalTransactionStore.java
@@ -21,7 +21,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
-import java.util.List;
import java.util.Map;
import javax.transaction.xa.XAException;
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/AtomicIntegerMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/AtomicIntegerMarshaller.java
index cfda24fa55..e9edcfca4a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/AtomicIntegerMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/AtomicIntegerMarshaller.java
@@ -19,9 +19,10 @@ package org.apache.activemq.store.kahadaptor;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.activemq.kaha.Marshaller;
import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.activemq.kaha.Marshaller;
+
/**
* Marshall an AtomicInteger
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaReferenceStoreAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaReferenceStoreAdapter.java
index 177ae192c9..0cd58da673 100644
--- a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaReferenceStoreAdapter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaReferenceStoreAdapter.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.store.kahadaptor;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
-import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
+
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
@@ -32,7 +32,6 @@ import org.apache.activemq.command.MessageId;
import org.apache.activemq.command.SubscriptionInfo;
import org.apache.activemq.command.TransactionId;
import org.apache.activemq.kaha.CommandMarshaller;
-import org.apache.activemq.kaha.ContainerId;
import org.apache.activemq.kaha.ListContainer;
import org.apache.activemq.kaha.MapContainer;
import org.apache.activemq.kaha.MessageIdMarshaller;
@@ -46,7 +45,6 @@ import org.apache.activemq.store.TopicReferenceStore;
import org.apache.activemq.store.amq.AMQTx;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.codehaus.groovy.antlr.treewalker.PreOrderTraversal;
public class KahaReferenceStoreAdapter extends KahaPersistenceAdapter implements ReferenceStoreAdapter {
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTransaction.java b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTransaction.java
index f09abc68ea..62c7f42899 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTransaction.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTransaction.java
@@ -19,10 +19,10 @@ package org.apache.activemq.store.kahadaptor;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+
import org.apache.activemq.command.BaseCommand;
import org.apache.activemq.command.Message;
import org.apache.activemq.command.MessageAck;
-import org.apache.activemq.command.TransactionId;
import org.apache.activemq.store.MessageStore;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTransactionStore.java b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTransactionStore.java
index b2e4fc69e7..c2387d56ed 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTransactionStore.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaTransactionStore.java
@@ -20,7 +20,10 @@ import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+
import javax.transaction.xa.XAException;
+
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.Message;
import org.apache.activemq.command.MessageAck;
@@ -32,7 +35,6 @@ import org.apache.activemq.store.ProxyTopicMessageStore;
import org.apache.activemq.store.TopicMessageStore;
import org.apache.activemq.store.TransactionRecoveryListener;
import org.apache.activemq.store.TransactionStore;
-import java.util.concurrent.ConcurrentHashMap;
/**
* Provides a TransactionStore implementation that can create transaction aware
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubContainer.java b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubContainer.java
index 377272baa7..f764738258 100644
--- a/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubContainer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/TopicSubContainer.java
@@ -13,12 +13,12 @@
*/
package org.apache.activemq.store.kahadaptor;
+import java.util.Iterator;
+
import org.apache.activemq.command.MessageId;
import org.apache.activemq.kaha.ListContainer;
import org.apache.activemq.kaha.StoreEntry;
-import java.util.Iterator;
-
/**
* Holds information for the subscriber
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryPersistenceAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryPersistenceAdapter.java
index 26112a3d4e..9996bb8bdc 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryPersistenceAdapter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryPersistenceAdapter.java
@@ -21,6 +21,7 @@ import java.io.IOException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.ActiveMQQueue;
@@ -33,8 +34,6 @@ import org.apache.activemq.store.TransactionStore;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* @org.apache.xbean.XBean
* @version $Revision: 1.4 $
diff --git a/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTransactionStore.java b/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTransactionStore.java
index ba4d8bc939..46a1bd7cf1 100755
--- a/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTransactionStore.java
+++ b/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTransactionStore.java
@@ -19,6 +19,7 @@ package org.apache.activemq.store.memory;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
import javax.transaction.xa.XAException;
@@ -34,8 +35,6 @@ import org.apache.activemq.store.TopicMessageStore;
import org.apache.activemq.store.TransactionRecoveryListener;
import org.apache.activemq.store.TransactionStore;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* Provides a TransactionStore implementation that can create transaction aware
* MessageStore objects from non transaction aware MessageStore objects.
diff --git a/activemq-core/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java b/activemq-core/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java
index 0ca7c88833..ae159c92d2 100644
--- a/activemq-core/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java
+++ b/activemq-core/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java
@@ -87,7 +87,7 @@ class PooledTaskRunner implements TaskRunner {
// shutDown() being called, which would wait forever
// waiting for iterating to finish
if (runningThread != Thread.currentThread()) {
- if (iterating == true) {
+ if (iterating) {
runable.wait(timeout);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java b/activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
index f90aefed65..70c8f9b288 100755
--- a/activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
@@ -16,7 +16,6 @@
*/
package org.apache.activemq.thread;
-import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
diff --git a/activemq-core/src/main/java/org/apache/activemq/transaction/LocalTransaction.java b/activemq-core/src/main/java/org/apache/activemq/transaction/LocalTransaction.java
index f8419de8f8..610bbea09e 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transaction/LocalTransaction.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transaction/LocalTransaction.java
@@ -31,9 +31,9 @@ import org.apache.commons.logging.LogFactory;
* @version $Revision: 1.3 $
*/
public class LocalTransaction extends Transaction {
-
+
private static final Log log = LogFactory.getLog(LocalTransaction.class);
-
+
private final TransactionStore transactionStore;
private final LocalTransactionId xid;
private final ConnectionContext context;
@@ -48,11 +48,9 @@ public class LocalTransaction extends Transaction {
// Get ready for commit.
try {
prePrepare();
- }
- catch (XAException e) {
+ } catch (XAException e) {
throw e;
- }
- catch (Throwable e) {
+ } catch (Throwable e) {
log.warn("COMMIT FAILED: ", e);
rollback();
// Let them know we rolled back.
@@ -65,12 +63,11 @@ public class LocalTransaction extends Transaction {
setState(Transaction.FINISHED_STATE);
context.getTransactions().remove(xid);
transactionStore.commit(getTransactionId(), false);
-
+
try {
fireAfterCommit();
- }
- catch (Throwable e) {
- // I guess this could happen. Post commit task failed
+ } catch (Throwable e) {
+ // I guess this could happen. Post commit task failed
// to execute properly.
log.warn("POST COMMIT FAILED: ", e);
XAException xae = new XAException("POST COMMIT FAILED");
@@ -88,8 +85,7 @@ public class LocalTransaction extends Transaction {
try {
fireAfterRollback();
- }
- catch (Throwable e) {
+ } catch (Throwable e) {
log.warn("POST ROLLBACK FAILED: ", e);
XAException xae = new XAException("POST ROLLBACK FAILED");
xae.errorCode = XAException.XAER_RMERR;
diff --git a/activemq-core/src/main/java/org/apache/activemq/transaction/XATransaction.java b/activemq-core/src/main/java/org/apache/activemq/transaction/XATransaction.java
index 9ae0f0f889..d629fd2100 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transaction/XATransaction.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transaction/XATransaction.java
@@ -140,6 +140,8 @@ public class XATransaction extends Transaction {
transactionStore.rollback(getTransactionId());
doPostRollback();
break;
+ default:
+ throw new XAException("Invalid state");
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/CommandJoiner.java b/activemq-core/src/main/java/org/apache/activemq/transport/CommandJoiner.java
index 26393ea45c..00faaeb2c0 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/CommandJoiner.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/CommandJoiner.java
@@ -46,15 +46,14 @@ public class CommandJoiner extends TransportFilter {
}
public void onCommand(Object o) {
- Command command = (Command) o;
+ Command command = (Command)o;
byte type = command.getDataStructureType();
if (type == PartialCommand.DATA_STRUCTURE_TYPE || type == LastPartialCommand.DATA_STRUCTURE_TYPE) {
- PartialCommand header = (PartialCommand) command;
+ PartialCommand header = (PartialCommand)command;
byte[] partialData = header.getData();
try {
out.write(partialData);
- }
- catch (IOException e) {
+ } catch (IOException e) {
getTransportListener().onException(e);
}
if (type == LastPartialCommand.DATA_STRUCTURE_TYPE) {
@@ -62,20 +61,18 @@ public class CommandJoiner extends TransportFilter {
byte[] fullData = out.toByteArray();
out.reset();
DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(fullData));
- Command completeCommand = (Command) wireFormat.unmarshal(dataIn);
+ Command completeCommand = (Command)wireFormat.unmarshal(dataIn);
- LastPartialCommand lastCommand = (LastPartialCommand) command;
+ LastPartialCommand lastCommand = (LastPartialCommand)command;
lastCommand.configure(completeCommand);
getTransportListener().onCommand(completeCommand);
- }
- catch (IOException e) {
+ } catch (IOException e) {
log.warn("Failed to unmarshal partial command: " + command);
getTransportListener().onException(e);
}
}
- }
- else {
+ } else {
getTransportListener().onCommand(command);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/DefaultTransportListener.java b/activemq-core/src/main/java/org/apache/activemq/transport/DefaultTransportListener.java
index 82d35bb165..377e0ecfe6 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/DefaultTransportListener.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/DefaultTransportListener.java
@@ -18,40 +18,39 @@ package org.apache.activemq.transport;
import java.io.IOException;
-
/**
* An asynchronous listener of commands
- *
+ *
* @version $Revision$
*/
public class DefaultTransportListener implements TransportListener {
-
+
/**
* called to process a command
+ *
* @param command
*/
- public void onCommand(Object command){
+ public void onCommand(Object command) {
}
+
/**
* An unrecoverable exception has occured on the transport
+ *
* @param error
*/
- public void onException(IOException error){
+ public void onException(IOException error) {
}
-
+
/**
* The transport has suffered an interuption from which it hopes to recover
- *
*/
- public void transportInterupted(){
+ public void transportInterupted() {
}
-
-
+
/**
* The transport has resumed after an interuption
- *
*/
- public void transportResumed(){
+ public void transportResumed() {
}
-
+
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/FutureResponse.java b/activemq-core/src/main/java/org/apache/activemq/transport/FutureResponse.java
index 413f842513..ffc23247be 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/FutureResponse.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/FutureResponse.java
@@ -18,14 +18,13 @@ package org.apache.activemq.transport;
import java.io.IOException;
import java.io.InterruptedIOException;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.TimeUnit;
import org.apache.activemq.command.Response;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
public class FutureResponse {
private static final Log log = LogFactory.getLog(FutureResponse.class);
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java b/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
index 48bb7184af..7d3e5518ee 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.transport;
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicBoolean;
+
import org.apache.activemq.command.KeepAliveInfo;
import org.apache.activemq.command.WireFormatInfo;
import org.apache.activemq.thread.Scheduler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.io.IOException;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* Used to make sure that commands are arriving periodically from the peer of
* the transport.
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/MutexTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/MutexTransport.java
index f3b1c2166f..2477e0080d 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/MutexTransport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/MutexTransport.java
@@ -17,7 +17,6 @@
package org.apache.activemq.transport;
import java.io.IOException;
-import org.apache.activemq.command.ShutdownInfo;
/**
* @version $Revision$
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java b/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java
index 6a15ad4c7a..c131e84c26 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java
@@ -19,13 +19,13 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+
import org.apache.activemq.command.Command;
import org.apache.activemq.command.ExceptionResponse;
import org.apache.activemq.command.Response;
import org.apache.activemq.util.IntSequenceGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
/**
* Adds the incrementing sequence number to commands along with performing the
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java
index 8f4510b229..f284ea6582 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportFactory.java
@@ -23,6 +23,8 @@ import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executor;
import org.apache.activemq.util.FactoryFinder;
import org.apache.activemq.util.IOExceptionSupport;
@@ -31,9 +33,6 @@ import org.apache.activemq.util.URISupport;
import org.apache.activemq.wireformat.WireFormat;
import org.apache.activemq.wireformat.WireFormatFactory;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.Executor;
-
public abstract class TransportFactory {
public abstract TransportServer doBind(String brokerId, URI location) throws IOException;
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportServer.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportServer.java
index 242c6f27b6..cd6634f5f3 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportServer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportServer.java
@@ -22,25 +22,25 @@ import java.net.URI;
import org.apache.activemq.Service;
import org.apache.activemq.command.BrokerInfo;
-
/**
- * A TransportServer asynchronously accepts {@see Transport} objects
- * and then delivers those objects to a {@see TransportAcceptListener}.
+ * A TransportServer asynchronously accepts {@see Transport} objects and then
+ * delivers those objects to a {@see TransportAcceptListener}.
*
* @version $Revision: 1.4 $
*/
public interface TransportServer extends Service {
-
- /**
- * Registers an {@see TransportAcceptListener} which is notified of accepted channels.
- *
- * @param acceptListener
- */
- public void setAcceptListener(TransportAcceptListener acceptListener);
-
+
/**
- * Associates a broker info with the transport server so that the transport can do
- * discovery advertisements of the broker.
+ * Registers an {@see TransportAcceptListener} which is notified of accepted
+ * channels.
+ *
+ * @param acceptListener
+ */
+ public void setAcceptListener(TransportAcceptListener acceptListener);
+
+ /**
+ * Associates a broker info with the transport server so that the transport
+ * can do discovery advertisements of the broker.
*
* @param brokerInfo
*/
@@ -48,11 +48,11 @@ public interface TransportServer extends Service {
public URI getConnectURI();
-
/**
- * @return The socket address that this transport is accepting connections on or null if
- * this does not or is not currently accepting connections on a socket.
+ * @return The socket address that this transport is accepting connections
+ * on or null if this does not or is not currently accepting
+ * connections on a socket.
*/
public InetSocketAddress getSocketAddress();
-
+
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportServerThreadSupport.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportServerThreadSupport.java
index 8d3868cb72..523b47b88a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportServerThreadSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportServerThreadSupport.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.transport;
+import java.net.URI;
+
import org.apache.activemq.ThreadPriorities;
import org.apache.activemq.util.ServiceStopper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.net.URI;
-
/**
* A useful base class for implementations of {@link TransportServer} which uses
* a background thread to accept new connections.
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java
index a21ddd324c..d52441c758 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java
@@ -18,7 +18,6 @@ package org.apache.activemq.transport;
import java.io.IOException;
-import org.apache.activemq.command.MessageDispatch;
import org.apache.activemq.util.ServiceSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java b/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java
index a10afb2ea0..3ddf8ad39c 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java
@@ -18,6 +18,9 @@ package org.apache.activemq.transport;
import java.io.IOException;
import java.io.InterruptedIOException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.activemq.command.Command;
import org.apache.activemq.command.WireFormatInfo;
@@ -26,10 +29,6 @@ import org.apache.activemq.util.IOExceptionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* Negotiates the wire format with a new connection
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/DiscoveryAgentFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/DiscoveryAgentFactory.java
index 5f6db1cf0a..06c5b548f1 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/DiscoveryAgentFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/DiscoveryAgentFactory.java
@@ -18,12 +18,11 @@ package org.apache.activemq.transport.discovery;
import java.io.IOException;
import java.net.URI;
+import java.util.concurrent.ConcurrentHashMap;
import org.apache.activemq.util.FactoryFinder;
import org.apache.activemq.util.IOExceptionSupport;
-import java.util.concurrent.ConcurrentHashMap;
-
public abstract class DiscoveryAgentFactory {
static final private FactoryFinder discoveryAgentFinder = new FactoryFinder("META-INF/services/org/apache/activemq/transport/discoveryagent/");
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/DiscoveryTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/DiscoveryTransport.java
index c32aeee3de..b3d198fc0d 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/DiscoveryTransport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/DiscoveryTransport.java
@@ -16,9 +16,9 @@
*/
package org.apache.activemq.transport.discovery;
-import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.concurrent.ConcurrentHashMap;
import org.apache.activemq.command.DiscoveryEvent;
import org.apache.activemq.transport.CompositeTransport;
@@ -27,8 +27,6 @@ import org.apache.activemq.util.ServiceStopper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* A {@link ReliableTransportChannel} which uses a {@link DiscoveryAgent} to
* discover remote broker instances and dynamically connect to them.
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java
index 25e97b2860..cd05273c5b 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java
@@ -26,13 +26,6 @@ import java.net.SocketTimeoutException;
import java.net.URI;
import java.util.Iterator;
import java.util.Map;
-
-import org.apache.activemq.command.DiscoveryEvent;
-import org.apache.activemq.transport.discovery.DiscoveryAgent;
-import org.apache.activemq.transport.discovery.DiscoveryListener;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
@@ -40,7 +33,12 @@ import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.activemq.command.DiscoveryEvent;
+import org.apache.activemq.transport.discovery.DiscoveryAgent;
+import org.apache.activemq.transport.discovery.DiscoveryListener;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* A {@link DiscoveryAgent} using a multicast address and heartbeat packets
@@ -426,7 +424,7 @@ public class MulticastDiscoveryAgent implements DiscoveryAgent, Runnable {
if (data == null) {
data = new RemoteBrokerData(brokerName, service);
brokersByService.put(service, data);
- ;
+
fireServiceAddEvent(data);
doAdvertizeSelf();
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgentFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgentFactory.java
index 91873beee4..fc97f95d5f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgentFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgentFactory.java
@@ -16,16 +16,16 @@
*/
package org.apache.activemq.transport.discovery.multicast;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Map;
+
import org.apache.activemq.transport.discovery.DiscoveryAgent;
import org.apache.activemq.transport.discovery.DiscoveryAgentFactory;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.util.URISupport;
-import java.io.IOException;
-import java.net.URI;
-import java.util.Map;
-
public class MulticastDiscoveryAgentFactory extends DiscoveryAgentFactory {
protected DiscoveryAgent doCreateDiscoveryAgent(URI uri) throws IOException {
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/rendezvous/JmDNSFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/rendezvous/JmDNSFactory.java
index 0d70e09a3d..92277ad444 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/rendezvous/JmDNSFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/rendezvous/JmDNSFactory.java
@@ -20,9 +20,10 @@ import java.io.IOException;
import java.net.InetAddress;
import java.util.HashMap;
import java.util.Map;
-import javax.jmdns.JmDNS;
import java.util.concurrent.atomic.AtomicInteger;
+import javax.jmdns.JmDNS;
+
public class JmDNSFactory {
static Map registry = new HashMap();
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/rendezvous/RendezvousDiscoveryAgent.java b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/rendezvous/RendezvousDiscoveryAgent.java
index 52129cfe84..388c72bc84 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/rendezvous/RendezvousDiscoveryAgent.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/rendezvous/RendezvousDiscoveryAgent.java
@@ -22,6 +22,7 @@ import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
import javax.jmdns.JmDNS;
import javax.jmdns.ServiceEvent;
@@ -36,8 +37,6 @@ import org.apache.activemq.util.MapHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CopyOnWriteArrayList;
-
/**
* A {@link DiscoveryAgent} using Zeroconf
* via the jmDNS library
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/simple/SimpleDiscoveryAgent.java b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/simple/SimpleDiscoveryAgent.java
index aadf79c6df..46e4d79c4e 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/discovery/simple/SimpleDiscoveryAgent.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/discovery/simple/SimpleDiscoveryAgent.java
@@ -18,13 +18,12 @@ package org.apache.activemq.transport.discovery.simple;
import java.io.IOException;
import java.net.URI;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.activemq.command.DiscoveryEvent;
import org.apache.activemq.transport.discovery.DiscoveryAgent;
import org.apache.activemq.transport.discovery.DiscoveryListener;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* A simple DiscoveryAgent that allows static configuration of the discovered
* services.
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
index e4c573a5d8..2a306ebbc1 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
@@ -22,6 +22,8 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Random;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.activemq.command.BrokerInfo;
import org.apache.activemq.command.Command;
@@ -42,9 +44,6 @@ import org.apache.activemq.util.ServiceSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-
/**
* A Transport that is made reliable by being able to fail over to another
* transport when a transport failure is detected.
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java
index f43f5638fd..f35369dc18 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java
@@ -21,6 +21,8 @@ import java.io.InterruptedIOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.command.Command;
import org.apache.activemq.command.ConsumerInfo;
@@ -43,9 +45,6 @@ import org.apache.activemq.util.ServiceSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-
/**
* A Transport that fans out a connection to multiple brokers.
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/multicast/MulticastDatagramHeaderMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/transport/multicast/MulticastDatagramHeaderMarshaller.java
index bf24e24d8b..80c7eaf47f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/multicast/MulticastDatagramHeaderMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/multicast/MulticastDatagramHeaderMarshaller.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.transport.multicast;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+
import org.apache.activemq.command.Command;
import org.apache.activemq.command.Endpoint;
import org.apache.activemq.transport.udp.DatagramEndpoint;
import org.apache.activemq.transport.udp.DatagramHeaderMarshaller;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/multicast/MulticastTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/multicast/MulticastTransport.java
index 53be2f9db9..05b745e664 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/multicast/MulticastTransport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/multicast/MulticastTransport.java
@@ -16,15 +16,6 @@
*/
package org.apache.activemq.transport.multicast;
-import org.apache.activemq.openwire.OpenWireFormat;
-import org.apache.activemq.transport.udp.CommandChannel;
-import org.apache.activemq.transport.udp.CommandDatagramSocket;
-import org.apache.activemq.transport.udp.DatagramHeaderMarshaller;
-import org.apache.activemq.transport.udp.UdpTransport;
-import org.apache.activemq.util.ServiceStopper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.io.IOException;
import java.net.DatagramSocket;
import java.net.InetAddress;
@@ -35,6 +26,15 @@ import java.net.SocketException;
import java.net.URI;
import java.net.UnknownHostException;
+import org.apache.activemq.openwire.OpenWireFormat;
+import org.apache.activemq.transport.udp.CommandChannel;
+import org.apache.activemq.transport.udp.CommandDatagramSocket;
+import org.apache.activemq.transport.udp.DatagramHeaderMarshaller;
+import org.apache.activemq.transport.udp.UdpTransport;
+import org.apache.activemq.util.ServiceStopper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* A multicast based transport.
*
@@ -97,8 +97,7 @@ public class MulticastTransport extends UdpTransport {
if (socket != null) {
try {
socket.leaveGroup(getMulticastAddress());
- }
- catch (IOException e) {
+ } catch (IOException e) {
stopper.onException(this, e);
}
socket.close();
@@ -112,10 +111,9 @@ public class MulticastTransport extends UdpTransport {
log.debug("Joining multicast address: " + getMulticastAddress());
socket.joinGroup(getMulticastAddress());
- socket.setSoTimeout((int) keepAliveInterval);
+ socket.setSoTimeout((int)keepAliveInterval);
- return new CommandDatagramSocket(this, getWireFormat(), getDatagramSize(), getTargetAddress(),
- createDatagramHeaderMarshaller(), getSocket());
+ return new CommandDatagramSocket(this, getWireFormat(), getDatagramSize(), getTargetAddress(), createDatagramHeaderMarshaller(), getSocket());
}
protected InetAddress getMulticastAddress() {
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/nio/NIOTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/nio/NIOTransport.java
index 0fd67e23b6..61bd4de2fe 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/nio/NIOTransport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/nio/NIOTransport.java
@@ -29,12 +29,12 @@ import java.nio.channels.SocketChannel;
import javax.net.SocketFactory;
-import org.apache.activemq.wireformat.WireFormat;
import org.apache.activemq.command.Command;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.tcp.TcpTransport;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.ServiceStopper;
+import org.apache.activemq.wireformat.WireFormat;
/**
* An implementation of the {@link Transport} interface using raw tcp/ip
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/nio/NIOTransportFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/nio/NIOTransportFactory.java
index eac5d76df4..dd068b7376 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/nio/NIOTransportFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/nio/NIOTransportFactory.java
@@ -30,11 +30,11 @@ import java.nio.channels.SocketChannel;
import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
-import org.apache.activemq.wireformat.WireFormat;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.tcp.TcpTransport;
import org.apache.activemq.transport.tcp.TcpTransportFactory;
import org.apache.activemq.transport.tcp.TcpTransportServer;
+import org.apache.activemq.wireformat.WireFormat;
public class NIOTransportFactory extends TcpTransportFactory {
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java b/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
index 632e2457f6..0e00bf18d9 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java
@@ -23,49 +23,47 @@ import java.nio.channels.SocketChannel;
import org.apache.activemq.transport.nio.SelectorManager.Listener;
/**
- *
* @author chirino
*/
final public class SelectorSelection {
- private final SelectorWorker worker;
- private final SelectionKey key;
- private final Listener listener;
- private int interest;
+ private final SelectorWorker worker;
+ private final SelectionKey key;
+ private final Listener listener;
+ private int interest;
+ public SelectorSelection(SelectorWorker worker, SocketChannel socketChannel, Listener listener) throws ClosedChannelException {
+ this.worker = worker;
+ this.listener = listener;
+ this.key = socketChannel.register(worker.selector, 0, this);
+ worker.incrementUseCounter();
+ }
- public SelectorSelection(SelectorWorker worker, SocketChannel socketChannel, Listener listener) throws ClosedChannelException {
- this.worker = worker;
- this.listener = listener;
- this.key = socketChannel.register(worker.selector, 0, this);
- worker.incrementUseCounter();
- }
+ public void setInterestOps(int ops) {
+ interest = ops;
+ }
- public void setInterestOps(int ops) {
- interest = ops;
- }
+ public void enable() {
+ key.interestOps(interest);
+ worker.selector.wakeup();
+ }
- public void enable() {
- key.interestOps(interest);
- worker.selector.wakeup();
- }
+ public void disable() {
+ key.interestOps(0);
+ }
- public void disable() {
- key.interestOps(0);
- }
+ public void close() {
+ worker.decrementUseCounter();
+ key.cancel();
+ worker.selector.wakeup();
+ }
- public void close() {
- worker.decrementUseCounter();
- key.cancel();
- worker.selector.wakeup();
- }
+ public void onSelect() {
+ listener.onSelect(this);
+ }
- public void onSelect() {
- listener.onSelect(this);
- }
+ public void onError(Throwable e) {
+ listener.onError(this, e);
+ }
- public void onError(Throwable e) {
- listener.onError(this, e);
- }
-
-}
\ No newline at end of file
+}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/peer/PeerTransportFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/peer/PeerTransportFactory.java
index 46aff436b5..e0e37ded3b 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/peer/PeerTransportFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/peer/PeerTransportFactory.java
@@ -21,10 +21,11 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.activemq.broker.BrokerFactoryHandler;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
-import org.apache.activemq.broker.BrokerFactoryHandler;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportFactory;
import org.apache.activemq.transport.TransportServer;
@@ -34,8 +35,6 @@ import org.apache.activemq.util.IdGenerator;
import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.util.URISupport;
-import java.util.concurrent.ConcurrentHashMap;
-
public class PeerTransportFactory extends TransportFactory {
final public static ConcurrentHashMap brokers = new ConcurrentHashMap();
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/reliable/DefaultReplayBuffer.java b/activemq-core/src/main/java/org/apache/activemq/transport/reliable/DefaultReplayBuffer.java
index 6e8425462d..6c30af2a10 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/reliable/DefaultReplayBuffer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/reliable/DefaultReplayBuffer.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.transport.reliable;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
*
* @version $Revision$
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java
index 70c8d5841f..26997e7745 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java
@@ -1,13 +1,14 @@
package org.apache.activemq.transport.stomp;
-import org.apache.activemq.command.ActiveMQMessage;
-import org.apache.activemq.command.ActiveMQDestination;
-
-import javax.jms.JMSException;
-import javax.jms.Destination;
import java.io.IOException;
-import java.util.Map;
import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ActiveMQMessage;
/**
* Implementations of this interface are used to map back and forth from Stomp
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
index a01754d0e9..5a5303c3f4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
@@ -1,15 +1,16 @@
package org.apache.activemq.transport.stomp;
-import org.apache.activemq.command.ActiveMQMessage;
-import org.apache.activemq.command.ActiveMQBytesMessage;
-import org.apache.activemq.command.ActiveMQTextMessage;
-import org.apache.activemq.command.ActiveMQDestination;
-
-import javax.jms.JMSException;
-import javax.jms.Destination;
-import java.util.Map;
-import java.util.HashMap;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+
+import org.apache.activemq.command.ActiveMQBytesMessage;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.ActiveMQTextMessage;
/**
* Implements ActiveMQ 4.0 translations
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
index 093633f0af..fd6c8f9748 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
@@ -22,14 +22,13 @@ import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
-import javax.jms.Destination;
import javax.jms.JMSException;
-import org.apache.activemq.command.ActiveMQBytesMessage;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQMessage;
-import org.apache.activemq.command.ActiveMQTextMessage;
import org.apache.activemq.command.Command;
import org.apache.activemq.command.ConnectionId;
import org.apache.activemq.command.ConnectionInfo;
@@ -52,9 +51,6 @@ import org.apache.activemq.util.IdGenerator;
import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.util.LongSequenceGenerator;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* @author chirino
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSslTransportFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSslTransportFactory.java
index 67c9f62c17..025af7aff1 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSslTransportFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSslTransportFactory.java
@@ -25,7 +25,7 @@ import org.apache.activemq.wireformat.WireFormat;
/**
* A STOMP over SSL transport factory
- *
+ *
* @version $Revision$
*/
public class StompSslTransportFactory extends SslTransportFactory {
@@ -35,8 +35,8 @@ public class StompSslTransportFactory extends SslTransportFactory {
}
public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
- transport = new StompTransportFilter(transport, new LegacyFrameTranslator());
- IntrospectionSupport.setProperties(transport, options);
- return super.compositeConfigure(transport, format, options);
+ transport = new StompTransportFilter(transport, new LegacyFrameTranslator());
+ IntrospectionSupport.setProperties(transport, options);
+ return super.compositeConfigure(transport, format, options);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompTransportFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompTransportFactory.java
index 1b6fbb2828..009f6a0156 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompTransportFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompTransportFactory.java
@@ -25,7 +25,7 @@ import org.apache.activemq.wireformat.WireFormat;
/**
* A STOMP transport factory
- *
+ *
* @version $Revision: 1.1.1.1 $
*/
public class StompTransportFactory extends TcpTransportFactory {
@@ -35,13 +35,14 @@ public class StompTransportFactory extends TcpTransportFactory {
}
public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
- transport = new StompTransportFilter(transport, new LegacyFrameTranslator());
- IntrospectionSupport.setProperties(transport, options);
- return super.compositeConfigure(transport, format, options);
+ transport = new StompTransportFilter(transport, new LegacyFrameTranslator());
+ IntrospectionSupport.setProperties(transport, options);
+ return super.compositeConfigure(transport, format, options);
}
protected boolean isUseInactivityMonitor(Transport transport) {
- // lets disable the inactivity monitor as stomp does not use keep alive packets
+ // lets disable the inactivity monitor as stomp does not use keep alive
+ // packets
return false;
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ResponseHolder.java b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ResponseHolder.java
index 1d83d1cc7e..8445d0797f 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ResponseHolder.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ResponseHolder.java
@@ -36,7 +36,7 @@ public class ResponseHolder {
/**
* Set the Response for this holder
- *
+ *
* @param r
*/
public void setResponse(Response r) {
@@ -58,7 +58,7 @@ public class ResponseHolder {
/**
* wait upto timeout
timeout ms to get a receipt
- *
+ *
* @param timeout
* @return
*/
@@ -67,8 +67,7 @@ public class ResponseHolder {
if (!notified) {
try {
lock.wait(timeout);
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java
index 2f8d643562..4b71e2739a 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java
@@ -17,10 +17,6 @@
package org.apache.activemq.transport.tcp;
-import org.apache.activemq.command.Command;
-import org.apache.activemq.command.ConnectionInfo;
-import org.apache.activemq.wireformat.WireFormat;
-
import java.io.IOException;
import java.net.URI;
import java.net.UnknownHostException;
@@ -31,6 +27,10 @@ import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
+import org.apache.activemq.command.Command;
+import org.apache.activemq.command.ConnectionInfo;
+import org.apache.activemq.wireformat.WireFormat;
+
/**
* A Transport class that uses SSL and client-side certificate authentication.
* Client-side certificate authentication must be enabled through the
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
index adb810c655..6e5384e097 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
@@ -16,7 +16,24 @@
*/
package org.apache.activemq.transport.tcp;
-import org.apache.activemq.wireformat.WireFormat;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.UnknownHostException;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.net.ServerSocketFactory;
+import javax.net.SocketFactory;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+
import org.apache.activemq.openwire.OpenWireFormat;
import org.apache.activemq.transport.InactivityMonitor;
import org.apache.activemq.transport.Transport;
@@ -26,28 +43,10 @@ import org.apache.activemq.transport.WireFormatNegotiator;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.util.URISupport;
+import org.apache.activemq.wireformat.WireFormat;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.UnknownHostException;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.net.ServerSocketFactory;
-import javax.net.SocketFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.SSLServerSocketFactory;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-
/**
* An implementation of the TcpTransportFactory using SSL. The major
* contribution from this class is that it is aware of SslTransportServer and
@@ -127,7 +126,7 @@ public class SslTransportFactory extends TcpTransportFactory {
if (path != null && path.length() > 0) {
int localPortIndex = path.indexOf(':');
try {
- Integer.parseInt(path.substring((localPortIndex + 1), path.length()));
+ Integer.parseInt(path.substring(localPortIndex + 1, path.length()));
String localString = location.getScheme() + ":/" + path;
localLocation = new URI(localString);
} catch (Exception e) {
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java
index 2f29dd911a..41a2bd4c79 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java
@@ -17,9 +17,6 @@
package org.apache.activemq.transport.tcp;
-import org.apache.activemq.wireformat.WireFormat;
-import org.apache.activemq.transport.Transport;
-
import java.io.IOException;
import java.net.Socket;
import java.net.URI;
@@ -29,6 +26,9 @@ import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocket;
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.wireformat.WireFormat;
+
/**
* An SSL TransportServer.
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
index 26b05eef71..bb3a983bd7 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
@@ -113,7 +113,7 @@ public class TcpTransportFactory extends TransportFactory {
if (path != null && path.length() > 0) {
int localPortIndex = path.indexOf(':');
try {
- Integer.parseInt(path.substring((localPortIndex + 1), path.length()));
+ Integer.parseInt(path.substring(localPortIndex + 1, path.length()));
String localString = location.getScheme() + ":/" + path;
localLocation = new URI(localString);
} catch (Exception e) {
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
index 871daff0b1..0dcdf4cd63 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
@@ -28,6 +28,8 @@ import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;
+import javax.net.ServerSocketFactory;
+
import org.apache.activemq.command.BrokerInfo;
import org.apache.activemq.openwire.OpenWireFormatFactory;
import org.apache.activemq.transport.Transport;
@@ -40,8 +42,6 @@ import org.apache.activemq.wireformat.WireFormatFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.net.ServerSocketFactory;
-
/**
* A TCP based implementation of {@link TransportServer}
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/ByteBufferPool.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/ByteBufferPool.java
index f198aa5944..af5c9354e4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/ByteBufferPool.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/ByteBufferPool.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.transport.udp;
-import org.apache.activemq.Service;
-
import java.nio.ByteBuffer;
+import org.apache.activemq.Service;
+
/**
* Represents a pool of {@link ByteBuffer} instances.
* This strategy could just create new buffers for each call or
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java
index b3087d6246..75351ee64f 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.transport.udp;
+import java.io.IOException;
+import java.net.SocketAddress;
+
import org.apache.activemq.Service;
import org.apache.activemq.command.Command;
import org.apache.activemq.transport.reliable.ReplayBuffer;
import org.apache.activemq.transport.reliable.Replayer;
-import java.io.IOException;
-import java.net.SocketAddress;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannelSupport.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannelSupport.java
index 4261a77c6f..02277716bb 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannelSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannelSupport.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.transport.udp;
+import java.io.IOException;
+import java.net.SocketAddress;
+
import org.apache.activemq.command.Command;
import org.apache.activemq.openwire.OpenWireFormat;
import org.apache.activemq.transport.reliable.ReplayBuffer;
import org.apache.activemq.util.IntSequenceGenerator;
-import java.io.IOException;
-import java.net.SocketAddress;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramChannel.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramChannel.java
index b56bcd5ea5..6ad1c7dd5b 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramChannel.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramChannel.java
@@ -55,8 +55,7 @@ public class CommandDatagramChannel extends CommandChannelSupport {
private Object writeLock = new Object();
private int defaultMarshalBufferSize = 64 * 1024;
- public CommandDatagramChannel(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize,
- SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller,
+ public CommandDatagramChannel(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize, SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller,
DatagramChannel channel, ByteBufferPool bufferPool) {
super(transport, wireFormat, datagramSize, targetAddress, headerMarshaller);
this.channel = channel;
@@ -224,8 +223,7 @@ public class CommandDatagramChannel extends CommandChannelSupport {
// Implementation methods
// -------------------------------------------------------------------------
- protected void sendWriteBuffer(int commandId, SocketAddress address, ByteBuffer writeBuffer,
- boolean redelivery) throws IOException {
+ protected void sendWriteBuffer(int commandId, SocketAddress address, ByteBuffer writeBuffer, boolean redelivery) throws IOException {
// lets put the datagram into the replay buffer first to prevent timing
// issues
ReplayBuffer bufferCache = getReplayBuffer();
@@ -236,7 +234,7 @@ public class CommandDatagramChannel extends CommandChannelSupport {
writeBuffer.flip();
if (log.isDebugEnabled()) {
- String text = (redelivery) ? "REDELIVERING" : "sending";
+ String text = redelivery ? "REDELIVERING" : "sending";
log.debug("Channel: " + name + " " + text + " datagram: " + commandId + " to: " + address);
}
channel.send(writeBuffer, address);
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramSocket.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramSocket.java
index 84bd3d5761..122a8eb671 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramSocket.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramSocket.java
@@ -202,7 +202,7 @@ public class CommandDatagramSocket extends CommandChannelSupport {
}
if (log.isDebugEnabled()) {
- String text = (redelivery) ? "REDELIVERING" : "sending";
+ String text = redelivery ? "REDELIVERING" : "sending";
log.debug("Channel: " + name + " " + text + " datagram: " + commandId + " to: " + address);
}
DatagramPacket packet = new DatagramPacket(data, 0, data.length, address);
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramEndpoint.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramEndpoint.java
index ba39706e5c..c2bc5f17ae 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramEndpoint.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramEndpoint.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.transport.udp;
-import org.apache.activemq.command.BaseEndpoint;
-
import java.net.SocketAddress;
+import org.apache.activemq.command.BaseEndpoint;
+
/**
*
* @version $Revision$
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java
index d8c1c0ca5e..72c82ac571 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java
@@ -17,9 +17,6 @@
package org.apache.activemq.transport.udp;
-import org.apache.activemq.command.Command;
-import org.apache.activemq.command.Endpoint;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.DatagramPacket;
@@ -28,6 +25,9 @@ import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
+import org.apache.activemq.command.Command;
+import org.apache.activemq.command.Endpoint;
+
/**
*
* @version $Revision$
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/SimpleBufferPool.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/SimpleBufferPool.java
index e1e8a2698e..3f7eef0fa3 100644
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/SimpleBufferPool.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/SimpleBufferPool.java
@@ -68,8 +68,7 @@ public class SimpleBufferPool implements ByteBufferPool {
protected ByteBuffer createBuffer() {
if (useDirect) {
return ByteBuffer.allocateDirect(defaultSize);
- }
- else {
+ } else {
return ByteBuffer.allocate(defaultSize);
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransport.java
index 687620dc27..e87cc5adb0 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransport.java
@@ -16,6 +16,19 @@
*/
package org.apache.activemq.transport.udp;
+import java.io.EOFException;
+import java.io.IOException;
+import java.net.BindException;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.net.URI;
+import java.net.UnknownHostException;
+import java.nio.channels.AsynchronousCloseException;
+import java.nio.channels.DatagramChannel;
+
import org.apache.activemq.Service;
import org.apache.activemq.command.Command;
import org.apache.activemq.command.Endpoint;
@@ -31,19 +44,6 @@ import org.apache.activemq.util.ServiceStopper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.io.EOFException;
-import java.io.IOException;
-import java.net.BindException;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.net.URI;
-import java.net.UnknownHostException;
-import java.nio.channels.AsynchronousCloseException;
-import java.nio.channels.DatagramChannel;
-
/**
* An implementation of the {@link Transport} interface using raw UDP
*
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java
index 80b0c8f3be..0ca7685364 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java
@@ -56,11 +56,9 @@ public class UdpTransportFactory extends TransportFactory {
Transport configuredTransport = configure(transport, wf, options, true);
UdpTransportServer server = new UdpTransportServer(location, transport, configuredTransport, createReplayStrategy());
return server;
- }
- catch (URISyntaxException e) {
+ } catch (URISyntaxException e) {
throw IOExceptionSupport.create(e);
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw IOExceptionSupport.create(e);
}
}
@@ -71,7 +69,7 @@ public class UdpTransportFactory extends TransportFactory {
public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
IntrospectionSupport.setProperties(transport, options);
- final UdpTransport udpTransport = (UdpTransport) transport;
+ final UdpTransport udpTransport = (UdpTransport)transport;
// deal with fragmentation
transport = new CommandJoiner(transport, asOpenWireFormat(format));
@@ -97,14 +95,14 @@ public class UdpTransportFactory extends TransportFactory {
/**
* Configures the transport
*
- * @param acceptServer
- * true if this transport is used purely as an 'accept' transport
- * for new connections which work like TCP SocketServers where
- * new connections spin up a new separate UDP transport
+ * @param acceptServer true if this transport is used purely as an 'accept'
+ * transport for new connections which work like TCP
+ * SocketServers where new connections spin up a new separate
+ * UDP transport
*/
protected Transport configure(Transport transport, WireFormat format, Map options, boolean acceptServer) throws Exception {
IntrospectionSupport.setProperties(transport, options);
- UdpTransport udpTransport = (UdpTransport) transport;
+ UdpTransport udpTransport = (UdpTransport)transport;
OpenWireFormat openWireFormat = asOpenWireFormat(format);
@@ -129,8 +127,7 @@ public class UdpTransportFactory extends TransportFactory {
// delegate to one that does
transport = new CommandJoiner(transport, openWireFormat);
return transport;
- }
- else {
+ } else {
ReliableTransport reliableTransport = new ReliableTransport(transport, udpTransport);
Replayer replayer = reliableTransport.getReplayer();
reliableTransport.setReplayStrategy(createReplayStrategy(replayer));
@@ -157,7 +154,7 @@ public class UdpTransportFactory extends TransportFactory {
}
protected OpenWireFormat asOpenWireFormat(WireFormat wf) {
- OpenWireFormat answer = (OpenWireFormat) wf;
+ OpenWireFormat answer = (OpenWireFormat)wf;
return answer;
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java b/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
index e7ee90a0e1..9db887f308 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
@@ -54,7 +54,6 @@ public class UdpTransportServer extends TransportServerSupport {
private boolean usingWireFormatNegotiation;
private Map transports = new HashMap();
-
public UdpTransportServer(URI connectURI, UdpTransport serverTransport, Transport configuredTransport, ReplayStrategy replayStrategy) {
super(connectURI);
this.serverTransport = serverTransport;
@@ -81,7 +80,7 @@ public class UdpTransportServer extends TransportServerSupport {
configuredTransport.setTransportListener(new TransportListener() {
public void onCommand(Object o) {
- final Command command = (Command) o;
+ final Command command = (Command)o;
processInboundConnection(command);
}
@@ -103,18 +102,17 @@ public class UdpTransportServer extends TransportServerSupport {
}
protected void processInboundConnection(Command command) {
- DatagramEndpoint endpoint = (DatagramEndpoint) command.getFrom();
+ DatagramEndpoint endpoint = (DatagramEndpoint)command.getFrom();
if (log.isDebugEnabled()) {
log.debug("Received command on: " + this + " from address: " + endpoint + " command: " + command);
}
Transport transport = null;
synchronized (transports) {
- transport = (Transport) transports.get(endpoint);
+ transport = (Transport)transports.get(endpoint);
if (transport == null) {
if (usingWireFormatNegotiation && !command.isWireFormatInfo()) {
log.error("Received inbound server communication from: " + command.getFrom() + " expecting WireFormatInfo but was command: " + command);
- }
- else {
+ } else {
if (log.isDebugEnabled()) {
log.debug("Creating a new UDP server connection");
}
@@ -122,14 +120,12 @@ public class UdpTransportServer extends TransportServerSupport {
transport = createTransport(command, endpoint);
transport = configureTransport(transport);
transports.put(endpoint, transport);
- }
- catch (IOException e) {
+ } catch (IOException e) {
log.error("Caught: " + e, e);
getAcceptListener().onAcceptError(e);
}
}
- }
- else {
+ } else {
log.warn("Discarding duplicate command to server from: " + endpoint + " command: " + command);
}
}
@@ -152,8 +148,9 @@ public class UdpTransportServer extends TransportServerSupport {
final ReliableTransport reliableTransport = new ReliableTransport(transport, transport);
Replayer replayer = reliableTransport.getReplayer();
reliableTransport.setReplayStrategy(replayStrategy);
-
- // Joiner must be on outside as the inbound messages must be processed by the reliable transport first
+
+ // Joiner must be on outside as the inbound messages must be processed
+ // by the reliable transport first
return new CommandJoiner(reliableTransport, connectionWireFormat) {
public void start() throws Exception {
super.start();
@@ -161,28 +158,20 @@ public class UdpTransportServer extends TransportServerSupport {
}
};
-
-
/**
- final WireFormatNegotiator wireFormatNegotiator = new WireFormatNegotiator(configuredTransport, transport.getWireFormat(), serverTransport
- .getMinmumWireFormatVersion()) {
-
- public void start() throws Exception {
- super.start();
- log.debug("Starting a new server transport: " + this + " with command: " + command);
- onCommand(command);
- }
-
- // lets use the specific addressing of wire format
- protected void sendWireFormat(WireFormatInfo info) throws IOException {
- log.debug("#### we have negotiated the wireformat; sending a wireformat to: " + address);
- transport.oneway(info, address);
- }
- };
- return wireFormatNegotiator;
- */
+ * final WireFormatNegotiator wireFormatNegotiator = new
+ * WireFormatNegotiator(configuredTransport, transport.getWireFormat(),
+ * serverTransport .getMinmumWireFormatVersion()) { public void start()
+ * throws Exception { super.start(); log.debug("Starting a new server
+ * transport: " + this + " with command: " + command);
+ * onCommand(command); } // lets use the specific addressing of wire
+ * format protected void sendWireFormat(WireFormatInfo info) throws
+ * IOException { log.debug("#### we have negotiated the wireformat;
+ * sending a wireformat to: " + address); transport.oneway(info,
+ * address); } }; return wireFormatNegotiator;
+ */
}
-
+
public InetSocketAddress getSocketAddress() {
return serverTransport.getLocalSocketAddress();
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
index c35dbcebdc..ff204d52b4 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
@@ -16,10 +16,6 @@ package org.apache.activemq.transport.vm;
import java.io.IOException;
import java.net.URI;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicLong;
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java
index 4668ddb391..3f557110c1 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java
@@ -21,11 +21,13 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerFactoryHandler;
import org.apache.activemq.broker.BrokerRegistry;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
-import org.apache.activemq.broker.BrokerFactoryHandler;
import org.apache.activemq.transport.MarshallingTransportFilter;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportFactory;
@@ -37,7 +39,6 @@ import org.apache.activemq.util.URISupport;
import org.apache.activemq.util.URISupport.CompositeData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
public class VMTransportFactory extends TransportFactory {
private static final Log log = LogFactory.getLog(VMTransportFactory.class);
diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportServer.java b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportServer.java
index eec705565e..2ad93fc4b8 100755
--- a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportServer.java
+++ b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportServer.java
@@ -19,6 +19,7 @@ package org.apache.activemq.transport.vm;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI;
+import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.command.BrokerInfo;
import org.apache.activemq.transport.MutexTransport;
@@ -27,8 +28,6 @@ import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportAcceptListener;
import org.apache.activemq.transport.TransportServer;
-import java.util.concurrent.atomic.AtomicInteger;
-
/**
* Broker side of the VMTransport
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/DataByteArrayInputStream.java b/activemq-core/src/main/java/org/apache/activemq/util/DataByteArrayInputStream.java
index 34fe8b7100..cd484503ad 100755
--- a/activemq-core/src/main/java/org/apache/activemq/util/DataByteArrayInputStream.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/DataByteArrayInputStream.java
@@ -20,7 +20,6 @@ import java.io.DataInput;
import java.io.IOException;
import java.io.InputStream;
import java.io.UTFDataFormatException;
-import org.apache.activemq.util.ByteSequence;
/**
* Optimized ByteArrayInputStream that can be used more than once
@@ -219,8 +218,8 @@ public final class DataByteArrayInputStream extends InputStream implements DataI
}
public long readLong() {
- return (((long)buf[pos++] << 56) + ((long)(buf[pos++] & 255) << 48) + ((long)(buf[pos++] & 255) << 40) + ((long)(buf[pos++] & 255) << 32)
- + ((long)(buf[pos++] & 255) << 24) + ((buf[pos++] & 255) << 16) + ((buf[pos++] & 255) << 8) + ((buf[pos++] & 255) << 0));
+ long rc = ((long)buf[pos++] << 56) + ((long)(buf[pos++] & 255) << 48) + ((long)(buf[pos++] & 255) << 40) + ((long)(buf[pos++] & 255) << 32);
+ return rc + ((long)(buf[pos++] & 255) << 24) + ((buf[pos++] & 255) << 16) + ((buf[pos++] & 255) << 8) + ((buf[pos++] & 255) << 0);
}
public float readFloat() throws IOException {
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/IOHelper.java b/activemq-core/src/main/java/org/apache/activemq/util/IOHelper.java
index 995ff2cc28..47899274b2 100644
--- a/activemq-core/src/main/java/org/apache/activemq/util/IOHelper.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/IOHelper.java
@@ -30,14 +30,14 @@ public class IOHelper {
}
/**
- * Allows a system property to be used to overload the default data directory
- * which can be useful for forcing the test cases to use a target/ prefix
+ * Allows a system property to be used to overload the default data
+ * directory which can be useful for forcing the test cases to use a target/
+ * prefix
*/
public static String getDefaultDirectoryPrefix() {
try {
return System.getProperty("org.apache.activemq.default.directory.prefix", "");
- }
- catch (Exception e) {
+ } catch (Exception e) {
return "";
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java b/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java
index ef4fd6261b..c5acc3e214 100755
--- a/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java
@@ -16,8 +16,6 @@
*/
package org.apache.activemq.util;
-import org.apache.activemq.command.ActiveMQDestination;
-
import java.beans.PropertyEditor;
import java.beans.PropertyEditorManager;
import java.lang.reflect.Field;
@@ -30,8 +28,10 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.activemq.command.ActiveMQDestination;
public class IntrospectionSupport {
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/MapHelper.java b/activemq-core/src/main/java/org/apache/activemq/util/MapHelper.java
index 1c1275cff0..da54442563 100755
--- a/activemq-core/src/main/java/org/apache/activemq/util/MapHelper.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/MapHelper.java
@@ -20,7 +20,7 @@ import java.util.Map;
/**
* A bunch of utility methods for working with maps
- *
+ *
* @version $Revision$
*/
public class MapHelper {
@@ -33,16 +33,15 @@ public class MapHelper {
}
/**
- * Extracts the value from the map and coerces to an int value
- * or returns a default value if one could not be found or coerced
+ * Extracts the value from the map and coerces to an int value or returns a
+ * default value if one could not be found or coerced
*/
public static int getInt(Map map, String key, int defaultValue) {
Object value = map.get(key);
if (value instanceof Number) {
- return ((Number) value).intValue();
- }
- else if (value instanceof String) {
- return Integer.parseInt((String) value);
+ return ((Number)value).intValue();
+ } else if (value instanceof String) {
+ return Integer.parseInt((String)value);
}
return defaultValue;
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/MarshallingSupport.java b/activemq-core/src/main/java/org/apache/activemq/util/MarshallingSupport.java
index aff4686f8c..aaa9e33a73 100755
--- a/activemq-core/src/main/java/org/apache/activemq/util/MarshallingSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/MarshallingSupport.java
@@ -21,8 +21,6 @@ import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.StringWriter;
import java.io.UTFDataFormatException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -133,7 +131,7 @@ public class MarshallingSupport {
} else if (value.getClass() == Double.class) {
marshalDouble(out, ((Double)value).doubleValue());
} else if (value.getClass() == byte[].class) {
- marshalByteArray(out, ((byte[])value));
+ marshalByteArray(out, (byte[])value);
} else if (value.getClass() == String.class) {
marshalString(out, (String)value);
} else if (value instanceof Map) {
@@ -149,9 +147,10 @@ public class MarshallingSupport {
static public Object unmarshalPrimitive(DataInputStream in) throws IOException {
Object value = null;
- switch (in.readByte()) {
+ byte type = in.readByte();
+ switch (type) {
case BYTE_TYPE:
- value = Byte.valueOf(in.readByte());
+ value = Byte.valueOf(type);
break;
case BOOLEAN_TYPE:
value = in.readBoolean() ? Boolean.TRUE : Boolean.FALSE;
@@ -190,6 +189,8 @@ public class MarshallingSupport {
case LIST_TYPE:
value = unmarshalPrimitiveList(in);
break;
+ default:
+ throw new IOException("Unknown primitive type: " + type);
}
return value;
}
@@ -281,9 +282,9 @@ public class MarshallingSupport {
// TODO diff: Sun code - removed
byte[] bytearr = new byte[utflen + 4]; // TODO diff: Sun code
bytearr[count++] = (byte)((utflen >>> 24) & 0xFF); // TODO diff:
- // Sun code
+ // Sun code
bytearr[count++] = (byte)((utflen >>> 16) & 0xFF); // TODO diff:
- // Sun code
+ // Sun code
bytearr[count++] = (byte)((utflen >>> 8) & 0xFF);
bytearr[count++] = (byte)((utflen >>> 0) & 0xFF);
for (int i = 0; i < strlen; i++) {
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/MessageComparatorSupport.java b/activemq-core/src/main/java/org/apache/activemq/util/MessageComparatorSupport.java
index d96d4c3869..105a2ddda7 100644
--- a/activemq-core/src/main/java/org/apache/activemq/util/MessageComparatorSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/MessageComparatorSupport.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.util;
-import javax.jms.Message;
-
import java.io.Serializable;
import java.util.Comparator;
+import javax.jms.Message;
+
/**
* A base class for comparators which works on JMS {@link Message} objects
*
@@ -29,8 +29,8 @@ import java.util.Comparator;
public abstract class MessageComparatorSupport implements Comparator, Serializable {
public int compare(Object object1, Object object2) {
- Message command1 = (Message) object1;
- Message command2 = (Message) object2;
+ Message command1 = (Message)object1;
+ Message command2 = (Message)object2;
return compareMessages(command1, command2);
}
@@ -39,15 +39,13 @@ public abstract class MessageComparatorSupport implements Comparator, Serializab
protected int compareComparators(final Comparable comparable, final Comparable comparable2) {
if (comparable == null && comparable2 == null) {
return 0;
- }
- else if (comparable != null) {
- if (comparable2== null) {
+ } else if (comparable != null) {
+ if (comparable2 == null) {
return 1;
}
return comparable.compareTo(comparable2);
- }
- else if (comparable2 != null) {
- if (comparable== null) {
+ } else if (comparable2 != null) {
+ if (comparable == null) {
return -11;
}
return comparable2.compareTo(comparable) * -1;
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/MessageDestinationComparator.java b/activemq-core/src/main/java/org/apache/activemq/util/MessageDestinationComparator.java
index f131621252..91c0582694 100644
--- a/activemq-core/src/main/java/org/apache/activemq/util/MessageDestinationComparator.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/MessageDestinationComparator.java
@@ -16,9 +16,11 @@
*/
package org.apache.activemq.util;
-import org.apache.activemq.command.ActiveMQMessage;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
-import javax.jms.*;
+import org.apache.activemq.command.ActiveMQMessage;
/**
* A comparator which works on SendCommand objects to compare the destinations
@@ -33,13 +35,12 @@ public class MessageDestinationComparator extends MessageComparatorSupport {
protected Destination getDestination(Message message) {
if (message instanceof ActiveMQMessage) {
- ActiveMQMessage amqMessage = (ActiveMQMessage) message;
+ ActiveMQMessage amqMessage = (ActiveMQMessage)message;
return amqMessage.getDestination();
}
try {
return message.getJMSDestination();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
return null;
}
}
@@ -51,6 +52,4 @@ public class MessageDestinationComparator extends MessageComparatorSupport {
return null;
}
-
-
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/ServiceStopper.java b/activemq-core/src/main/java/org/apache/activemq/util/ServiceStopper.java
index fe54b615bc..6a85f80850 100644
--- a/activemq-core/src/main/java/org/apache/activemq/util/ServiceStopper.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/ServiceStopper.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.util;
+import java.util.Iterator;
+import java.util.List;
+
import org.apache.activemq.Service;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.Iterator;
-import java.util.List;
-
/**
* A helper class used to stop a bunch of services, catching and logging any
* exceptions and then throwing the first exception when everything is stoped.
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/ServiceSupport.java b/activemq-core/src/main/java/org/apache/activemq/util/ServiceSupport.java
index d83751dccd..4bbe629896 100644
--- a/activemq-core/src/main/java/org/apache/activemq/util/ServiceSupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/ServiceSupport.java
@@ -23,8 +23,9 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
- * A helper class for working with services together with a useful base class for service implementations.
- *
+ * A helper class for working with services together with a useful base class
+ * for service implementations.
+ *
* @version $Revision: 1.1 $
*/
public abstract class ServiceSupport implements Service {
@@ -37,8 +38,7 @@ public abstract class ServiceSupport implements Service {
public static void dispose(Service service) {
try {
service.stop();
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.debug("Could not stop service: " + service + ". Reason: " + e, e);
}
}
@@ -55,8 +55,7 @@ public abstract class ServiceSupport implements Service {
ServiceStopper stopper = new ServiceStopper();
try {
doStop(stopper);
- }
- catch (Exception e) {
+ } catch (Exception e) {
stopper.onException(this, e);
}
stopped.set(true);
@@ -80,7 +79,6 @@ public abstract class ServiceSupport implements Service {
return stopping.get();
}
-
/**
* @return true if this service is closed
*/
diff --git a/activemq-core/src/main/java/org/apache/activemq/util/URISupport.java b/activemq-core/src/main/java/org/apache/activemq/util/URISupport.java
index 7dd469f95f..a06052dd72 100755
--- a/activemq-core/src/main/java/org/apache/activemq/util/URISupport.java
+++ b/activemq-core/src/main/java/org/apache/activemq/util/URISupport.java
@@ -227,6 +227,8 @@ public class URISupport {
l.add(s);
last = i + 1;
}
+ break;
+ default:
}
}
diff --git a/activemq-core/src/main/java/org/apache/activemq/xbean/BrokerFactoryBean.java b/activemq-core/src/main/java/org/apache/activemq/xbean/BrokerFactoryBean.java
index 4a65c8dc01..9022a4fbf0 100644
--- a/activemq-core/src/main/java/org/apache/activemq/xbean/BrokerFactoryBean.java
+++ b/activemq-core/src/main/java/org/apache/activemq/xbean/BrokerFactoryBean.java
@@ -16,9 +16,14 @@
*/
package org.apache.activemq.xbean;
+import java.beans.PropertyEditorManager;
+import java.net.URI;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.xbean.spring.context.ResourceXmlApplicationContext;
+import org.apache.xbean.spring.context.impl.URIEditor;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
@@ -26,11 +31,6 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.io.Resource;
-import org.apache.xbean.spring.context.ResourceXmlApplicationContext;
-import org.apache.xbean.spring.context.impl.URIEditor;
-
-import java.beans.PropertyEditorManager;
-import java.net.URI;
/**
* A Spring {@link FactoryBean} which creates an embedded broker inside a Spring
diff --git a/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java b/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
index 6ce8ec7e06..5dcd643ed4 100644
--- a/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
+++ b/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
@@ -16,12 +16,17 @@
*/
package org.apache.activemq.xbean;
+import java.beans.PropertyEditorManager;
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URI;
+
import org.apache.activemq.broker.BrokerFactoryHandler;
import org.apache.activemq.broker.BrokerService;
-import org.apache.xbean.spring.context.ResourceXmlApplicationContext;
-import org.apache.xbean.spring.context.impl.URIEditor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.xbean.spring.context.ResourceXmlApplicationContext;
+import org.apache.xbean.spring.context.impl.URIEditor;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.ClassPathResource;
@@ -30,11 +35,6 @@ import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
import org.springframework.util.ResourceUtils;
-import java.beans.PropertyEditorManager;
-import java.io.File;
-import java.net.URI;
-import java.net.MalformedURLException;
-
/**
* @version $Revision$
*/
@@ -52,9 +52,8 @@ public class XBeanBrokerFactory implements BrokerFactoryHandler {
BrokerService broker = null;
try {
- broker = (BrokerService) context.getBean("broker");
- }
- catch (BeansException e) {
+ broker = (BrokerService)context.getBean("broker");
+ } catch (BeansException e) {
}
if (broker == null) {
@@ -62,7 +61,7 @@ public class XBeanBrokerFactory implements BrokerFactoryHandler {
String[] names = context.getBeanNamesForType(BrokerService.class);
for (int i = 0; i < names.length; i++) {
String name = names[i];
- broker = (BrokerService) context.getBean(name);
+ broker = (BrokerService)context.getBean(name);
if (broker != null) {
break;
}
@@ -71,24 +70,22 @@ public class XBeanBrokerFactory implements BrokerFactoryHandler {
if (broker == null) {
throw new IllegalArgumentException("The configuration has no BrokerService instance for resource: " + config);
}
-
+
// TODO warning resources from the context may not be closed down!
-
+
return broker;
}
protected ApplicationContext createApplicationContext(String uri) throws MalformedURLException {
log.debug("Now attempting to figure out the type of resource: " + uri);
-
+
Resource resource;
File file = new File(uri);
if (file.exists()) {
resource = new FileSystemResource(uri);
- }
- else if (ResourceUtils.isUrl(uri)) {
+ } else if (ResourceUtils.isUrl(uri)) {
resource = new UrlResource(uri);
- }
- else {
+ } else {
resource = new ClassPathResource(uri);
}
return new ResourceXmlApplicationContext(resource);
diff --git a/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java b/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java
index 31d3cdc3d9..f4630fb2c4 100755
--- a/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java
@@ -62,7 +62,7 @@ public class ActiveMQMessageAuditTest extends TestCase {
for (int i = 0; i < count; i++) {
String id = idGen.generateId();
list.add(id);
- assertTrue(audit.isDuplicate(id) == false);
+ assertFalse(audit.isDuplicate(id));
}
for (String id : list) {
assertTrue(audit.isDuplicate(id));
@@ -85,7 +85,7 @@ public class ActiveMQMessageAuditTest extends TestCase {
ActiveMQMessage msg = new ActiveMQMessage();
msg.setMessageId(id);
list.add(msg);
- assertTrue(audit.isDuplicateMessageReference(msg) == false);
+ assertFalse(audit.isDuplicateMessageReference(msg));
}
for (MessageReference msg : list) {
assertTrue(audit.isDuplicateMessageReference(msg));
diff --git a/activemq-core/src/test/java/org/apache/activemq/AutoFailTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/AutoFailTestSupport.java
index 4f9f56d3ec..3e792bdbfa 100644
--- a/activemq-core/src/test/java/org/apache/activemq/AutoFailTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/AutoFailTestSupport.java
@@ -16,9 +16,9 @@
*/
package org.apache.activemq;
-import junit.framework.TestCase;
-
import java.util.concurrent.atomic.AtomicBoolean;
+
+import junit.framework.TestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/activemq-core/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java b/activemq-core/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java
index a04ee2e4d7..d24715248c 100644
--- a/activemq-core/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq;
+import javax.jms.JMSException;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.jms.JMSException;
-
/**
* @version $Revision: 1.1 $
*/
@@ -36,8 +36,7 @@ public class CreateConsumerButDontStartConnectionWarningTest extends JmsQueueSen
protected void assertMessagesAreReceived() throws JMSException {
try {
Thread.sleep(1000);
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
log.warn("Caught: " + e, e);
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java
index fa630b3a13..fd16affd7c 100644
--- a/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java
@@ -38,9 +38,9 @@ import org.springframework.jms.core.JmsTemplate;
public abstract class EmbeddedBrokerTestSupport extends TestCase {
protected static final Log LOG = LogFactory.getLog(EmbeddedBrokerTestSupport.class);
-
+
protected BrokerService broker;
- //protected String bindAddress = "tcp://localhost:61616";
+ // protected String bindAddress = "tcp://localhost:61616";
protected String bindAddress = "vm://localhost";
protected ConnectionFactory connectionFactory;
protected boolean useTopic;
@@ -79,8 +79,7 @@ public abstract class EmbeddedBrokerTestSupport extends TestCase {
if (usePooledConnectionWithTemplate) {
// lets use a pool to avoid creating and closing producers
return new JmsTemplate(new PooledConnectionFactory(bindAddress));
- }
- else {
+ } else {
return new JmsTemplate(connectionFactory);
}
}
@@ -101,8 +100,7 @@ public abstract class EmbeddedBrokerTestSupport extends TestCase {
protected Destination createDestination(String subject) {
if (useTopic) {
return new ActiveMQTopic(subject);
- }
- else {
+ } else {
return new ActiveMQQueue(subject);
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java
index 160237c131..153ce76d7f 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java
@@ -20,14 +20,13 @@ import javax.jms.DeliveryMode;
import org.apache.activemq.test.JmsTopicSendReceiveTest;
-
/**
* @version $Revision: 1.2 $
*/
public class JmsDurableQueueWildcardSendReceiveTest extends JmsTopicSendReceiveTest {
/**
- * Set up the test with a queue and persistent delivery mode.
+ * Set up the test with a queue and persistent delivery mode.
*
* @see junit.framework.TestCase#setUp()
*/
@@ -36,18 +35,18 @@ public class JmsDurableQueueWildcardSendReceiveTest extends JmsTopicSendReceiveT
deliveryMode = DeliveryMode.PERSISTENT;
super.setUp();
}
-
+
/**
- * Returns the consumer subject.
+ * Returns the consumer subject.
*/
- protected String getConsumerSubject(){
+ protected String getConsumerSubject() {
return "FOO.>";
}
-
+
/**
- * Returns the producer subject.
+ * Returns the producer subject.
*/
- protected String getProducerSubject(){
+ protected String getProducerSubject() {
return "FOO.BAR.HUMBUG";
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java
index 9e6522232b..b7c8121bd0 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq;
-import org.apache.activemq.test.JmsTopicSendReceiveTest;
-
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.MessageConsumer;
import javax.jms.Topic;
+import org.apache.activemq.test.JmsTopicSendReceiveTest;
+
/**
* @version $Revision: 1.3 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsQueueSendReceiveMultipleConsumersTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsQueueSendReceiveMultipleConsumersTest.java
index 192f089425..bae6c4ad60 100644
--- a/activemq-core/src/test/java/org/apache/activemq/JmsQueueSendReceiveMultipleConsumersTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsQueueSendReceiveMultipleConsumersTest.java
@@ -15,24 +15,24 @@
* limitations under the License.
*/
package org.apache.activemq;
-import javax.jms.MessageConsumer;
+import javax.jms.MessageConsumer;
/**
* @version $Revision: 1.2 $
*/
-public class JmsQueueSendReceiveMultipleConsumersTest extends JmsQueueSendReceiveTest{
+public class JmsQueueSendReceiveMultipleConsumersTest extends JmsQueueSendReceiveTest {
MessageConsumer consumer1;
MessageConsumer consumer2;
-
+
protected void setUp() throws Exception {
messageCount = 5000;
super.setUp();
-
+
consumer1 = createConsumer();
consumer1.setMessageListener(this);
consumer2 = createConsumer();
consumer2.setMessageListener(this);
-
+
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java
index e818aa45a9..099e4eb471 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq;
-import org.apache.activemq.test.JmsTopicSendReceiveTest;
-
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.MessageConsumer;
import javax.jms.Topic;
+import org.apache.activemq.test.JmsTopicSendReceiveTest;
+
/**
* @version $Revision: 1.3 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java
index 57ffe72c8a..f0fc740e18 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java
@@ -17,13 +17,13 @@
package org.apache.activemq;
import javax.jms.DeliveryMode;
-import javax.jms.Session;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.TextMessage;
import javax.jms.Destination;
import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.test.JmsTopicSendReceiveTest;
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java
index 8da0c91e6e..2448c78ffb 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java
@@ -16,6 +16,13 @@
*/
package org.apache.activemq;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
@@ -25,12 +32,6 @@ import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
/**
* @version $Revision: 1.7 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
index 929f350238..054de03cf4 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
@@ -16,7 +16,7 @@
*/
package org.apache.activemq;
-import junit.framework.TestCase;
+import java.util.ArrayList;
import javax.jms.BytesMessage;
import javax.jms.Connection;
@@ -30,7 +30,8 @@ import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TemporaryQueue;
import javax.jms.TextMessage;
-import java.util.ArrayList;
+
+import junit.framework.TestCase;
/**
* @version
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java
index 2d65c818be..8a86c22a0a 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java
@@ -67,8 +67,9 @@ public class JmsTestSupport extends CombinationTestSupport {
return (ActiveMQDestination)session.createTemporaryQueue();
case ActiveMQDestination.TEMP_TOPIC_TYPE:
return (ActiveMQDestination)session.createTemporaryTopic();
+ default:
+ throw new IllegalArgumentException("type: " + type);
}
- throw new IllegalArgumentException("type: " + type);
}
protected void sendMessages(Destination destination, int count) throws Exception {
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java
index c289a8746a..7f7b5f6c9e 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq;
-import org.apache.activemq.test.JmsTopicSendReceiveTest;
-
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.MessageConsumer;
import javax.jms.Topic;
+import org.apache.activemq.test.JmsTopicSendReceiveTest;
+
/**
* @version $Revision: 1.3 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java
index 23c704b028..9f8f87ea62 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java
@@ -53,29 +53,25 @@ public class JmsTopicRequestReplyTest extends TestSupport implements MessageList
clientConnection = createConnection();
clientConnection.setClientID("ClientConnection:" + getSubject());
- Session session = clientConnection.createSession(false,
- Session.AUTO_ACKNOWLEDGE);
+ Session session = clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
clientConnection.start();
Destination replyDestination = createTemporaryDestination(session);
-
// lets test the destination
clientSideClientID = clientConnection.getClientID();
-
- //TODO
- //String value = ActiveMQDestination.getClientId((ActiveMQDestination) replyDestination);
- //assertEquals("clientID from the temporary destination must be the same", clientSideClientID, value);
+
+ // TODO
+ // String value = ActiveMQDestination.getClientId((ActiveMQDestination)
+ // replyDestination);
+ // assertEquals("clientID from the temporary destination must be the
+ // same", clientSideClientID, value);
log.info("Both the clientID and destination clientID match properly: " + clientSideClientID);
-
/* build queues */
- MessageProducer requestProducer =
- session.createProducer(requestDestination);
- MessageConsumer replyConsumer =
- session.createConsumer(replyDestination);
-
+ MessageProducer requestProducer = session.createProducer(requestDestination);
+ MessageConsumer replyConsumer = session.createConsumer(replyDestination);
/* build requestmessage */
TextMessage requestMessage = session.createTextMessage("Olivier");
@@ -87,14 +83,12 @@ public class JmsTopicRequestReplyTest extends TestSupport implements MessageList
Message msg = replyConsumer.receive(5000);
-
if (msg instanceof TextMessage) {
- TextMessage replyMessage = (TextMessage) msg;
+ TextMessage replyMessage = (TextMessage)msg;
log.info("Received reply.");
log.info(replyMessage.toString());
assertEquals("Wrong message content", "Hello: Olivier", replyMessage.getText());
- }
- else {
+ } else {
fail("Should have received a reply by now");
}
@@ -111,16 +105,19 @@ public class JmsTopicRequestReplyTest extends TestSupport implements MessageList
*/
public void onMessage(Message message) {
try {
- TextMessage requestMessage = (TextMessage) message;
+ TextMessage requestMessage = (TextMessage)message;
log.info("Received request.");
log.info(requestMessage.toString());
Destination replyDestination = requestMessage.getJMSReplyTo();
- //TODO
- //String value = ActiveMQDestination.getClientId((ActiveMQDestination) replyDestination);
- //assertEquals("clientID from the temporary destination must be the same", clientSideClientID, value);
+ // TODO
+ // String value =
+ // ActiveMQDestination.getClientId((ActiveMQDestination)
+ // replyDestination);
+ // assertEquals("clientID from the temporary destination must be the
+ // same", clientSideClientID, value);
TextMessage replyMessage = serverSession.createTextMessage("Hello: " + requestMessage.getText());
@@ -129,15 +126,13 @@ public class JmsTopicRequestReplyTest extends TestSupport implements MessageList
if (dynamicallyCreateProducer) {
replyProducer = serverSession.createProducer(replyDestination);
replyProducer.send(replyMessage);
- }
- else {
+ } else {
replyProducer.send(replyDestination, replyMessage);
}
log.info("Sent reply.");
log.info(replyMessage.toString());
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
onException(e);
}
}
@@ -150,17 +145,14 @@ public class JmsTopicRequestReplyTest extends TestSupport implements MessageList
Message message = requestConsumer.receive(5000);
if (message != null) {
onMessage(message);
- }
- else {
+ } else {
log.error("No message received");
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
onException(e);
}
}
-
protected void setUp() throws Exception {
super.setUp();
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java
index 87e9f17a4d..1f6d8f85d8 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java
@@ -28,10 +28,9 @@ public class JmsTopicSendReceiveSubscriberTest extends JmsTopicSendReceiveTest {
protected MessageConsumer createConsumer() throws JMSException {
if (durable) {
return super.createConsumer();
- }
- else {
+ } else {
TopicSession topicSession = (TopicSession)session;
- return topicSession.createSubscriber((Topic) consumerDestination, null, false);
+ return topicSession.createSubscriber((Topic)consumerDestination, null, false);
}
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java
index fd89c715fe..392ff446f8 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java
@@ -27,9 +27,8 @@ import javax.jms.Topic;
* @version $Revision: 1.3 $
*/
public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport {
- private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
- .getLog(JmsTopicSendReceiveTest.class);
-
+ private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(JmsTopicSendReceiveTest.class);
+
protected Connection connection;
protected void setUp() throws Exception {
@@ -49,14 +48,12 @@ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport {
producer = session.createProducer(null);
producer.setDeliveryMode(deliveryMode);
- log.info("Created producer: " + producer + " delivery mode = " +
- (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT"));
+ log.info("Created producer: " + producer + " delivery mode = " + (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT"));
if (topic) {
consumerDestination = session.createTopic(getConsumerSubject());
producerDestination = session.createTopic(getProducerSubject());
- }
- else {
+ } else {
consumerDestination = session.createQueue(getConsumerSubject());
producerDestination = session.createQueue(getProducerSubject());
}
@@ -67,20 +64,20 @@ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport {
consumer.setMessageListener(this);
connection.start();
- //log.info("Created connection: " + connection);
+ // log.info("Created connection: " + connection);
}
protected MessageConsumer createConsumer() throws JMSException {
if (durable) {
log.info("Creating durable consumer");
- return session.createDurableSubscriber((Topic) consumerDestination, getName());
+ return session.createDurableSubscriber((Topic)consumerDestination, getName());
}
return session.createConsumer(consumerDestination);
}
protected void tearDown() throws Exception {
log.info("Dumping stats...");
- //connectionFactory.getStats().reset();
+ // connectionFactory.getStats().reset();
log.info("Closing down connection");
diff --git a/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
index b76f2f38de..b937385528 100755
--- a/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
@@ -17,13 +17,13 @@
package org.apache.activemq;
import javax.jms.DeliveryMode;
-import javax.jms.Session;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.TextMessage;
import javax.jms.Destination;
import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.test.JmsTopicSendReceiveTest;
diff --git a/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java b/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java
index 3c1ca7586e..bce9072224 100644
--- a/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java
@@ -18,20 +18,19 @@ package org.apache.activemq;
* limitations under the License.
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Random;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.Destination;
import javax.jms.Session;
import junit.framework.Assert;
import junit.framework.TestCase;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* @author rnewson
diff --git a/activemq-core/src/test/java/org/apache/activemq/SpringTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/SpringTestSupport.java
index ce2224f1ea..e2c189206d 100755
--- a/activemq-core/src/test/java/org/apache/activemq/SpringTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/SpringTestSupport.java
@@ -17,15 +17,14 @@
package org.apache.activemq;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.context.support.AbstractApplicationContext;
-
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import junit.framework.TestCase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.context.support.AbstractApplicationContext;
/**
* A useful base class for spring based unit test cases
diff --git a/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java b/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java
index 57ccba3b00..1efac3c974 100644
--- a/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java
@@ -17,12 +17,6 @@
package org.apache.activemq;
-import junit.framework.TestCase;
-import org.apache.activemq.broker.BrokerPlugin;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.util.UDPTraceBrokerPlugin;
-import org.apache.activemq.broker.view.ConnectionDotFilePlugin;
-
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
@@ -31,6 +25,12 @@ import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
+import junit.framework.TestCase;
+import org.apache.activemq.broker.BrokerPlugin;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.util.UDPTraceBrokerPlugin;
+import org.apache.activemq.broker.view.ConnectionDotFilePlugin;
+
public class TimeStampTest extends TestCase {
public void test() throws Exception {
BrokerService broker = new BrokerService();
@@ -79,10 +79,10 @@ public class TimeStampTest extends TestCase {
assertEquals(sentMessage.getJMSMessageID(), receivedMessage.getJMSMessageID());
// assert message timestamp is in window
- assertTrue("JMS Message Timestamp should be set during the send method: \n" +
- " beforeSend = " + beforeSend + "\n" +
- " getJMSTimestamp = " + receivedMessage.getJMSTimestamp() + "\n" +
- " afterSend = " + afterSend + "\n",
+ assertTrue("JMS Message Timestamp should be set during the send method: \n"
+ + " beforeSend = " + beforeSend + "\n"
+ + " getJMSTimestamp = " + receivedMessage.getJMSTimestamp() + "\n"
+ + " afterSend = " + afterSend + "\n",
beforeSend <= receivedMessage.getJMSTimestamp() && receivedMessage.getJMSTimestamp() <= afterSend);
// assert message timestamp is unchanged
diff --git a/activemq-core/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java b/activemq-core/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
index 4c1c7c73a1..85001dafb9 100644
--- a/activemq-core/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
@@ -16,11 +16,6 @@
*/
package org.apache.activemq;
-import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.spring.SpringConsumer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -31,6 +26,11 @@ import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.spring.SpringConsumer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* @version $Revision$
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/advisory/TempDestDeleteTest.java b/activemq-core/src/test/java/org/apache/activemq/advisory/TempDestDeleteTest.java
index b41aefc99d..21660a142e 100644
--- a/activemq-core/src/test/java/org/apache/activemq/advisory/TempDestDeleteTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/advisory/TempDestDeleteTest.java
@@ -16,6 +16,10 @@
*/
package org.apache.activemq.advisory;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.TimeUnit;
+
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
@@ -30,10 +34,6 @@ import org.apache.activemq.broker.region.RegionBroker;
import org.apache.activemq.command.ActiveMQTempQueue;
import org.apache.activemq.command.ActiveMQTempTopic;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.TimeUnit;
-
/**
*
* @version $Revision: 397249 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/blob/DefaultBlobUploadStrategyTest.java b/activemq-core/src/test/java/org/apache/activemq/blob/DefaultBlobUploadStrategyTest.java
index dbfc706c13..80012af5ec 100755
--- a/activemq-core/src/test/java/org/apache/activemq/blob/DefaultBlobUploadStrategyTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/blob/DefaultBlobUploadStrategyTest.java
@@ -1,13 +1,12 @@
package org.apache.activemq.blob;
-import java.io.File;
-import java.io.InputStream;
-import java.io.FileWriter;
import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.InputStream;
import java.net.URL;
import junit.framework.TestCase;
-
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQBlobMessage;
import org.apache.activemq.command.MessageId;
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/BrokerBenchmark.java b/activemq-core/src/test/java/org/apache/activemq/broker/BrokerBenchmark.java
index c64746c59f..342a87a111 100755
--- a/activemq-core/src/test/java/org/apache/activemq/broker/BrokerBenchmark.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/BrokerBenchmark.java
@@ -54,8 +54,7 @@ public class BrokerBenchmark extends BrokerTestSupport {
public boolean deliveryMode;
public void initCombosForTestPerformance() {
- addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"),
- new ActiveMQTopic("TEST")});
+ addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"), new ActiveMQTopic("TEST")});
addCombinationValues("PRODUCER_COUNT", new Object[] {new Integer("1"), new Integer("10")});
addCombinationValues("CONSUMER_COUNT", new Object[] {new Integer("1"), new Integer("10")});
addCombinationValues("CONSUMER_COUNT", new Object[] {new Integer("1"), new Integer("10")});
@@ -64,13 +63,12 @@ public class BrokerBenchmark extends BrokerTestSupport {
public void testPerformance() throws Exception {
- log.info("Running Benchmark for destination=" + destination + ", producers=" + PRODUCER_COUNT
- + ", consumers=" + CONSUMER_COUNT + ", deliveryMode=" + deliveryMode);
+ log.info("Running Benchmark for destination=" + destination + ", producers=" + PRODUCER_COUNT + ", consumers=" + CONSUMER_COUNT + ", deliveryMode=" + deliveryMode);
final int CONSUME_COUNT = destination.isTopic() ? CONSUMER_COUNT * PRODUCE_COUNT : PRODUCE_COUNT;
- final Semaphore consumersStarted = new Semaphore(1 - (CONSUMER_COUNT));
- final Semaphore producersFinished = new Semaphore(1 - (PRODUCER_COUNT));
- final Semaphore consumersFinished = new Semaphore(1 - (CONSUMER_COUNT));
+ final Semaphore consumersStarted = new Semaphore(1 - CONSUMER_COUNT);
+ final Semaphore producersFinished = new Semaphore(1 - PRODUCER_COUNT);
+ final Semaphore consumersFinished = new Semaphore(1 - CONSUMER_COUNT);
final ProgressPrinter printer = new ProgressPrinter(PRODUCE_COUNT + CONSUME_COUNT, 10);
// Start a producer and consumer
@@ -121,8 +119,7 @@ public class BrokerBenchmark extends BrokerTestSupport {
}
if (msg != null) {
- connection.send(createAck(consumerInfo, msg, counter,
- MessageAck.STANDARD_ACK_TYPE));
+ connection.send(createAck(consumerInfo, msg, counter, MessageAck.STANDARD_ACK_TYPE));
} else if (receiveCounter.get() < CONSUME_COUNT) {
log.info("Consumer stall, waiting for message #" + receiveCounter.get() + 1);
}
@@ -179,8 +176,7 @@ public class BrokerBenchmark extends BrokerTestSupport {
consumersFinished.acquire();
long end2 = System.currentTimeMillis();
- log.info("Results for destination=" + destination + ", producers=" + PRODUCER_COUNT + ", consumers="
- + CONSUMER_COUNT + ", deliveryMode=" + deliveryMode);
+ log.info("Results for destination=" + destination + ", producers=" + PRODUCER_COUNT + ", consumers=" + CONSUMER_COUNT + ", deliveryMode=" + deliveryMode);
log.info("Produced at messages/sec: " + (PRODUCE_COUNT * 1000.0 / (end1 - start)));
log.info("Consumed at messages/sec: " + (CONSUME_COUNT * 1000.0 / (end2 - start)));
profilerPause("Benchmark done. Stop profiler ");
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/BrokerRestartTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/broker/BrokerRestartTestSupport.java
index e78bbd8afb..ed2e8eff68 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/BrokerRestartTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/BrokerRestartTestSupport.java
@@ -16,9 +16,6 @@
*/
package org.apache.activemq.broker;
-import java.io.IOException;
-import java.net.URISyntaxException;
-
import org.apache.activemq.store.PersistenceAdapter;
public class BrokerRestartTestSupport extends BrokerTestSupport {
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java
index e91e3971ec..73348f6d88 100755
--- a/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java
@@ -23,6 +23,7 @@ import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.concurrent.TimeUnit;
import javax.jms.DeliveryMode;
import javax.jms.MessageNotWriteableException;
@@ -55,8 +56,6 @@ import org.apache.activemq.store.PersistenceAdapter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.TimeUnit;
-
public class BrokerTestSupport extends CombinationTestSupport {
protected static final Log LOG = LogFactory.getLog(BrokerTestSupport.class);
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/CreateDestinationsOnStartupViaXBeanTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/CreateDestinationsOnStartupViaXBeanTest.java
index 9b543552de..2531bcfcff 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/CreateDestinationsOnStartupViaXBeanTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/CreateDestinationsOnStartupViaXBeanTest.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.broker;
+import java.net.URI;
+import java.util.Set;
+
import org.apache.activemq.EmbeddedBrokerTestSupport;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.apache.activemq.xbean.XBeanBrokerFactory;
-import java.net.URI;
-import java.util.Set;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/Main.java b/activemq-core/src/test/java/org/apache/activemq/broker/Main.java
index f035dd9948..463efc94cb 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/Main.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/Main.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.broker;
+import javax.jms.Connection;
+import javax.jms.MessageConsumer;
+import javax.jms.Session;
+
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.jmx.ManagementContext;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.demo.DefaultQueueSender;
-import javax.jms.Connection;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-
/**
* A helper class which can be handy for running a broker in your IDE from the
* activemq-core module.
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/QueueSubscriptionTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/QueueSubscriptionTest.java
index e1605b21f2..8a4d76982b 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/QueueSubscriptionTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/QueueSubscriptionTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.activemq.broker;
-import org.apache.activemq.JmsMultipleClientsTestSupport;
import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.JmsMultipleClientsTestSupport;
import org.apache.activemq.command.ActiveMQDestination;
public class QueueSubscriptionTest extends JmsMultipleClientsTestSupport {
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/ReconnectWithJMXEnabledTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/ReconnectWithJMXEnabledTest.java
index ca9ecdfb2a..8284f57334 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/ReconnectWithJMXEnabledTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/ReconnectWithJMXEnabledTest.java
@@ -16,8 +16,6 @@
*/
package org.apache.activemq.broker;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
-
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.Message;
@@ -25,6 +23,8 @@ import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
+import org.apache.activemq.EmbeddedBrokerTestSupport;
+
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/StubBroker.java b/activemq-core/src/test/java/org/apache/activemq/broker/StubBroker.java
index 63448ef45d..88fe04aa16 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/StubBroker.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/StubBroker.java
@@ -17,6 +17,11 @@
package org.apache.activemq.broker;
+import java.net.URI;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+
import org.apache.activemq.broker.region.Destination;
import org.apache.activemq.broker.region.MessageReference;
import org.apache.activemq.broker.region.Subscription;
@@ -39,11 +44,6 @@ import org.apache.activemq.command.SessionInfo;
import org.apache.activemq.command.TransactionId;
import org.apache.activemq.kaha.Store;
-import java.net.URI;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-
public class StubBroker implements Broker {
public LinkedList addConnectionData = new LinkedList();
public LinkedList removeConnectionData = new LinkedList();
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/StubConnection.java b/activemq-core/src/test/java/org/apache/activemq/broker/StubConnection.java
index a2a1df0b79..a3d7df2dda 100755
--- a/activemq-core/src/test/java/org/apache/activemq/broker/StubConnection.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/StubConnection.java
@@ -17,6 +17,8 @@
package org.apache.activemq.broker;
import java.io.IOException;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
import org.apache.activemq.Service;
import org.apache.activemq.command.Command;
@@ -30,9 +32,6 @@ import org.apache.activemq.transport.TransportFactory;
import org.apache.activemq.util.JMSExceptionSupport;
import org.apache.activemq.util.ServiceSupport;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
public class StubConnection implements Service {
private final BlockingQueue dispatchQueue = new LinkedBlockingQueue();
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
index 54cf81b989..a0a614b446 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
@@ -16,9 +16,8 @@
*/
package org.apache.activemq.broker.jmx;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.region.Topic;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
import javax.jms.Connection;
import javax.jms.Message;
@@ -31,10 +30,9 @@ import javax.management.ObjectName;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.TabularData;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
import junit.textui.TestRunner;
+import org.apache.activemq.EmbeddedBrokerTestSupport;
+import org.apache.activemq.broker.BrokerService;
/**
* A test case of the various MBeans in ActiveMQ. If you want to look at the
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java
index 24caf311c3..703b048c7d 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java
@@ -16,9 +16,6 @@
*/
package org.apache.activemq.broker.jmx;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
-import org.apache.activemq.broker.BrokerService;
-
import javax.jms.Connection;
import javax.jms.Message;
import javax.jms.MessageProducer;
@@ -29,10 +26,12 @@ import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import junit.textui.TestRunner;
+import org.apache.activemq.EmbeddedBrokerTestSupport;
+import org.apache.activemq.broker.BrokerService;
/**
* A specific test of Queue.purge() functionality
- *
+ *
* @version $Revision$
*/
public class PurgeTest extends EmbeddedBrokerTestSupport {
@@ -65,7 +64,7 @@ public class PurgeTest extends EmbeddedBrokerTestSupport {
// Now get the QueueViewMBean and purge
ObjectName queueViewMBeanName = assertRegisteredObjectName(domain + ":Type=Queue,Destination=" + getDestinationString() + ",BrokerName=localhost");
- QueueViewMBean proxy = (QueueViewMBean) MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
+ QueueViewMBean proxy = (QueueViewMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
long count = proxy.getQueueSize();
assertEquals("Queue size", count, messageCount);
@@ -94,8 +93,7 @@ public class PurgeTest extends EmbeddedBrokerTestSupport {
ObjectName objectName = new ObjectName(name);
if (mbeanServer.isRegistered(objectName)) {
echo("Bean Registered: " + objectName);
- }
- else {
+ } else {
fail("Could not find MBean!: " + objectName);
}
return objectName;
@@ -121,7 +119,7 @@ public class PurgeTest extends EmbeddedBrokerTestSupport {
answer.setUseJmx(true);
answer.setEnableStatistics(true);
answer.setPersistent(false);
- answer.addConnector(bindAddress);
+ answer.addConnector(bindAddress);
return answer;
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTest.java
index d63e7c6c4a..d88c2d2eee 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTest.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.broker.policy;
+import javax.jms.Destination;
+import javax.jms.Message;
+
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.RedeliveryPolicy;
import org.apache.activemq.command.ActiveMQQueue;
-import javax.jms.Destination;
-import javax.jms.Message;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTestSupport.java
index bb472ca9a7..f47450cc45 100755
--- a/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTestSupport.java
@@ -16,9 +16,6 @@
*/
package org.apache.activemq.broker.policy;
-import org.apache.activemq.TestSupport;
-import org.apache.activemq.broker.BrokerService;
-
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
@@ -30,6 +27,9 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
+import org.apache.activemq.TestSupport;
+import org.apache.activemq.broker.BrokerService;
+
/**
* @version $Revision$
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/policy/IndividualDeadLetterTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/policy/IndividualDeadLetterTest.java
index f84bddfdd3..c9fa9db469 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/policy/IndividualDeadLetterTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/policy/IndividualDeadLetterTest.java
@@ -16,21 +16,19 @@
*/
package org.apache.activemq.broker.policy;
+import javax.jms.Destination;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.region.policy.IndividualDeadLetterStrategy;
import org.apache.activemq.broker.region.policy.PolicyEntry;
import org.apache.activemq.broker.region.policy.PolicyMap;
import org.apache.activemq.command.ActiveMQQueue;
-import javax.jms.Destination;
-
/**
- *
* @version $Revision$
*/
public class IndividualDeadLetterTest extends DeadLetterTest {
-
protected BrokerService createBroker() throws Exception {
BrokerService broker = super.createBroker();
@@ -46,7 +44,7 @@ public class IndividualDeadLetterTest extends DeadLetterTest {
}
protected Destination createDlqDestination() {
- String prefix = (topic) ? "ActiveMQ.DLQ.Topic.": "ActiveMQ.DLQ.Queue.";
+ String prefix = topic ? "ActiveMQ.DLQ.Topic." : "ActiveMQ.DLQ.Queue.";
return new ActiveMQQueue(prefix + getClass().getName() + "." + getName());
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/policy/IndividualDeadLetterViaXmlTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/policy/IndividualDeadLetterViaXmlTest.java
index 21bafc50f8..ca52abc2ad 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/policy/IndividualDeadLetterViaXmlTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/policy/IndividualDeadLetterViaXmlTest.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.broker.policy;
+import javax.jms.Destination;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.xbean.BrokerFactoryBean;
import org.springframework.core.io.ClassPathResource;
-import javax.jms.Destination;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/policy/NoConsumerDeadLetterTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/policy/NoConsumerDeadLetterTest.java
index 3054695960..b27e03c796 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/policy/NoConsumerDeadLetterTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/policy/NoConsumerDeadLetterTest.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.broker.policy;
+import javax.jms.Destination;
+import javax.jms.Message;
+
import org.apache.activemq.advisory.AdvisorySupport;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.region.policy.PolicyEntry;
import org.apache.activemq.broker.region.policy.PolicyMap;
import org.apache.activemq.command.ActiveMQDestination;
-import javax.jms.Destination;
-import javax.jms.Message;
-
/**
* @version $Revision$
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/policy/RoundRobinDispatchPolicyTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/policy/RoundRobinDispatchPolicyTest.java
index c15cc24d4e..e966f7496f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/policy/RoundRobinDispatchPolicyTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/policy/RoundRobinDispatchPolicyTest.java
@@ -16,17 +16,17 @@
*/
package org.apache.activemq.broker.policy;
-import org.apache.activemq.broker.QueueSubscriptionTest;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.region.policy.PolicyEntry;
-import org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy;
-import org.apache.activemq.broker.region.policy.PolicyMap;
-
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.MessageConsumer;
import javax.jms.Session;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.QueueSubscriptionTest;
+import org.apache.activemq.broker.region.policy.PolicyEntry;
+import org.apache.activemq.broker.region.policy.PolicyMap;
+import org.apache.activemq.broker.region.policy.RoundRobinDispatchPolicy;
+
public class RoundRobinDispatchPolicyTest extends QueueSubscriptionTest {
protected BrokerService createBroker() throws Exception {
@@ -47,7 +47,8 @@ public class RoundRobinDispatchPolicyTest extends QueueSubscriptionTest {
super.testOneProducerTwoConsumersSmallMessagesOnePrefetch();
// Ensure that each consumer should have received at least one message
- // We cannot guarantee that messages will be equally divided, since prefetch is one
+ // We cannot guarantee that messages will be equally divided, since
+ // prefetch is one
assertEachConsumerReceivedAtLeastXMessages(1);
}
@@ -60,7 +61,8 @@ public class RoundRobinDispatchPolicyTest extends QueueSubscriptionTest {
super.testOneProducerTwoConsumersLargeMessagesOnePrefetch();
// Ensure that each consumer should have received at least one message
- // We cannot guarantee that messages will be equally divided, since prefetch is one
+ // We cannot guarantee that messages will be equally divided, since
+ // prefetch is one
assertEachConsumerReceivedAtLeastXMessages(1);
}
@@ -72,7 +74,8 @@ public class RoundRobinDispatchPolicyTest extends QueueSubscriptionTest {
public void testOneProducerManyConsumersFewMessages() throws Exception {
super.testOneProducerManyConsumersFewMessages();
- // Since there are more consumers, each consumer should have received at most one message only
+ // Since there are more consumers, each consumer should have received at
+ // most one message only
assertMessagesDividedAmongConsumers();
}
@@ -85,23 +88,23 @@ public class RoundRobinDispatchPolicyTest extends QueueSubscriptionTest {
super.testManyProducersManyConsumers();
assertMessagesDividedAmongConsumers();
}
-
+
public void testOneProducerTwoMatchingConsumersOneNotMatchingConsumer() throws Exception {
- // Create consumer that won't consume any message
+ // Create consumer that won't consume any message
createMessageConsumer(createConnectionFactory().createConnection(), createDestination(), "JMSPriority<1");
super.testOneProducerTwoConsumersSmallMessagesLargePrefetch();
assertMessagesDividedAmongConsumers();
}
-
+
protected MessageConsumer createMessageConsumer(Connection conn, Destination dest, String selector) throws Exception {
connections.add(conn);
-
+
Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
- final MessageConsumer consumer = sess.createConsumer(dest, selector);
- conn.start();
-
- return consumer;
- }
+ final MessageConsumer consumer = sess.createConsumer(dest, selector);
+ conn.start();
+
+ return consumer;
+ }
public void assertMessagesDividedAmongConsumers() {
assertEachConsumerReceivedAtLeastXMessages((messageCount * producerCount) / consumerCount);
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/policy/SimpleDispatchPolicyTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/policy/SimpleDispatchPolicyTest.java
index 9372a3c842..296d3b878d 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/policy/SimpleDispatchPolicyTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/policy/SimpleDispatchPolicyTest.java
@@ -16,17 +16,16 @@
*/
package org.apache.activemq.broker.policy;
-import org.apache.activemq.broker.QueueSubscriptionTest;
+import java.util.Iterator;
+
import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.QueueSubscriptionTest;
import org.apache.activemq.broker.region.policy.FixedCountSubscriptionRecoveryPolicy;
import org.apache.activemq.broker.region.policy.PolicyEntry;
import org.apache.activemq.broker.region.policy.PolicyMap;
import org.apache.activemq.broker.region.policy.SimpleDispatchPolicy;
import org.apache.activemq.util.MessageIdList;
-import java.util.Iterator;
-import java.util.List;
-
public class SimpleDispatchPolicyTest extends QueueSubscriptionTest {
protected BrokerService createBroker() throws Exception {
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorQueueStoreTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorQueueStoreTest.java
index d2bae08f49..ef243b1515 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorQueueStoreTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorQueueStoreTest.java
@@ -20,10 +20,10 @@ import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.Session;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.region.policy.PolicyEntry;
import org.apache.activemq.broker.region.policy.PolicyMap;
-import org.apache.activemq.broker.region.policy.StorePendingDurableSubscriberMessageStoragePolicy;
import org.apache.activemq.broker.region.policy.StorePendingQueueMessageStoragePolicy;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/region/group/MessageGroupMapTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/region/group/MessageGroupMapTest.java
index 627b598088..0e8fc288aa 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/region/group/MessageGroupMapTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/region/group/MessageGroupMapTest.java
@@ -16,12 +16,11 @@
*/
package org.apache.activemq.broker.region.group;
+import junit.framework.TestCase;
import org.apache.activemq.command.ConnectionId;
import org.apache.activemq.command.ConsumerId;
import org.apache.activemq.command.SessionId;
-import junit.framework.TestCase;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/util/LoggingBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/util/LoggingBrokerTest.java
index 8b98ddf017..81876d38ba 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/util/LoggingBrokerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/util/LoggingBrokerTest.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.broker.util;
+import java.net.URI;
+
import org.apache.activemq.broker.BrokerFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.test.JmsTopicSendReceiveTest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.net.URI;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeQueueTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeQueueTest.java
index 13e2331032..7150ccb344 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeQueueTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeQueueTest.java
@@ -16,6 +16,16 @@
*/
package org.apache.activemq.broker.virtual;
+import java.net.URI;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
import org.apache.activemq.EmbeddedBrokerTestSupport;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.command.ActiveMQQueue;
@@ -25,16 +35,6 @@ import org.apache.activemq.xbean.XBeanBrokerFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.JMSException;
-
-import java.net.URI;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeTopicTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeTopicTest.java
index 61193c403f..8927a1fcba 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeTopicTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeTopicTest.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.broker.virtual;
+import javax.jms.Destination;
+
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
-import javax.jms.Destination;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java
index f39234aca0..7829ff00c6 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java
@@ -16,16 +16,16 @@
*/
package org.apache.activemq.broker.virtual;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
-import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.command.ActiveMQTopic;
-import org.apache.activemq.spring.ConsumerBean;
-
import javax.jms.Connection;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
+import org.apache.activemq.EmbeddedBrokerTestSupport;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.spring.ConsumerBean;
+
/**
*
* @version $Revision: $
diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubUsingXBeanTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubUsingXBeanTest.java
index 3eacc2a25b..310e8ea80f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubUsingXBeanTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubUsingXBeanTest.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.broker.virtual;
+import java.net.URI;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.xbean.XBeanBrokerFactory;
-import java.net.URI;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/bugs/CraigsBugTest.java b/activemq-core/src/test/java/org/apache/activemq/bugs/CraigsBugTest.java
index 89538fce61..20e5d78a76 100644
--- a/activemq-core/src/test/java/org/apache/activemq/bugs/CraigsBugTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/bugs/CraigsBugTest.java
@@ -16,22 +16,21 @@
*/
package org.apache.activemq.bugs;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
-import org.apache.activemq.command.ActiveMQQueue;
-
import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.Session;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.EmbeddedBrokerTestSupport;
+import org.apache.activemq.command.ActiveMQQueue;
+
/**
- *
* @version $Revision: $
*/
public class CraigsBugTest extends EmbeddedBrokerTestSupport {
-
+
public void testConnectionFactory() throws Exception {
final ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
final ActiveMQQueue queue = new ActiveMQQueue("testqueue");
@@ -43,8 +42,7 @@ public class CraigsBugTest extends EmbeddedBrokerTestSupport {
Session session = conn.createSession(false, 1);
MessageConsumer consumer = session.createConsumer(queue, null);
Message msg = consumer.receive(1000);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
e.printStackTrace();
}
}
@@ -56,8 +54,7 @@ public class CraigsBugTest extends EmbeddedBrokerTestSupport {
synchronized (this) {
wait(3000);
}
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
e.printStackTrace();
}
}
@@ -66,6 +63,5 @@ public class CraigsBugTest extends EmbeddedBrokerTestSupport {
bindAddress = "tcp://localhost:61616";
super.setUp();
}
-
-
+
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/bugs/JmsDurableTopicSlowReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/bugs/JmsDurableTopicSlowReceiveTest.java
index a6623e42a3..7703b9b58c 100755
--- a/activemq-core/src/test/java/org/apache/activemq/bugs/JmsDurableTopicSlowReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/bugs/JmsDurableTopicSlowReceiveTest.java
@@ -14,8 +14,8 @@
package org.apache.activemq.bugs;
-import java.io.File;
import java.util.Properties;
+
import javax.jms.BytesMessage;
import javax.jms.Connection;
import javax.jms.Destination;
@@ -25,10 +25,9 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
+
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.store.jdbc.JDBCPersistenceAdapter;
-import org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter;
import org.apache.activemq.test.JmsTopicSendReceiveTest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/activemq-core/src/test/java/org/apache/activemq/bugs/SlowConsumerTest.java b/activemq-core/src/test/java/org/apache/activemq/bugs/SlowConsumerTest.java
index d27a7fb697..710253612e 100644
--- a/activemq-core/src/test/java/org/apache/activemq/bugs/SlowConsumerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/bugs/SlowConsumerTest.java
@@ -30,7 +30,6 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import junit.framework.TestCase;
-
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.command.ActiveMQQueue;
@@ -75,8 +74,7 @@ public class SlowConsumerTest extends TestCase {
}
producer.close();
session.close();
- }
- catch (Throwable ex) {
+ } catch (Throwable ex) {
ex.printStackTrace();
}
}
@@ -93,12 +91,12 @@ public class SlowConsumerTest extends TestCase {
MessageConsumer consumer = session.createConsumer(new ActiveMQQueue(getDestinationName()));
int diff = 0;
while (messagesCount != MESSAGES_COUNT) {
- Message msg = consumer.receive(messageReceiveTimeout );
+ Message msg = consumer.receive(messageReceiveTimeout);
if (msg == null) {
log.warn("Got null message at count: " + messagesCount + ". Continuing...");
break;
}
- String text = ((TextMessage) msg).getText();
+ String text = ((TextMessage)msg).getText();
int currentMsgIdx = Integer.parseInt(text);
log.debug("Received: " + text + " messageCount: " + messagesCount);
msg.acknowledge();
@@ -110,10 +108,9 @@ public class SlowConsumerTest extends TestCase {
if (messagesCount % messageLogFrequency == 0) {
log.info("Received: " + messagesCount + " messages so far");
}
- //Thread.sleep(70);
+ // Thread.sleep(70);
}
- }
- catch (Throwable ex) {
+ } catch (Throwable ex) {
ex.printStackTrace();
}
}
@@ -135,21 +132,19 @@ public class SlowConsumerTest extends TestCase {
}
public String receiveFrame(long timeOut) throws Exception {
- stompSocket.setSoTimeout((int) timeOut);
+ stompSocket.setSoTimeout((int)timeOut);
InputStream is = stompSocket.getInputStream();
int c = 0;
for (;;) {
c = is.read();
if (c < 0) {
throw new IOException("socket closed.");
- }
- else if (c == 0) {
+ } else if (c == 0) {
c = is.read();
byte[] ba = inputBuffer.toByteArray();
inputBuffer.reset();
return new String(ba, "UTF-8");
- }
- else {
+ } else {
inputBuffer.write(c);
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/camel/CamelJmsTest.java b/activemq-core/src/test/java/org/apache/activemq/camel/CamelJmsTest.java
index a618a83df2..ce2cc8bbce 100644
--- a/activemq-core/src/test/java/org/apache/activemq/camel/CamelJmsTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/camel/CamelJmsTest.java
@@ -16,15 +16,6 @@
*/
package org.apache.activemq.camel;
-import junit.framework.Assert;
-import org.apache.activemq.demo.DefaultQueueSender;
-import org.apache.camel.CamelTemplate;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.spring.SpringTestSupport;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
@@ -35,6 +26,14 @@ import javax.jms.ObjectMessage;
import javax.jms.Session;
import javax.jms.TextMessage;
+import junit.framework.Assert;
+import org.apache.camel.CamelTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spring.SpringTestSupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
/**
* @version $Revision: $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java b/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java
index 2a5c0c3bb4..16979cf9ab 100755
--- a/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java
@@ -64,7 +64,7 @@ public class ActiveMQBytesMessageTest extends TestCase {
int len = 10;
try {
for (int i = 0; i < len; i++) {
- msg.writeLong(5l);
+ msg.writeLong(5L);
}
} catch (JMSException ex) {
ex.printStackTrace();
@@ -243,7 +243,7 @@ public class ActiveMQBytesMessageTest extends TestCase {
msg.writeObject(Byte.valueOf((byte) 1));
msg.writeObject(Short.valueOf((short) 3));
msg.writeObject(Integer.valueOf(3));
- msg.writeObject(Long.valueOf(300l));
+ msg.writeObject(Long.valueOf(300L));
msg.writeObject(new Float(3.3f));
msg.writeObject(new Double(3.3));
msg.writeObject(new byte[3]);
diff --git a/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java b/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java
index cb82b9062b..2547bd11ea 100755
--- a/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java
@@ -355,7 +355,7 @@ public class ActiveMQStreamMessageTest extends TestCase {
public void testReadLong() {
ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
try {
- long test = 4l;
+ long test = 4L;
msg.writeLong(test);
msg.reset();
assertTrue(msg.readLong() == test);
@@ -555,7 +555,7 @@ public class ActiveMQStreamMessageTest extends TestCase {
msg.reset();
assertTrue(msg.readInt() == testInt);
msg.clearBody();
- long testLong = 6l;
+ long testLong = 6L;
msg.writeString(new Long(testLong).toString());
msg.reset();
assertTrue(msg.readLong() == testLong);
@@ -699,7 +699,7 @@ public class ActiveMQStreamMessageTest extends TestCase {
assertTrue(((Integer)msg.readObject()).intValue() == testInt);
msg.clearBody();
- long testLong = 6l;
+ long testLong = 6L;
msg.writeLong(testLong);
msg.reset();
assertTrue(((Long)msg.readObject()).longValue() == testLong);
diff --git a/activemq-core/src/test/java/org/apache/activemq/command/DataStructureTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/command/DataStructureTestSupport.java
index 4483492ff4..d19ec5aad9 100755
--- a/activemq-core/src/test/java/org/apache/activemq/command/DataStructureTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/command/DataStructureTestSupport.java
@@ -23,7 +23,6 @@ import java.util.Arrays;
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
-
import org.apache.activemq.CombinationTestSupport;
import org.apache.activemq.openwire.OpenWireFormat;
import org.apache.activemq.util.ByteSequence;
@@ -72,33 +71,32 @@ public abstract class DataStructureTestSupport extends CombinationTestSupport {
if (componentType.isPrimitive()) {
boolean ok = false;
if (componentType == byte.class) {
- ok = Arrays.equals((byte[]) expect, (byte[]) was);
+ ok = Arrays.equals((byte[])expect, (byte[])was);
}
if (componentType == char.class) {
- ok = Arrays.equals((char[]) expect, (char[]) was);
+ ok = Arrays.equals((char[])expect, (char[])was);
}
if (componentType == short.class) {
- ok = Arrays.equals((short[]) expect, (short[]) was);
+ ok = Arrays.equals((short[])expect, (short[])was);
}
if (componentType == int.class) {
- ok = Arrays.equals((int[]) expect, (int[]) was);
+ ok = Arrays.equals((int[])expect, (int[])was);
}
if (componentType == long.class) {
- ok = Arrays.equals((long[]) expect, (long[]) was);
+ ok = Arrays.equals((long[])expect, (long[])was);
}
if (componentType == double.class) {
- ok = Arrays.equals((double[]) expect, (double[]) was);
+ ok = Arrays.equals((double[])expect, (double[])was);
}
if (componentType == float.class) {
- ok = Arrays.equals((float[]) expect, (float[]) was);
+ ok = Arrays.equals((float[])expect, (float[])was);
}
if (!ok) {
throw new AssertionFailedError("Arrays not equal");
}
- }
- else {
- Object expectArray[] = (Object[]) expect;
- Object wasArray[] = (Object[]) was;
+ } else {
+ Object expectArray[] = (Object[])expect;
+ Object wasArray[] = (Object[])was;
if (expectArray.length != wasArray.length)
throw new AssertionFailedError("Not equals, array lengths don't match. expected: " + expectArray.length + ", was: " + wasArray.length);
for (int i = 0; i < wasArray.length; i++) {
@@ -106,41 +104,33 @@ public abstract class DataStructureTestSupport extends CombinationTestSupport {
}
}
- }
- else if (expect instanceof Command) {
+ } else if (expect instanceof Command) {
assertEquals(expect.getClass(), was.getClass());
Method[] methods = expect.getClass().getMethods();
for (int i = 0; i < methods.length; i++) {
Method method = methods[i];
- if ((method.getName().startsWith("get") || method.getName().startsWith("is")) && method.getParameterTypes().length == 0
- && method.getReturnType() != null) {
+ if ((method.getName().startsWith("get") || method.getName().startsWith("is")) && method.getParameterTypes().length == 0 && method.getReturnType() != null) {
// Check to see if there is a setter for the method.
try {
if (method.getName().startsWith("get")) {
- expect.getClass().getMethod(method.getName().replaceFirst("get", "set"), new Class[] { method.getReturnType() });
+ expect.getClass().getMethod(method.getName().replaceFirst("get", "set"), new Class[] {method.getReturnType()});
+ } else {
+ expect.getClass().getMethod(method.getName().replaceFirst("is", "set"), new Class[] {method.getReturnType()});
}
- else {
- expect.getClass().getMethod(method.getName().replaceFirst("is", "set"), new Class[] { method.getReturnType() });
- }
- }
- catch (Throwable ignore) {
+ } catch (Throwable ignore) {
continue;
}
try {
assertEquals(method.invoke(expect, null), method.invoke(was, null));
- }
- catch (IllegalArgumentException e) {
- }
- catch (IllegalAccessException e) {
- }
- catch (InvocationTargetException e) {
+ } catch (IllegalArgumentException e) {
+ } catch (IllegalAccessException e) {
+ } catch (InvocationTargetException e) {
}
}
}
- }
- else {
+ } else {
TestCase.assertEquals(expect, was);
}
}
@@ -149,7 +139,7 @@ public abstract class DataStructureTestSupport extends CombinationTestSupport {
wireFormat = createWireFormat();
super.setUp();
}
-
+
protected WireFormat createWireFormat() {
OpenWireFormat answer = new OpenWireFormat();
answer.setCacheEnabled(cacheEnabled);
diff --git a/activemq-core/src/test/java/org/apache/activemq/config/BrokerXmlConfigFromJNDITest.java b/activemq-core/src/test/java/org/apache/activemq/config/BrokerXmlConfigFromJNDITest.java
index ae1f726c6f..a66787bb53 100755
--- a/activemq-core/src/test/java/org/apache/activemq/config/BrokerXmlConfigFromJNDITest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/config/BrokerXmlConfigFromJNDITest.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.config;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest;
-
-import javax.naming.InitialContext;
-import javax.naming.Context;
-
import java.io.File;
import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest;
+
/**
* @version $Revision$
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/config/BrokerXmlConfigTest.java b/activemq-core/src/test/java/org/apache/activemq/config/BrokerXmlConfigTest.java
index 05f5421f8e..a1d438a867 100755
--- a/activemq-core/src/test/java/org/apache/activemq/config/BrokerXmlConfigTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/config/BrokerXmlConfigTest.java
@@ -19,8 +19,6 @@ package org.apache.activemq.config;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest;
-import java.net.URI;
-
/**
* @version $Revision$
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java b/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
index 7552f2bd2a..d4095822be 100755
--- a/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
@@ -181,7 +181,7 @@ public class ConfigTest extends TestCase {
// Check transport connectors list
// System.out.print("Checking transport connectors... ");
List connectors = broker.getTransportConnectors();
- assertTrue("Should have created at least 3 connectors", (connectors.size() >= 3));
+ assertTrue("Should have created at least 3 connectors", connectors.size() >= 3);
assertTrue("1st connector should be TcpTransportServer", ((TransportConnector)connectors.get(0)).getServer() instanceof TcpTransportServer);
assertTrue("2nd connector should be TcpTransportServer", ((TransportConnector)connectors.get(1)).getServer() instanceof TcpTransportServer);
assertTrue("3rd connector should be TcpTransportServer", ((TransportConnector)connectors.get(2)).getServer() instanceof TcpTransportServer);
diff --git a/activemq-core/src/test/java/org/apache/activemq/config/ConfigUsingDestinationOptions.java b/activemq-core/src/test/java/org/apache/activemq/config/ConfigUsingDestinationOptions.java
index 0d3252c5fb..465e1e5f20 100644
--- a/activemq-core/src/test/java/org/apache/activemq/config/ConfigUsingDestinationOptions.java
+++ b/activemq-core/src/test/java/org/apache/activemq/config/ConfigUsingDestinationOptions.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.config;
-import junit.framework.TestCase;
-import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.ActiveMQMessageConsumer;
-
import javax.jms.Connection;
+import javax.jms.InvalidSelectorException;
import javax.jms.JMSException;
import javax.jms.Session;
-import javax.jms.InvalidSelectorException;
+
+import junit.framework.TestCase;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.ActiveMQMessageConsumer;
+import org.apache.activemq.command.ActiveMQQueue;
public class ConfigUsingDestinationOptions extends TestCase {
public void testValidSelectorConfig() throws JMSException {
diff --git a/activemq-core/src/test/java/org/apache/activemq/demo/DefaultQueueSender.java b/activemq-core/src/test/java/org/apache/activemq/demo/DefaultQueueSender.java
index 8649564f51..94693d45ad 100644
--- a/activemq-core/src/test/java/org/apache/activemq/demo/DefaultQueueSender.java
+++ b/activemq-core/src/test/java/org/apache/activemq/demo/DefaultQueueSender.java
@@ -28,12 +28,16 @@ package org.apache.activemq.demo;
// START SNIPPET: demo
-import org.apache.activemq.ActiveMQConnectionFactory;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.QueueSession;
+import javax.jms.Session;
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
+import org.apache.activemq.ActiveMQConnectionFactory;
/**
* A simple queue sender which does not use JNDI
@@ -42,8 +46,7 @@ import javax.naming.NamingException;
*/
public class DefaultQueueSender {
- private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
- .getLog(DefaultQueueSender.class);
+ private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(DefaultQueueSender.class);
public static void main(String[] args) {
@@ -53,7 +56,7 @@ public class DefaultQueueSender {
Connection connection = null;
QueueSession queueSession = null;
- if ((args.length < 1)) {
+ if (args.length < 1) {
printUsage();
System.exit(1);
}
@@ -85,16 +88,13 @@ public class DefaultQueueSender {
Message message = session.createTextMessage(text);
producer.send(message);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
log.info("Exception occurred: " + e.toString());
- }
- finally {
+ } finally {
if (connection != null) {
try {
connection.close();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
}
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/demo/SimpleConsumer.java b/activemq-core/src/test/java/org/apache/activemq/demo/SimpleConsumer.java
index d82b10be9c..73981a8f2c 100755
--- a/activemq-core/src/test/java/org/apache/activemq/demo/SimpleConsumer.java
+++ b/activemq-core/src/test/java/org/apache/activemq/demo/SimpleConsumer.java
@@ -37,15 +37,14 @@ import javax.naming.InitialContext;
import javax.naming.NamingException;
/**
- * A simple polymorphic JMS consumer which can work with Queues or Topics
- * which uses JNDI to lookup the JMS connection factory and destination
- *
+ * A simple polymorphic JMS consumer which can work with Queues or Topics which
+ * uses JNDI to lookup the JMS connection factory and destination
+ *
* @version $Revision: 1.2 $
*/
public class SimpleConsumer {
-
- private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
- .getLog(SimpleConsumer.class);
+
+ private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(SimpleConsumer.class);
/**
* @param args the queue used by the example
@@ -74,10 +73,8 @@ public class SimpleConsumer {
*/
try {
jndiContext = new InitialContext();
- }
- catch (NamingException e) {
- log.info("Could not create JNDI API " +
- "context: " + e.toString());
+ } catch (NamingException e) {
+ log.info("Could not create JNDI API " + "context: " + e.toString());
System.exit(1);
}
@@ -85,25 +82,19 @@ public class SimpleConsumer {
* Look up connection factory and destination.
*/
try {
- connectionFactory = (ConnectionFactory)
- jndiContext.lookup("ConnectionFactory");
- destination = (Destination) jndiContext.lookup(destinationName);
- }
- catch (NamingException e) {
- log.info("JNDI API lookup failed: " +
- e.toString());
+ connectionFactory = (ConnectionFactory)jndiContext.lookup("ConnectionFactory");
+ destination = (Destination)jndiContext.lookup(destinationName);
+ } catch (NamingException e) {
+ log.info("JNDI API lookup failed: " + e.toString());
System.exit(1);
}
/*
- * Create connection.
- * Create session from connection; false means session is
- * not transacted.
- * Create receiver, then start message delivery.
- * Receive all text messages from destination until
- * a non-text message is received indicating end of
- * message stream.
- * Close connection.
+ * Create connection. Create session from connection; false means
+ * session is not transacted. Create receiver, then start message
+ * delivery. Receive all text messages from destination until a non-text
+ * message is received indicating end of message stream. Close
+ * connection.
*/
try {
connection = connectionFactory.createConnection();
@@ -114,24 +105,20 @@ public class SimpleConsumer {
Message m = consumer.receive(1);
if (m != null) {
if (m instanceof TextMessage) {
- TextMessage message = (TextMessage) m;
+ TextMessage message = (TextMessage)m;
log.info("Reading message: " + message.getText());
- }
- else {
+ } else {
break;
}
}
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
log.info("Exception occurred: " + e);
- }
- finally {
+ } finally {
if (connection != null) {
try {
connection.close();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
}
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/demo/SimpleProducer.java b/activemq-core/src/test/java/org/apache/activemq/demo/SimpleProducer.java
index f8f694449a..b3f4dae6a0 100755
--- a/activemq-core/src/test/java/org/apache/activemq/demo/SimpleProducer.java
+++ b/activemq-core/src/test/java/org/apache/activemq/demo/SimpleProducer.java
@@ -40,18 +40,18 @@ import javax.naming.InitialContext;
import javax.naming.NamingException;
/**
- * A simple polymorphic JMS producer which can work with Queues or Topics
- * which uses JNDI to lookup the JMS connection factory and destination
- *
+ * A simple polymorphic JMS producer which can work with Queues or Topics which
+ * uses JNDI to lookup the JMS connection factory and destination
+ *
* @version $Revision: 1.2 $
*/
public class SimpleProducer {
-
- private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
- .getLog(SimpleProducer.class);
+
+ private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(SimpleProducer.class);
/**
- * @param args the destination name to send to and optionally, the number of messages to send
+ * @param args the destination name to send to and optionally, the number of
+ * messages to send
*/
public static void main(String[] args) {
Context jndiContext = null;
@@ -71,8 +71,7 @@ public class SimpleProducer {
log.info("Destination name is " + destinationName);
if (args.length == 2) {
NUM_MSGS = (new Integer(args[1])).intValue();
- }
- else {
+ } else {
NUM_MSGS = 1;
}
@@ -81,8 +80,7 @@ public class SimpleProducer {
*/
try {
jndiContext = new InitialContext();
- }
- catch (NamingException e) {
+ } catch (NamingException e) {
log.info("Could not create JNDI API context: " + e.toString());
System.exit(1);
}
@@ -91,20 +89,17 @@ public class SimpleProducer {
* Look up connection factory and destination.
*/
try {
- connectionFactory = (ConnectionFactory) jndiContext.lookup("ConnectionFactory");
- destination = (Destination) jndiContext.lookup(destinationName);
- }
- catch (NamingException e) {
+ connectionFactory = (ConnectionFactory)jndiContext.lookup("ConnectionFactory");
+ destination = (Destination)jndiContext.lookup(destinationName);
+ } catch (NamingException e) {
log.info("JNDI API lookup failed: " + e);
System.exit(1);
}
/*
- * Create connection.
- * Create session from connection; false means session is not transacted.
- * Create sender and text message.
- * Send messages, varying text slightly.
- * Send end-of-messages message.
+ * Create connection. Create session from connection; false means
+ * session is not transacted. Create sender and text message. Send
+ * messages, varying text slightly. Send end-of-messages message.
* Finally, close connection.
*/
try {
@@ -122,16 +117,13 @@ public class SimpleProducer {
* Send a non-text control message indicating end of messages.
*/
producer.send(session.createMessage());
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
log.info("Exception occurred: " + e);
- }
- finally {
+ } finally {
if (connection != null) {
try {
connection.close();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
}
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/demo/SimpleQueueReceiver.java b/activemq-core/src/test/java/org/apache/activemq/demo/SimpleQueueReceiver.java
index fb74f6b87d..75526fcd31 100755
--- a/activemq-core/src/test/java/org/apache/activemq/demo/SimpleQueueReceiver.java
+++ b/activemq-core/src/test/java/org/apache/activemq/demo/SimpleQueueReceiver.java
@@ -38,13 +38,12 @@ import javax.naming.InitialContext;
import javax.naming.NamingException;
public class SimpleQueueReceiver {
-
- private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
- .getLog(SimpleQueueReceiver.class);
+
+ private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(SimpleQueueReceiver.class);
/**
* Main method.
- *
+ *
* @param args the queue used by the example
*/
public static void main(String[] args) {
@@ -61,83 +60,63 @@ public class SimpleQueueReceiver {
* Read queue name from command line and display it.
*/
if (args.length != 1) {
- log.info("Usage: java " +
- "SimpleQueueReceiver ");
+ log.info("Usage: java " + "SimpleQueueReceiver ");
System.exit(1);
}
queueName = args[0];
log.info("Queue name is " + queueName);
/*
- * Create a JNDI API InitialContext object if none exists
- * yet.
+ * Create a JNDI API InitialContext object if none exists yet.
*/
try {
jndiContext = new InitialContext();
- }
- catch (NamingException e) {
- log.info("Could not create JNDI API " +
- "context: " + e.toString());
+ } catch (NamingException e) {
+ log.info("Could not create JNDI API " + "context: " + e.toString());
System.exit(1);
}
/*
- * Look up connection factory and queue. If either does
- * not exist, exit.
+ * Look up connection factory and queue. If either does not exist, exit.
*/
try {
- queueConnectionFactory = (QueueConnectionFactory)
- jndiContext.lookup("QueueConnectionFactory");
- queue = (Queue) jndiContext.lookup(queueName);
- }
- catch (NamingException e) {
- log.info("JNDI API lookup failed: " +
- e.toString());
+ queueConnectionFactory = (QueueConnectionFactory)jndiContext.lookup("QueueConnectionFactory");
+ queue = (Queue)jndiContext.lookup(queueName);
+ } catch (NamingException e) {
+ log.info("JNDI API lookup failed: " + e.toString());
System.exit(1);
}
/*
- * Create connection.
- * Create session from connection; false means session is
- * not transacted.
- * Create receiver, then start message delivery.
- * Receive all text messages from queue until
- * a non-text message is received indicating end of
- * message stream.
- * Close connection.
+ * Create connection. Create session from connection; false means
+ * session is not transacted. Create receiver, then start message
+ * delivery. Receive all text messages from queue until a non-text
+ * message is received indicating end of message stream. Close
+ * connection.
*/
try {
- queueConnection =
- queueConnectionFactory.createQueueConnection();
- queueSession =
- queueConnection.createQueueSession(false,
- Session.AUTO_ACKNOWLEDGE);
+ queueConnection = queueConnectionFactory.createQueueConnection();
+ queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queueReceiver = queueSession.createReceiver(queue);
queueConnection.start();
while (true) {
Message m = queueReceiver.receive(1);
if (m != null) {
if (m instanceof TextMessage) {
- message = (TextMessage) m;
- log.info("Reading message: " +
- message.getText());
- }
- else {
+ message = (TextMessage)m;
+ log.info("Reading message: " + message.getText());
+ } else {
break;
}
}
}
- }
- catch (JMSException e) {
- log.info("Exception occurred: " +
- e.toString());
- }
- finally {
+ } catch (JMSException e) {
+ log.info("Exception occurred: " + e.toString());
+ } finally {
if (queueConnection != null) {
try {
queueConnection.close();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
}
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java b/activemq-core/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java
index 99ae8b7c78..941c8ce530 100755
--- a/activemq-core/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java
+++ b/activemq-core/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java
@@ -28,7 +28,6 @@ package org.apache.activemq.demo;
// START SNIPPET: demo
-
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
@@ -42,15 +41,14 @@ import javax.naming.InitialContext;
import javax.naming.NamingException;
public class SimpleQueueSender {
-
- private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
- .getLog(SimpleQueueSender.class);
+
+ private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(SimpleQueueSender.class);
/**
* Main method.
- *
- * @param args the queue used by the example and,
- * optionally, the number of messages to send
+ *
+ * @param args the queue used by the example and, optionally, the number of
+ * messages to send
*/
public static void main(String[] args) {
String queueName = null;
@@ -64,51 +62,42 @@ public class SimpleQueueSender {
final int NUM_MSGS;
if ((args.length < 1) || (args.length > 2)) {
- log.info("Usage: java SimpleQueueSender " +
- " []");
+ log.info("Usage: java SimpleQueueSender " + " []");
System.exit(1);
}
queueName = args[0];
log.info("Queue name is " + queueName);
if (args.length == 2) {
NUM_MSGS = (new Integer(args[1])).intValue();
- }
- else {
+ } else {
NUM_MSGS = 1;
}
/*
- * Create a JNDI API InitialContext object if none exists
- * yet.
+ * Create a JNDI API InitialContext object if none exists yet.
*/
try {
jndiContext = new InitialContext();
- }
- catch (NamingException e) {
+ } catch (NamingException e) {
log.info("Could not create JNDI API context: " + e.toString());
System.exit(1);
}
/*
- * Look up connection factory and queue. If either does
- * not exist, exit.
+ * Look up connection factory and queue. If either does not exist, exit.
*/
try {
- queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("QueueConnectionFactory");
- queue = (Queue) jndiContext.lookup(queueName);
- }
- catch (NamingException e) {
+ queueConnectionFactory = (QueueConnectionFactory)jndiContext.lookup("QueueConnectionFactory");
+ queue = (Queue)jndiContext.lookup(queueName);
+ } catch (NamingException e) {
log.info("JNDI API lookup failed: " + e);
System.exit(1);
}
/*
- * Create connection.
- * Create session from connection; false means session is
- * not transacted.
- * Create sender and text message.
- * Send messages, varying text slightly.
- * Send end-of-messages message.
+ * Create connection. Create session from connection; false means
+ * session is not transacted. Create sender and text message. Send
+ * messages, varying text slightly. Send end-of-messages message.
* Finally, close connection.
*/
try {
@@ -118,27 +107,21 @@ public class SimpleQueueSender {
message = queueSession.createTextMessage();
for (int i = 0; i < NUM_MSGS; i++) {
message.setText("This is message " + (i + 1));
- log.info("Sending message: " +
- message.getText());
+ log.info("Sending message: " + message.getText());
queueSender.send(message);
}
/*
- * Send a non-text control message indicating end of
- * messages.
+ * Send a non-text control message indicating end of messages.
*/
queueSender.send(queueSession.createMessage());
- }
- catch (JMSException e) {
- log.info("Exception occurred: " +
- e.toString());
- }
- finally {
+ } catch (JMSException e) {
+ log.info("Exception occurred: " + e.toString());
+ } finally {
if (queueConnection != null) {
try {
queueConnection.close();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
}
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/filter/BadDummyPolicyConfigTest.java b/activemq-core/src/test/java/org/apache/activemq/filter/BadDummyPolicyConfigTest.java
index 95e6916bcf..bc126152f2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/filter/BadDummyPolicyConfigTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/filter/BadDummyPolicyConfigTest.java
@@ -16,47 +16,44 @@
*/
package org.apache.activemq.filter;
+import junit.framework.TestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import junit.framework.TestCase;
-
/**
- *
* @version $Revision: 1.1 $
*/
public class BadDummyPolicyConfigTest extends TestCase {
protected static final Log log = LogFactory.getLog(BadDummyPolicyConfigTest.class);
protected DummyPolicy policy = new DummyPolicy();
-
+
public void testNoDestinationSpecified() throws Exception {
DummyPolicyEntry entry = new DummyPolicyEntry();
entry.setDescription("cheese");
-
+
assertFailsToSetEntries(entry);
}
-
+
public void testNoValueSpecified() throws Exception {
DummyPolicyEntry entry = new DummyPolicyEntry();
entry.setTopic("FOO.BAR");
-
+
assertFailsToSetEntries(entry);
}
-
+
public void testValidEntry() throws Exception {
DummyPolicyEntry entry = new DummyPolicyEntry();
entry.setDescription("cheese");
entry.setTopic("FOO.BAR");
-
+
entry.afterPropertiesSet();
}
protected void assertFailsToSetEntries(DummyPolicyEntry entry) throws Exception {
try {
entry.afterPropertiesSet();
- }
- catch (IllegalArgumentException e) {
+ } catch (IllegalArgumentException e) {
log.info("Worked! Caught expected exception: " + e);
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/filter/DestinationMapMemoryTest.java b/activemq-core/src/test/java/org/apache/activemq/filter/DestinationMapMemoryTest.java
index fc141ef239..42edaf43fa 100644
--- a/activemq-core/src/test/java/org/apache/activemq/filter/DestinationMapMemoryTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/filter/DestinationMapMemoryTest.java
@@ -22,7 +22,6 @@ import org.apache.activemq.command.ActiveMQTopic;
public class DestinationMapMemoryTest extends TestCase {
-
public void testLongDestinationPath() throws Exception {
ActiveMQTopic d1 = new ActiveMQTopic("1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18");
DestinationMap map = new DestinationMap();
@@ -36,13 +35,12 @@ public class DestinationMapMemoryTest extends TestCase {
for (int j = 2; j <= i; j++) {
name += "." + j;
}
- //System.out.println("Checking: " + name);
+ // System.out.println("Checking: " + name);
try {
ActiveMQDestination d1 = createDestination(name);
DestinationMap map = new DestinationMap();
map.put(d1, d1);
- }
- catch (Throwable e) {
+ } catch (Throwable e) {
fail("Destination name too long: " + name + " : " + e);
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/filter/DestinationMapTest.java b/activemq-core/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
index 60015b734a..8487173f50 100755
--- a/activemq-core/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
@@ -131,7 +131,7 @@ public class DestinationMapTest extends TestCase {
map.put(d2, v2);
map.put(d3, v3);
- List allValues = Arrays.asList(new Object[] { v1, v2, v3 });
+ List allValues = Arrays.asList(new Object[] {v1, v2, v3});
assertMapValue(">", allValues);
assertMapValue("TEST.>", allValues);
@@ -296,21 +296,20 @@ public class DestinationMapTest extends TestCase {
assertMapValue("TEST.*.*", v3, v5);
assertMapValue("TEST.BAR.*", v3);
}
-
+
public void testAddAndRemove() throws Exception {
-
+
put("FOO.A", v1);
assertMapValue("FOO.>", v1);
-
- put("FOO.B", v2);
- assertMapValue("FOO.>", v1, v2);
-
- Set set = map.removeAll(createDestination("FOO.A"));
-
- assertMapValue("FOO.>", v2);
-
- }
+ put("FOO.B", v2);
+ assertMapValue("FOO.>", v1, v2);
+
+ Set set = map.removeAll(createDestination("FOO.A"));
+
+ assertMapValue("FOO.>", v2);
+
+ }
protected void loadSample2() {
put("TEST.FOO", v1);
@@ -353,34 +352,32 @@ public class DestinationMapTest extends TestCase {
}
protected void assertMapValue(String destinationName, Object expected1, Object expected2) {
- assertMapValue(destinationName, Arrays.asList(new Object[] { expected1, expected2 }));
+ assertMapValue(destinationName, Arrays.asList(new Object[] {expected1, expected2}));
}
protected void assertMapValue(String destinationName, Object expected1, Object expected2, Object expected3) {
- assertMapValue(destinationName, Arrays.asList(new Object[] { expected1, expected2, expected3 }));
+ assertMapValue(destinationName, Arrays.asList(new Object[] {expected1, expected2, expected3}));
}
protected void assertMapValue(String destinationName, Object expected1, Object expected2, Object expected3, Object expected4) {
- assertMapValue(destinationName, Arrays.asList(new Object[] { expected1, expected2, expected3, expected4 }));
+ assertMapValue(destinationName, Arrays.asList(new Object[] {expected1, expected2, expected3, expected4}));
}
protected void assertMapValue(String destinationName, Object expected1, Object expected2, Object expected3, Object expected4, Object expected5) {
- assertMapValue(destinationName, Arrays.asList(new Object[] { expected1, expected2, expected3, expected4, expected5 }));
+ assertMapValue(destinationName, Arrays.asList(new Object[] {expected1, expected2, expected3, expected4, expected5}));
}
-
+
protected void assertMapValue(String destinationName, Object expected1, Object expected2, Object expected3, Object expected4, Object expected5, Object expected6) {
- assertMapValue(destinationName, Arrays.asList(new Object[] { expected1, expected2, expected3, expected4, expected5, expected6 }));
+ assertMapValue(destinationName, Arrays.asList(new Object[] {expected1, expected2, expected3, expected4, expected5, expected6}));
}
protected void assertMapValue(ActiveMQDestination destination, Object expected) {
List expectedList = null;
if (expected == null) {
expectedList = Collections.EMPTY_LIST;
- }
- else if (expected instanceof List) {
- expectedList = (List) expected;
- }
- else {
+ } else if (expected instanceof List) {
+ expectedList = (List)expected;
+ } else {
expectedList = new ArrayList();
expectedList.add(expected);
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java b/activemq-core/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java
index 20daa822cd..b01730c40f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.filter;
+import java.util.Set;
+
import org.apache.activemq.SpringTestSupport;
import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import java.util.Set;
-
/**
*
* @version $Revision: 1.1 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/jndi/ActiveMQInitialContextFactoryTest.java b/activemq-core/src/test/java/org/apache/activemq/jndi/ActiveMQInitialContextFactoryTest.java
index e2de6ce950..b87c15d097 100755
--- a/activemq-core/src/test/java/org/apache/activemq/jndi/ActiveMQInitialContextFactoryTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/jndi/ActiveMQInitialContextFactoryTest.java
@@ -16,11 +16,12 @@
*/
package org.apache.activemq.jndi;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
-import javax.naming.*;
-
/**
* @version $Revision: 1.4 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/jndi/InitialContextTest.java b/activemq-core/src/test/java/org/apache/activemq/jndi/InitialContextTest.java
index 8dda3d3ff7..8276aa233b 100755
--- a/activemq-core/src/test/java/org/apache/activemq/jndi/InitialContextTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/jndi/InitialContextTest.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.jndi;
-import junit.framework.TestCase;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-
-import javax.naming.InitialContext;
-import javax.naming.Context;
import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import junit.framework.TestCase;
+import org.apache.activemq.ActiveMQConnectionFactory;
+
/**
* @version $Revision: 1.3 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/jndi/ObjectFactoryTest.java b/activemq-core/src/test/java/org/apache/activemq/jndi/ObjectFactoryTest.java
index 40d4ea89ee..c3891448b1 100644
--- a/activemq-core/src/test/java/org/apache/activemq/jndi/ObjectFactoryTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/jndi/ObjectFactoryTest.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.jndi;
+import javax.naming.Reference;
+
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.CombinationTestSupport;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQQueue;
-import javax.naming.Reference;
-
public class ObjectFactoryTest extends CombinationTestSupport {
public void testConnectionFactory() throws Exception {
// Create sample connection factory
diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java
index 98bd03a03d..35a2c9000d 100644
--- a/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java
@@ -100,7 +100,7 @@ public class ListContainerTest extends TestCase {
i.next();
i.remove();
}
- assert (container.isEmpty());
+ assert container.isEmpty();
}
/*
diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/LoadTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/LoadTest.java
index 4adad22c4c..460bf8e93a 100644
--- a/activemq-core/src/test/java/org/apache/activemq/kaha/LoadTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/kaha/LoadTest.java
@@ -17,10 +17,10 @@
package org.apache.activemq.kaha;
import java.io.IOException;
-import java.io.PrintWriter;
+import java.util.concurrent.CountDownLatch;
+
import junit.framework.TestCase;
import org.apache.activemq.kaha.impl.KahaStore;
-import java.util.concurrent.CountDownLatch;
/**
* Store test
diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/Loader.java b/activemq-core/src/test/java/org/apache/activemq/kaha/Loader.java
index 3ed060263b..daa6d9e377 100644
--- a/activemq-core/src/test/java/org/apache/activemq/kaha/Loader.java
+++ b/activemq-core/src/test/java/org/apache/activemq/kaha/Loader.java
@@ -18,12 +18,11 @@ package org.apache.activemq.kaha;
import java.util.Iterator;
import java.util.Set;
+import java.util.concurrent.CountDownLatch;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CountDownLatch;
-
/**
* Store test
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java
index aa044eb83f..72f50f9e89 100644
--- a/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java
@@ -21,8 +21,8 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import junit.framework.TestCase;
@@ -41,7 +41,7 @@ public class MapContainerTest extends TestCase {
test.put(key, value);
store.close();
store = getStore();
- assertTrue(store.getMapContainerIds().isEmpty() == false);
+ assertFalse(store.getMapContainerIds().isEmpty());
test = store.getMapContainer("test", "test");
assertEquals(value, test.get(key));
diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/StoreTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/StoreTest.java
index ce61250d7a..84e32f5cfe 100644
--- a/activemq-core/src/test/java/org/apache/activemq/kaha/StoreTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/kaha/StoreTest.java
@@ -22,10 +22,9 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
-import org.apache.activemq.kaha.impl.StoreLockedExcpetion;
import junit.framework.TestCase;
+import org.apache.activemq.kaha.impl.StoreLockedExcpetion;
/**
* Store test
diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/VolumeTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/VolumeTest.java
index b55b50977c..91f848d717 100644
--- a/activemq-core/src/test/java/org/apache/activemq/kaha/VolumeTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/kaha/VolumeTest.java
@@ -18,9 +18,7 @@ package org.apache.activemq.kaha;
import java.io.IOException;
import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
+
import junit.framework.TestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/activemq-core/src/test/java/org/apache/activemq/kaha/impl/index/tree/TreeTest.java b/activemq-core/src/test/java/org/apache/activemq/kaha/impl/index/tree/TreeTest.java
index 4582336687..e1ef4eff49 100644
--- a/activemq-core/src/test/java/org/apache/activemq/kaha/impl/index/tree/TreeTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/kaha/impl/index/tree/TreeTest.java
@@ -16,11 +16,11 @@ package org.apache.activemq.kaha.impl.index.tree;
import java.io.File;
import java.io.IOException;
+
+import junit.framework.TestCase;
import org.apache.activemq.kaha.Store;
-import org.apache.activemq.kaha.StoreEntry;
import org.apache.activemq.kaha.impl.index.IndexItem;
import org.apache.activemq.kaha.impl.index.IndexManager;
-import junit.framework.TestCase;
/**
* Test a TreeIndex
diff --git a/activemq-core/src/test/java/org/apache/activemq/network/NetworkReconnectTest.java b/activemq-core/src/test/java/org/apache/activemq/network/NetworkReconnectTest.java
index e99dedd127..210bb15877 100644
--- a/activemq-core/src/test/java/org/apache/activemq/network/NetworkReconnectTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/network/NetworkReconnectTest.java
@@ -19,6 +19,7 @@ package org.apache.activemq.network;
import java.net.URI;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.Connection;
import javax.jms.Destination;
@@ -29,7 +30,6 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import junit.framework.TestCase;
-
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.advisory.ConsumerEvent;
import org.apache.activemq.advisory.ConsumerEventSource;
@@ -40,8 +40,6 @@ import org.apache.activemq.command.ActiveMQQueue;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.atomic.AtomicInteger;
-
/**
* These test cases are used to verifiy that network connections get re
* established in all broker restart scenarios.
diff --git a/activemq-core/src/test/java/org/apache/activemq/network/jms/QueueBridgeXBeanTest.java b/activemq-core/src/test/java/org/apache/activemq/network/jms/QueueBridgeXBeanTest.java
index d912f81527..5e2bb37f11 100644
--- a/activemq-core/src/test/java/org/apache/activemq/network/jms/QueueBridgeXBeanTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/network/jms/QueueBridgeXBeanTest.java
@@ -16,12 +16,9 @@
*/
package org.apache.activemq.network.jms;
-import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
-import javax.jms.JMSException;
-
/**
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/BrokerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/BrokerInfoTest.java
index 3d2ac4b8c0..6195567aa7 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/BrokerInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/BrokerInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v1;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerInfo;
/**
* Test case for the OpenWire marshalling for BrokerInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ConnectionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ConnectionInfoTest.java
index a6d152a408..35b35243e2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ConnectionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ConnectionInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v1;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.ConnectionInfo;
/**
* Test case for the OpenWire marshalling for ConnectionInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ConsumerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ConsumerInfoTest.java
index e8a84a9b4b..4621e40581 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ConsumerInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ConsumerInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v1;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.ConsumerInfo;
/**
* Test case for the OpenWire marshalling for ConsumerInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/DataArrayResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/DataArrayResponseTest.java
index acd9568825..3515f67377 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/DataArrayResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/DataArrayResponseTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v1;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataArrayResponse;
+import org.apache.activemq.command.DataStructure;
/**
* Test case for the OpenWire marshalling for DataArrayResponse NOTE!: This file
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/DestinationInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/DestinationInfoTest.java
index 60194e167b..6d8e19e794 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/DestinationInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/DestinationInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v1;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.DestinationInfo;
/**
* Test case for the OpenWire marshalling for DestinationInfo NOTE!: This file
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java
index 35480e224a..02c1da090b 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v1;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.Message;
/**
* Test case for the OpenWire marshalling for Message NOTE!: This file is auto
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerInfoTest.java
index d6d7a02d02..164b3eed9a 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v1;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.ProducerInfo;
/**
* Test case for the OpenWire marshalling for ProducerInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java
index 4caecee175..f0fc809636 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v1;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.WireFormatInfo;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
* Test case for the OpenWire marshalling for WireFormatInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQBytesMessageTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQBytesMessageTest.java
index 5a4c6d67b9..ddef6205aa 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQBytesMessageTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQBytesMessageTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQBytesMessage;
/**
* Test case for the OpenWire marshalling for ActiveMQBytesMessage
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQDestinationTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQDestinationTestSupport.java
index 2b833f6aae..30471a67d2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQDestinationTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQDestinationTestSupport.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
* Test case for the OpenWire marshalling for ActiveMQDestination
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQMapMessageTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQMapMessageTest.java
index be52333fd3..c7d8005f91 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQMapMessageTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQMapMessageTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQMapMessage;
/**
* Test case for the OpenWire marshalling for ActiveMQMapMessage
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQMessageTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQMessageTest.java
index a7d26f1846..193a42ae43 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQMessageTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQMessageTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQMessage;
/**
* Test case for the OpenWire marshalling for ActiveMQMessage
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQObjectMessageTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQObjectMessageTest.java
index 539019f1ff..f5dd0c7fca 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQObjectMessageTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQObjectMessageTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQObjectMessage;
/**
* Test case for the OpenWire marshalling for ActiveMQObjectMessage
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQQueueTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQQueueTest.java
index b4f2cb5af7..d5c9bf7d88 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQQueueTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQQueueTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQQueue;
/**
* Test case for the OpenWire marshalling for ActiveMQQueue
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQStreamMessageTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQStreamMessageTest.java
index 58c06c00de..fce7bbfa2f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQStreamMessageTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ActiveMQStreamMessageTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQStreamMessage;
/**
* Test case for the OpenWire marshalling for ActiveMQStreamMessage
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerIdTest.java
index aa24e260b6..a307e9c1f5 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java
index 6648cb813a..4c611235a5 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerInfo;
/**
* Test case for the OpenWire marshalling for BrokerInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionControlTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionControlTest.java
index f69430d417..c54bfc2546 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionControlTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionControlTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionControl;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionErrorTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionErrorTest.java
index 83a45a2fd2..9f84447a39 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionErrorTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionErrorTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionError;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionIdTest.java
index 28f895d2dc..54470c7f87 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionInfoTest.java
index f9821e8c5c..3bafbdb99f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.ConnectionInfo;
/**
* Test case for the OpenWire marshalling for ConnectionInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerControlTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerControlTest.java
index bb739259b6..c2b009bc06 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerControlTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerControlTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerControl;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerIdTest.java
index ecb31fabf8..00d9da7f75 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerInfoTest.java
index 2a320c9950..05fe1ace2f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.ConsumerInfo;
/**
* Test case for the OpenWire marshalling for ConsumerInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ControlCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ControlCommandTest.java
index ad18969a46..ca51023881 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ControlCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ControlCommandTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ControlCommand;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DataArrayResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DataArrayResponseTest.java
index 24f45eb450..4835e45543 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DataArrayResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DataArrayResponseTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataArrayResponse;
+import org.apache.activemq.command.DataStructure;
/**
* Test case for the OpenWire marshalling for DataArrayResponse NOTE!: This file
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DataResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DataResponseTest.java
index 0150b20c88..bc2f53f252 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DataResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DataResponseTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataResponse;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DestinationInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DestinationInfoTest.java
index d47c232459..d2a186aff2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DestinationInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DestinationInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.DestinationInfo;
/**
* Test case for the OpenWire marshalling for DestinationInfo NOTE!: This file
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DiscoveryEventTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DiscoveryEventTest.java
index 7b75903197..e9938357a1 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DiscoveryEventTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/DiscoveryEventTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DiscoveryEvent;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ExceptionResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ExceptionResponseTest.java
index 5809680d55..1f1cdc62f4 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ExceptionResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ExceptionResponseTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ExceptionResponse;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/FlushCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/FlushCommandTest.java
index 05b8a22322..05d5bf09e9 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/FlushCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/FlushCommandTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.FlushCommand;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/IntegerResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/IntegerResponseTest.java
index 61c23099be..3af7f64c69 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/IntegerResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/IntegerResponseTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.IntegerResponse;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalQueueAckTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalQueueAckTest.java
index d51c255435..aae0a941f2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalQueueAckTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalQueueAckTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.JournalQueueAck;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTopicAckTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTopicAckTest.java
index b4faa46ea5..4ae7fbb0b8 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTopicAckTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTopicAckTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.JournalTopicAck;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTraceTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTraceTest.java
index ba1fe0dd97..042a2e64bf 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTraceTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTraceTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.JournalTrace;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTransactionTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTransactionTest.java
index 0f809653fd..b1fa4aa7a1 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTransactionTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/JournalTransactionTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.JournalTransaction;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/KeepAliveInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/KeepAliveInfoTest.java
index aa6f81f151..fd5f6d275b 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/KeepAliveInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/KeepAliveInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.KeepAliveInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/LastPartialCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/LastPartialCommandTest.java
index 6528425397..d9e6d8d60d 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/LastPartialCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/LastPartialCommandTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.LastPartialCommand;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/LocalTransactionIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/LocalTransactionIdTest.java
index 7c3a21b0f2..fa3d10e6b4 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/LocalTransactionIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/LocalTransactionIdTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.LocalTransactionId;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageAckTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageAckTest.java
index a23a530fe1..baf166f8be 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageAckTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageAckTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessageAck;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageDispatchNotificationTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageDispatchNotificationTest.java
index 97c5d200fc..6709476906 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageDispatchNotificationTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageDispatchNotificationTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessageDispatchNotification;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageDispatchTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageDispatchTest.java
index 5c9d76d7ff..e8a9e44795 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageDispatchTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageDispatchTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessageDispatch;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageIdTest.java
index b1590d81e0..336d7861cc 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessageId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessagePullTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessagePullTest.java
index 5b2b06ed2d..1740ec42bc 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessagePullTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessagePullTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessagePull;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageTestSupport.java
index 27e0b34b3f..631ef3f8ec 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/MessageTestSupport.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.Message;
/**
* Test case for the OpenWire marshalling for Message NOTE!: This file is auto
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/NetworkBridgeFilterTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/NetworkBridgeFilterTest.java
index c829a87d3a..8a420a9225 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/NetworkBridgeFilterTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/NetworkBridgeFilterTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.NetworkBridgeFilter;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/PartialCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/PartialCommandTest.java
index 3a840f3c59..6fd158e717 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/PartialCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/PartialCommandTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.PartialCommand;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerIdTest.java
index 483ebc68da..575759ff74 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ProducerId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerInfoTest.java
index e6984c473a..cd7d45d746 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.ProducerInfo;
/**
* Test case for the OpenWire marshalling for ProducerInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/RemoveInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/RemoveInfoTest.java
index eda9e1d97b..5f41ea2084 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/RemoveInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/RemoveInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.RemoveInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/RemoveSubscriptionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/RemoveSubscriptionInfoTest.java
index 4c7f992f9b..01a2fa6392 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/RemoveSubscriptionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/RemoveSubscriptionInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.RemoveSubscriptionInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ReplayCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ReplayCommandTest.java
index 7355a58c29..47d0f736f3 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ReplayCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ReplayCommandTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ReplayCommand;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ResponseTest.java
index 54e7dead03..b63b3d9aeb 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ResponseTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.Response;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SessionIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SessionIdTest.java
index c9c217f9b4..420f57bb8f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SessionIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SessionIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.SessionId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SessionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SessionInfoTest.java
index 0ecb7f66c9..7e04d22d0f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SessionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SessionInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.SessionInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ShutdownInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ShutdownInfoTest.java
index 0af18ccef6..03e7844694 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ShutdownInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ShutdownInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ShutdownInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SubscriptionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SubscriptionInfoTest.java
index 8b2ec3484f..2678c2999a 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SubscriptionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/SubscriptionInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.SubscriptionInfo;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/TransactionIdTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/TransactionIdTestSupport.java
index cf687775d9..49bef860fe 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/TransactionIdTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/TransactionIdTestSupport.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.TransactionId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/TransactionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/TransactionInfoTest.java
index cd57679248..c41a90ce4d 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/TransactionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/TransactionInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.TransactionInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/WireFormatInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/WireFormatInfoTest.java
index 6b3815ed3b..091acae3bf 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/WireFormatInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/WireFormatInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.WireFormatInfo;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
* Test case for the OpenWire marshalling for WireFormatInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/XATransactionIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/XATransactionIdTest.java
index 813de830e9..53c338e78b 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/XATransactionIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/XATransactionIdTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v2;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.XATransactionId;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerIdTest.java
index f309b0298e..8f3b90ad86 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerInfoTest.java
index 44436eb642..b6a6ea53e9 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/BrokerInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerInfo;
/**
* Test case for the OpenWire marshalling for BrokerInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionControlTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionControlTest.java
index b904e6c5c6..069c3878b9 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionControlTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionControlTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionControl;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionErrorTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionErrorTest.java
index d1331b8671..eb4ccd5703 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionErrorTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionErrorTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionError;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionIdTest.java
index 7280295795..457533adce 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConnectionId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionInfoTest.java
index 87b7e767a8..503c40ac57 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConnectionInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.ConnectionInfo;
/**
* Test case for the OpenWire marshalling for ConnectionInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerControlTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerControlTest.java
index c347273938..2c0004b4df 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerControlTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerControlTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerControl;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerIdTest.java
index 85cb67af41..4e422da1f6 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ConsumerId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerInfoTest.java
index 99481bb72d..e1e27b5282 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ConsumerInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.ConsumerInfo;
/**
* Test case for the OpenWire marshalling for ConsumerInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ControlCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ControlCommandTest.java
index e83ea94478..ac6f9b48f3 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ControlCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ControlCommandTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ControlCommand;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DataArrayResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DataArrayResponseTest.java
index 6d390eab8e..80f54da9ef 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DataArrayResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DataArrayResponseTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataArrayResponse;
+import org.apache.activemq.command.DataStructure;
/**
* Test case for the OpenWire marshalling for DataArrayResponse NOTE!: This file
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DataResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DataResponseTest.java
index 7fe62571d0..686fcf3fff 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DataResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DataResponseTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DataResponse;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DestinationInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DestinationInfoTest.java
index 05c6d29edc..a42167b767 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DestinationInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DestinationInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.DestinationInfo;
/**
* Test case for the OpenWire marshalling for DestinationInfo NOTE!: This file
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DiscoveryEventTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DiscoveryEventTest.java
index 0d092c5207..f34418cdf7 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DiscoveryEventTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/DiscoveryEventTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.DiscoveryEvent;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ExceptionResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ExceptionResponseTest.java
index 90308a40f7..027477d3a5 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ExceptionResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ExceptionResponseTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ExceptionResponse;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/FlushCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/FlushCommandTest.java
index 7f09d6e907..d002c9f271 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/FlushCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/FlushCommandTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.FlushCommand;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/IntegerResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/IntegerResponseTest.java
index 98bb13a262..18cb631fc2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/IntegerResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/IntegerResponseTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.IntegerResponse;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalQueueAckTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalQueueAckTest.java
index 1f4f1ec302..0ba8910a25 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalQueueAckTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalQueueAckTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.JournalQueueAck;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTopicAckTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTopicAckTest.java
index 07c764bf9e..2bff5c413c 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTopicAckTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTopicAckTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.JournalTopicAck;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTraceTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTraceTest.java
index c0e7e1f54a..913904b78e 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTraceTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTraceTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.JournalTrace;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTransactionTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTransactionTest.java
index 535b72a01b..2df3b7afbc 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTransactionTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/JournalTransactionTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.JournalTransaction;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/KeepAliveInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/KeepAliveInfoTest.java
index 61b6709353..c02b70ad56 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/KeepAliveInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/KeepAliveInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.KeepAliveInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/LastPartialCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/LastPartialCommandTest.java
index 066192760d..7a86370e37 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/LastPartialCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/LastPartialCommandTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.LastPartialCommand;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/LocalTransactionIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/LocalTransactionIdTest.java
index 779e14c293..feae9fcb27 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/LocalTransactionIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/LocalTransactionIdTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.LocalTransactionId;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageAckTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageAckTest.java
index e766b13e8e..d652027cca 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageAckTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageAckTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessageAck;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageDispatchNotificationTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageDispatchNotificationTest.java
index af73f8aa38..bced417ae1 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageDispatchNotificationTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageDispatchNotificationTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessageDispatchNotification;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageDispatchTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageDispatchTest.java
index 7d99f1ac54..1814b8bd6c 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageDispatchTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageDispatchTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessageDispatch;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageIdTest.java
index af5d863b5f..a35054e5dd 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessageId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessagePullTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessagePullTest.java
index d9cd640b22..169bc5cc43 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessagePullTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessagePullTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.MessagePull;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageTestSupport.java
index 28565cd9ec..ba5c9d93a8 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/MessageTestSupport.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.Message;
/**
* Test case for the OpenWire marshalling for Message NOTE!: This file is auto
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/NetworkBridgeFilterTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/NetworkBridgeFilterTest.java
index 7071d6e027..b707be3a23 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/NetworkBridgeFilterTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/NetworkBridgeFilterTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.NetworkBridgeFilter;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/PartialCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/PartialCommandTest.java
index 381d087cac..8009f3e9b9 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/PartialCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/PartialCommandTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.PartialCommand;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerAckTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerAckTest.java
index 49a3e09781..830902a9d4 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerAckTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerAckTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ProducerAck;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerIdTest.java
index ebb43a2afe..60115d66b6 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ProducerId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerInfoTest.java
index bd397fb8b7..04859b232a 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ProducerInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.BrokerId;
+import org.apache.activemq.command.ProducerInfo;
/**
* Test case for the OpenWire marshalling for ProducerInfo NOTE!: This file is
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/RemoveInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/RemoveInfoTest.java
index b1cd8affd4..6020b8a264 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/RemoveInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/RemoveInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.RemoveInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/RemoveSubscriptionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/RemoveSubscriptionInfoTest.java
index ce930896d1..f251401a63 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/RemoveSubscriptionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/RemoveSubscriptionInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.RemoveSubscriptionInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ReplayCommandTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ReplayCommandTest.java
index 62a4df9ea7..277b055e0c 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ReplayCommandTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ReplayCommandTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ReplayCommand;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ResponseTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ResponseTest.java
index 9b1e809cf2..3ea384cf2e 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ResponseTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ResponseTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.Response;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SessionIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SessionIdTest.java
index ed7e055d2b..1568d0e6c1 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SessionIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SessionIdTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.SessionId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SessionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SessionInfoTest.java
index 5d64e6e3e7..bbd3f67a25 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SessionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SessionInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.SessionInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ShutdownInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ShutdownInfoTest.java
index 67bbfb413c..4f18479523 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ShutdownInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/ShutdownInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ShutdownInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SubscriptionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SubscriptionInfoTest.java
index 9313287b90..73877c160f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SubscriptionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/SubscriptionInfoTest.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.SubscriptionInfo;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/TransactionIdTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/TransactionIdTestSupport.java
index 181e1b9509..7c3459db8f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/TransactionIdTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/TransactionIdTestSupport.java
@@ -16,12 +16,8 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.TransactionId;
+import org.apache.activemq.openwire.DataFileGeneratorTestSupport;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/TransactionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/TransactionInfoTest.java
index e20bd7e8b0..417f86dda3 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/TransactionInfoTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/TransactionInfoTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.TransactionInfo;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/XATransactionIdTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/XATransactionIdTest.java
index f6485a2e6b..188d29a134 100644
--- a/activemq-core/src/test/java/org/apache/activemq/openwire/v3/XATransactionIdTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v3/XATransactionIdTest.java
@@ -16,12 +16,7 @@
*/
package org.apache.activemq.openwire.v3;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.activemq.openwire.*;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.XATransactionId;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreQueueTest.java b/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreQueueTest.java
index 899a7328d0..234332b4b2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreQueueTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreQueueTest.java
@@ -20,23 +20,23 @@ import java.io.File;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.amq.AMQPersistenceAdapter;
+
/**
* @version $Revision: 1.3 $
*/
-public class AMQStoreQueueTest extends SimpleQueueTest{
-
-
- protected void configureBroker(BrokerService answer) throws Exception{
-
- File dataFileDir = new File("target/test-amq-data/perfTest/amq");
-
+public class AMQStoreQueueTest extends SimpleQueueTest {
+
+ protected void configureBroker(BrokerService answer) throws Exception {
+
+ File dataFileDir = new File("target/test-amq-data/perfTest/amq");
+
AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
adaptor.setDirectory(dataFileDir);
-
+
answer.setPersistenceAdapter(adaptor);
answer.addConnector(bindAddress);
- //answer.setDeleteAllMessagesOnStartup(true);
-
+ // answer.setDeleteAllMessagesOnStartup(true);
+
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java b/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
index 31181f2e0c..70767eb1e5 100644
--- a/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
@@ -18,31 +18,25 @@ package org.apache.activemq.perf;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter;
+
/**
* @version $Revision: 1.3 $
*/
public class KahaDurableTopicTest extends SimpleDurableTopicTest {
-
+
/*
- protected BrokerService createBroker() throws Exception{
- Resource resource=new ClassPathResource( "org/apache/activemq/perf/kahaBroker.xml");
- BrokerFactoryBean factory=new BrokerFactoryBean(resource);
- factory.afterPropertiesSet();
- BrokerService result=factory.getBroker();
- result.start();
- return result;
- }
- */
-
- protected void configureBroker(BrokerService answer) throws Exception{
+ * protected BrokerService createBroker() throws Exception{ Resource
+ * resource=new ClassPathResource(
+ * "org/apache/activemq/perf/kahaBroker.xml"); BrokerFactoryBean factory=new
+ * BrokerFactoryBean(resource); factory.afterPropertiesSet(); BrokerService
+ * result=factory.getBroker(); result.start(); return result; }
+ */
+
+ protected void configureBroker(BrokerService answer) throws Exception {
KahaPersistenceAdapter adaptor = new KahaPersistenceAdapter();
answer.setPersistenceAdapter(adaptor);
answer.addConnector(bindAddress);
answer.setDeleteAllMessagesOnStartup(true);
}
-
-
-
-
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/perf/KahaQueueTest.java b/activemq-core/src/test/java/org/apache/activemq/perf/KahaQueueTest.java
index 432826eec9..aba2ec7807 100644
--- a/activemq-core/src/test/java/org/apache/activemq/perf/KahaQueueTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/perf/KahaQueueTest.java
@@ -18,13 +18,13 @@ package org.apache.activemq.perf;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter;
+
/**
* @version $Revision: 1.3 $
*/
-public class KahaQueueTest extends SimpleQueueTest{
-
-
- protected void configureBroker(BrokerService answer) throws Exception{
+public class KahaQueueTest extends SimpleQueueTest {
+
+ protected void configureBroker(BrokerService answer) throws Exception {
KahaPersistenceAdapter adaptor = new KahaPersistenceAdapter();
answer.setPersistenceAdapter(adaptor);
answer.addConnector(bindAddress);
diff --git a/activemq-core/src/test/java/org/apache/activemq/perf/SlowConsumer.java b/activemq-core/src/test/java/org/apache/activemq/perf/SlowConsumer.java
index 8db7c07854..eb5ea3a44b 100644
--- a/activemq-core/src/test/java/org/apache/activemq/perf/SlowConsumer.java
+++ b/activemq-core/src/test/java/org/apache/activemq/perf/SlowConsumer.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.perf;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* @version $Revision: 1.3 $
*/
@@ -43,8 +43,7 @@ public class SlowConsumer extends PerfConsumer {
log.debug("GOT A MSG " + msg);
try {
Thread.sleep(10000);
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
e.printStackTrace();
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/perf/SlowDurableConsumerTopicTest.java b/activemq-core/src/test/java/org/apache/activemq/perf/SlowDurableConsumerTopicTest.java
index 5824bac9be..2a5bb9a061 100644
--- a/activemq-core/src/test/java/org/apache/activemq/perf/SlowDurableConsumerTopicTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/perf/SlowDurableConsumerTopicTest.java
@@ -15,15 +15,8 @@
package org.apache.activemq.perf;
import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.ActiveMQPrefetchPolicy;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.xbean.BrokerFactoryBean;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
/**
* @version $Revision: 1.3 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/perf/TemporaryTopicMemoryAllocationTest.java b/activemq-core/src/test/java/org/apache/activemq/perf/TemporaryTopicMemoryAllocationTest.java
index f8df6139ad..7c28d8893b 100644
--- a/activemq-core/src/test/java/org/apache/activemq/perf/TemporaryTopicMemoryAllocationTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/perf/TemporaryTopicMemoryAllocationTest.java
@@ -19,16 +19,17 @@ package org.apache.activemq.perf;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Session;
+
/**
* @version $Revision: 1.3 $
*/
-public class TemporaryTopicMemoryAllocationTest extends MemoryAllocationTest{
- public TemporaryTopicMemoryAllocationTest(){
+public class TemporaryTopicMemoryAllocationTest extends MemoryAllocationTest {
+ public TemporaryTopicMemoryAllocationTest() {
super();
// TODO Auto-generated constructor stub
}
- protected Destination getDestination(Session session) throws JMSException{
+ protected Destination getDestination(Session session) throws JMSException {
return session.createTemporaryTopic();
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java b/activemq-core/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java
index 08700445bc..7e5379b446 100644
--- a/activemq-core/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.pool;
-import junit.framework.TestCase;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.command.ActiveMQTopic;
-
import javax.jms.Session;
import javax.jms.TopicConnection;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
+import junit.framework.TestCase;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.command.ActiveMQTopic;
+
/**
* @version $Revision$
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/security/JaasCertificateAuthenticationBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/security/JaasCertificateAuthenticationBrokerTest.java
index 8e772ac2d7..ca4c2625b3 100644
--- a/activemq-core/src/test/java/org/apache/activemq/security/JaasCertificateAuthenticationBrokerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/security/JaasCertificateAuthenticationBrokerTest.java
@@ -17,8 +17,16 @@
package org.apache.activemq.security;
-import junit.framework.TestCase;
+import java.security.Principal;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import javax.security.auth.login.AppConfigurationEntry;
+import javax.security.auth.login.Configuration;
+
+import junit.framework.TestCase;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.broker.StubBroker;
import org.apache.activemq.command.ConnectionInfo;
@@ -26,45 +34,32 @@ import org.apache.activemq.jaas.GroupPrincipal;
import org.apache.activemq.jaas.UserPrincipal;
import org.apache.activemq.transport.tcp.StubX509Certificate;
-import java.io.IOException;
-import java.security.Principal;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.security.auth.Subject;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.login.AppConfigurationEntry;
-import javax.security.auth.login.Configuration;
-import javax.security.auth.login.LoginContext;
-
public class JaasCertificateAuthenticationBrokerTest extends TestCase {
StubBroker receiveBroker;
-
+
JaasCertificateAuthenticationBroker authBroker;
-
+
ConnectionContext connectionContext;
ConnectionInfo connectionInfo;
-
+
protected void setUp() throws Exception {
receiveBroker = new StubBroker();
-
+
authBroker = new JaasCertificateAuthenticationBroker(receiveBroker, "");
-
+
connectionContext = new ConnectionContext();
connectionInfo = new ConnectionInfo();
-
+
connectionInfo.setTransportContext(new StubX509Certificate[] {});
}
protected void tearDown() throws Exception {
super.tearDown();
}
-
+
private void setConfiguration(Set userNames, Set groupNames, boolean loginShouldSucceed) {
HashMap configOptions = new HashMap();
-
+
String userNamesString;
{
Iterator iter = userNames.iterator();
@@ -73,7 +68,7 @@ public class JaasCertificateAuthenticationBrokerTest extends TestCase {
userNamesString += "," + (String)iter.next();
}
}
-
+
String groupNamesString = "";
{
Iterator iter = groupNames.iterator();
@@ -82,58 +77,48 @@ public class JaasCertificateAuthenticationBrokerTest extends TestCase {
groupNamesString += "," + (String)iter.next();
}
}
-
- configOptions.put(StubLoginModule.ALLOW_LOGIN_PROPERTY, (loginShouldSucceed ? "true" : "false"));
+
+ configOptions.put(StubLoginModule.ALLOW_LOGIN_PROPERTY, loginShouldSucceed ? "true" : "false");
configOptions.put(StubLoginModule.USERS_PROPERTY, userNamesString);
configOptions.put(StubLoginModule.GROUPS_PROPERTY, groupNamesString);
- AppConfigurationEntry configEntry = new AppConfigurationEntry(
- "org.apache.activemq.security.StubLoginModule",
- AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
- configOptions);
-
+ AppConfigurationEntry configEntry = new AppConfigurationEntry("org.apache.activemq.security.StubLoginModule", AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
+ configOptions);
+
StubJaasConfiguration jaasConfig = new StubJaasConfiguration(configEntry);
-
+
Configuration.setConfiguration(jaasConfig);
}
-
+
public void testAddConnectionSuccess() {
String dnUserName = "dnUserName";
-
+
HashSet userNames = new HashSet();
userNames.add(dnUserName);
-
+
HashSet groupNames = new HashSet();
groupNames.add("testGroup1");
groupNames.add("testGroup2");
groupNames.add("tesetGroup3");
-
- setConfiguration(
- userNames,
- groupNames,
- true);
-
+
+ setConfiguration(userNames, groupNames, true);
+
try {
authBroker.addConnection(connectionContext, connectionInfo);
} catch (Exception e) {
fail("Call to addConnection failed: " + e.getMessage());
}
-
- assertEquals("Number of addConnection calls to underlying Broker must match number of calls made to " +
- "AuthenticationBroker.",
- 1, receiveBroker.addConnectionData.size());
-
- ConnectionContext receivedContext =
- ((StubBroker.AddConnectionData)receiveBroker.addConnectionData.getFirst()).connectionContext;
-
- assertEquals("The SecurityContext's userName must be set to that of the UserPrincipal.",
- dnUserName, receivedContext.getSecurityContext().getUserName());
-
- Set receivedPrincipals =
- receivedContext.getSecurityContext().getPrincipals();
-
- for (Iterator iter = receivedPrincipals.iterator(); iter.hasNext(); ) {
+
+ assertEquals("Number of addConnection calls to underlying Broker must match number of calls made to " + "AuthenticationBroker.", 1, receiveBroker.addConnectionData.size());
+
+ ConnectionContext receivedContext = ((StubBroker.AddConnectionData)receiveBroker.addConnectionData.getFirst()).connectionContext;
+
+ assertEquals("The SecurityContext's userName must be set to that of the UserPrincipal.", dnUserName, receivedContext.getSecurityContext().getUserName());
+
+ Set receivedPrincipals = receivedContext.getSecurityContext().getPrincipals();
+
+ for (Iterator iter = receivedPrincipals.iterator(); iter.hasNext();) {
Principal currentPrincipal = (Principal)iter.next();
-
+
if (currentPrincipal instanceof UserPrincipal) {
if (userNames.remove(currentPrincipal.getName())) {
// Nothing, we did good.
@@ -151,29 +136,26 @@ public class JaasCertificateAuthenticationBrokerTest extends TestCase {
fail("Unexpected Principal subclass found.");
}
}
-
+
if (!userNames.isEmpty()) {
fail("Some usernames were not added as UserPrincipals");
}
-
+
if (!groupNames.isEmpty()) {
fail("Some group names were not added as GroupPrincipals");
}
}
-
+
public void testAddConnectionFailure() {
HashSet userNames = new HashSet();
-
+
HashSet groupNames = new HashSet();
groupNames.add("testGroup1");
groupNames.add("testGroup2");
groupNames.add("tesetGroup3");
-
- setConfiguration(
- userNames,
- groupNames,
- false);
-
+
+ setConfiguration(userNames, groupNames, false);
+
boolean connectFailed = false;
try {
authBroker.addConnection(connectionContext, connectionInfo);
@@ -182,24 +164,21 @@ public class JaasCertificateAuthenticationBrokerTest extends TestCase {
} catch (Exception e) {
fail("Failed to connect for unexpected reason: " + e.getMessage());
}
-
+
if (!connectFailed) {
fail("Unauthenticated connection allowed.");
}
-
- assertEquals("Unauthenticated connection allowed.",
- true, receiveBroker.addConnectionData.isEmpty());
+
+ assertEquals("Unauthenticated connection allowed.", true, receiveBroker.addConnectionData.isEmpty());
}
-
+
public void testRemoveConnection() throws Exception {
connectionContext.setSecurityContext(new StubSecurityContext());
-
- authBroker.removeConnection(connectionContext, connectionInfo, new Throwable());
-
- assertEquals("removeConnection should clear ConnectionContext.",
- null, connectionContext.getSecurityContext());
- assertEquals("Incorrect number of calls to underlying broker were made.",
- 1, receiveBroker.removeConnectionData.size());
+ authBroker.removeConnection(connectionContext, connectionInfo, new Throwable());
+
+ assertEquals("removeConnection should clear ConnectionContext.", null, connectionContext.getSecurityContext());
+
+ assertEquals("Incorrect number of calls to underlying broker were made.", 1, receiveBroker.removeConnectionData.size());
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/security/LDAPAuthorizationMapTest.java b/activemq-core/src/test/java/org/apache/activemq/security/LDAPAuthorizationMapTest.java
index 1339f0e77a..582444c7b8 100755
--- a/activemq-core/src/test/java/org/apache/activemq/security/LDAPAuthorizationMapTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/security/LDAPAuthorizationMapTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.activemq.security;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
@@ -24,10 +23,10 @@ import java.util.Set;
import javax.naming.Context;
import javax.naming.NameClassPair;
import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
+import junit.framework.TestCase;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
@@ -37,8 +36,6 @@ import org.apache.directory.server.core.jndi.CoreContextFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import junit.framework.TestCase;
-
/**
* This test assumes setup like in file 'AMQauth.ldif'. Contents of this file is
* attached below in comments.
diff --git a/activemq-core/src/test/java/org/apache/activemq/security/SimpleAuthenticationPluginTest.java b/activemq-core/src/test/java/org/apache/activemq/security/SimpleAuthenticationPluginTest.java
index 6fb51c0ce3..9b5480a1f9 100644
--- a/activemq-core/src/test/java/org/apache/activemq/security/SimpleAuthenticationPluginTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/security/SimpleAuthenticationPluginTest.java
@@ -19,7 +19,6 @@ package org.apache.activemq.security;
import java.net.URI;
import junit.framework.Test;
-
import org.apache.activemq.broker.BrokerFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.commons.logging.Log;
@@ -28,7 +27,7 @@ import org.apache.commons.logging.LogFactory;
public class SimpleAuthenticationPluginTest extends SecurityTestSupport {
private static final Log log = LogFactory.getLog(SimpleAuthenticationPluginTest.class);
-
+
public static Test suite() {
return suite(SimpleAuthenticationPluginTest.class);
}
@@ -37,7 +36,6 @@ public class SimpleAuthenticationPluginTest extends SecurityTestSupport {
junit.textui.TestRunner.run(suite());
}
-
protected BrokerService createBroker() throws Exception {
return createBroker("org/apache/activemq/security/simple-auth-broker.xml");
}
@@ -47,5 +45,4 @@ public class SimpleAuthenticationPluginTest extends SecurityTestSupport {
return BrokerFactory.createBroker(new URI("xbean:" + uri));
}
-
-}
\ No newline at end of file
+}
diff --git a/activemq-core/src/test/java/org/apache/activemq/security/SimpleSecurityBrokerSystemTest.java b/activemq-core/src/test/java/org/apache/activemq/security/SimpleSecurityBrokerSystemTest.java
index dc31650d2c..e3b6b2d411 100644
--- a/activemq-core/src/test/java/org/apache/activemq/security/SimpleSecurityBrokerSystemTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/security/SimpleSecurityBrokerSystemTest.java
@@ -16,6 +16,12 @@
*/
package org.apache.activemq.security;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+
+import junit.framework.Test;
import org.apache.activemq.CombinationTestSupport;
import org.apache.activemq.broker.Broker;
import org.apache.activemq.broker.BrokerPlugin;
@@ -25,14 +31,6 @@ import org.apache.activemq.command.ActiveMQTopic;
import org.apache.activemq.filter.DestinationMap;
import org.apache.activemq.jaas.GroupPrincipal;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-
-import junit.framework.Test;
-
/**
* Tests that the broker allows/fails access to destinations based on the
* security policy installed on the broker.
diff --git a/activemq-core/src/test/java/org/apache/activemq/security/StubLoginModule.java b/activemq-core/src/test/java/org/apache/activemq/security/StubLoginModule.java
index 1a95d1399d..fd86d659f8 100644
--- a/activemq-core/src/test/java/org/apache/activemq/security/StubLoginModule.java
+++ b/activemq-core/src/test/java/org/apache/activemq/security/StubLoginModule.java
@@ -17,9 +17,6 @@
package org.apache.activemq.security;
-import org.apache.activemq.jaas.GroupPrincipal;
-import org.apache.activemq.jaas.UserPrincipal;
-
import java.util.Map;
import javax.security.auth.Subject;
@@ -28,6 +25,9 @@ import javax.security.auth.login.FailedLoginException;
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
+import org.apache.activemq.jaas.GroupPrincipal;
+import org.apache.activemq.jaas.UserPrincipal;
+
public class StubLoginModule implements LoginModule {
public static final String ALLOW_LOGIN_PROPERTY = "org.apache.activemq.jaas.stubproperties.allow_login";
public static final String USERS_PROPERTY = "org.apache.activemq.jaas.stubproperties.users";
diff --git a/activemq-core/src/test/java/org/apache/activemq/security/XBeanSecurityTest.java b/activemq-core/src/test/java/org/apache/activemq/security/XBeanSecurityTest.java
index 801164685d..5bf326cc8f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/security/XBeanSecurityTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/security/XBeanSecurityTest.java
@@ -16,15 +16,14 @@
*/
package org.apache.activemq.security;
+import java.net.URI;
+
+import junit.framework.Test;
import org.apache.activemq.broker.BrokerFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.net.URI;
-
-import junit.framework.Test;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/selector/SelectorTest.java b/activemq-core/src/test/java/org/apache/activemq/selector/SelectorTest.java
index 839ba757c8..f2ef2bd431 100755
--- a/activemq-core/src/test/java/org/apache/activemq/selector/SelectorTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/selector/SelectorTest.java
@@ -31,18 +31,18 @@ import org.apache.activemq.filter.MessageEvaluationContext;
* @version $Revision: 1.7 $
*/
public class SelectorTest extends TestCase {
-
+
public void testBooleanSelector() throws Exception {
Message message = createMessage();
assertSelector(message, "(trueProp OR falseProp) AND trueProp", true);
assertSelector(message, "(trueProp OR falseProp) AND falseProp", false);
-
+
}
public void testXPathSelectors() throws Exception {
ActiveMQTextMessage message = new ActiveMQTextMessage();
-
+
message.setJMSType("xml");
message.setText("");
@@ -64,18 +64,18 @@ public class SelectorTest extends TestCase {
assertSelector(message, "JMSType = 'selector-test'", true);
assertSelector(message, "JMSType = 'crap'", false);
-
+
assertSelector(message, "JMSMessageID = 'id:test:1:1:1:1'", true);
assertSelector(message, "JMSMessageID = 'id:not-test:1:1:1:1'", false);
-
+
message = createMessage();
message.setJMSType("1001");
-
+
assertSelector(message, "JMSType='1001'", true);
assertSelector(message, "JMSType='1001' OR JMSType='1002'", true);
assertSelector(message, "JMSType = 'crap'", false);
}
-
+
public void testBasicSelectors() throws Exception {
Message message = createMessage();
@@ -83,7 +83,7 @@ public class SelectorTest extends TestCase {
assertSelector(message, "rank > 100", true);
assertSelector(message, "rank >= 123", true);
assertSelector(message, "rank >= 124", false);
-
+
}
public void testPropertyTypes() throws Exception {
@@ -96,7 +96,6 @@ public class SelectorTest extends TestCase {
assertSelector(message, "shortProp = 123", true);
assertSelector(message, "shortProp = 10", false);
-
assertSelector(message, "shortProp = 123", true);
assertSelector(message, "shortProp = 10", false);
@@ -112,6 +111,7 @@ public class SelectorTest extends TestCase {
assertSelector(message, "doubleProp = 123", true);
assertSelector(message, "doubleProp = 10", false);
}
+
public void testAndSelectors() throws Exception {
Message message = createMessage();
@@ -195,7 +195,6 @@ public class SelectorTest extends TestCase {
assertSelector(message, "name is null", false);
}
-
public void testLike() throws Exception {
Message message = createMessage();
message.setStringProperty("modelClassId", "com.whatever.something.foo.bar");
@@ -203,18 +202,21 @@ public class SelectorTest extends TestCase {
message.setStringProperty("modelRequestError", "abc");
message.setStringProperty("modelCorrelatedClientId", "whatever");
- assertSelector(message, "modelClassId LIKE 'com.whatever.something.%' AND modelInstanceId = '170' AND (modelRequestError IS NULL OR modelCorrelatedClientId = 'whatever')", true);
+ assertSelector(message, "modelClassId LIKE 'com.whatever.something.%' AND modelInstanceId = '170' AND (modelRequestError IS NULL OR modelCorrelatedClientId = 'whatever')",
+ true);
message.setStringProperty("modelCorrelatedClientId", "shouldFailNow");
- assertSelector(message, "modelClassId LIKE 'com.whatever.something.%' AND modelInstanceId = '170' AND (modelRequestError IS NULL OR modelCorrelatedClientId = 'whatever')", false);
+ assertSelector(message, "modelClassId LIKE 'com.whatever.something.%' AND modelInstanceId = '170' AND (modelRequestError IS NULL OR modelCorrelatedClientId = 'whatever')",
+ false);
message = createMessage();
message.setStringProperty("modelClassId", "com.whatever.something.foo.bar");
message.setStringProperty("modelInstanceId", "170");
message.setStringProperty("modelCorrelatedClientId", "shouldNotMatch");
- assertSelector(message, "modelClassId LIKE 'com.whatever.something.%' AND modelInstanceId = '170' AND (modelRequestError IS NULL OR modelCorrelatedClientId = 'whatever')", true);
+ assertSelector(message, "modelClassId LIKE 'com.whatever.something.%' AND modelInstanceId = '170' AND (modelRequestError IS NULL OR modelCorrelatedClientId = 'whatever')",
+ true);
}
/**
@@ -230,7 +232,6 @@ public class SelectorTest extends TestCase {
message.setLongProperty("SessionserverId", 1234);
assertSelector(message, "SessionserverId=1870414179", false);
-
assertSelector(message, "Command NOT IN ('MirrorLobbyRequest', 'MirrorLobbyReply')", false);
message.setStringProperty("Command", "Cheese");
@@ -244,11 +245,12 @@ public class SelectorTest extends TestCase {
public void testFloatComparisons() throws Exception {
Message message = createMessage();
-
- // JMS 1.1 Section 3.8.1.1 : Approximate literals use the Java floating-point literal syntax.
+
+ // JMS 1.1 Section 3.8.1.1 : Approximate literals use the Java
+ // floating-point literal syntax.
// We will use the java varible x to demo valid floating point syntaxs.
double x;
-
+
// test decimals like x.x
x = 1.0;
x = -1.1;
@@ -267,7 +269,7 @@ public class SelectorTest extends TestCase {
assertSelector(message, "-1.1 < 1.", true);
assertSelector(message, "1.E1 < 1.1E1", true);
assertSelector(message, "-1.1E1 < 1.E1", true);
-
+
// test decimals like .x
x = .5;
x = -.5;
@@ -276,7 +278,7 @@ public class SelectorTest extends TestCase {
assertSelector(message, "-.5 < .1", true);
assertSelector(message, ".1E1 < .5E1", true);
assertSelector(message, "-.5E1 < .1E1", true);
-
+
// test exponents
x = 4E10;
x = -4E10;
@@ -329,9 +331,9 @@ public class SelectorTest extends TestCase {
message.setJMSMessageID("connection:1:1:1:1");
message.setObjectProperty("name", "James");
message.setObjectProperty("location", "London");
-
+
message.setByteProperty("byteProp", (byte)123);
- message.setByteProperty("byteProp2", (byte) 33);
+ message.setByteProperty("byteProp2", (byte)33);
message.setShortProperty("shortProp", (short)123);
message.setIntProperty("intProp", (int)123);
message.setLongProperty("longProp", (long)123);
@@ -348,13 +350,11 @@ public class SelectorTest extends TestCase {
return message;
}
-
protected void assertInvalidSelector(Message message, String text) throws JMSException {
try {
new SelectorParser().parse(text);
fail("Created a valid selector");
- }
- catch (InvalidSelectorException e) {
+ } catch (InvalidSelectorException e) {
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java b/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java
index 5c380177af..9e8d9439f0 100755
--- a/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java
+++ b/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java
@@ -16,16 +16,16 @@
*/
package org.apache.activemq.spring;
-import junit.framework.Assert;
-
-import javax.jms.Message;
-import javax.jms.MessageListener;
import java.util.ArrayList;
import java.util.List;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
+import junit.framework.Assert;
+
public class ConsumerBean extends Assert implements MessageListener {
- private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
- .getLog(ConsumerBean.class);
+ private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(ConsumerBean.class);
private List messages = new ArrayList();
private Object semaphore;
private boolean verbose;
@@ -39,7 +39,7 @@ public class ConsumerBean extends Assert implements MessageListener {
/**
* Constructor, initialized semaphore object.
- *
+ *
* @param semaphore
*/
public ConsumerBean(Object semaphore) {
@@ -57,7 +57,7 @@ public class ConsumerBean extends Assert implements MessageListener {
/**
* Method implemented from MessageListener interface.
- *
+ *
* @param message
*/
public synchronized void onMessage(Message message) {
@@ -84,8 +84,7 @@ public class ConsumerBean extends Assert implements MessageListener {
semaphore.wait(4000);
}
}
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
log.info("Caught: " + e);
}
long end = System.currentTimeMillis() - start;
@@ -95,7 +94,7 @@ public class ConsumerBean extends Assert implements MessageListener {
/**
* Used to wait for a message to arrive given a particular message count.
- *
+ *
* @param messageCount
*/
public void waitForMessagesToArrive(int messageCount) {
@@ -111,8 +110,7 @@ public class ConsumerBean extends Assert implements MessageListener {
synchronized (semaphore) {
semaphore.wait(1000);
}
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
log.info("Caught: " + e);
}
}
@@ -140,7 +138,7 @@ public class ConsumerBean extends Assert implements MessageListener {
/**
* Identifies if the message is empty.
- *
+ *
* @return
*/
protected boolean hasReceivedMessage() {
@@ -149,7 +147,7 @@ public class ConsumerBean extends Assert implements MessageListener {
/**
* Identifies if the message count has reached the total size of message.
- *
+ *
* @param messageCount
* @return
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/spring/SpringConsumer.java b/activemq-core/src/test/java/org/apache/activemq/spring/SpringConsumer.java
index fbec73e031..b0efe11433 100755
--- a/activemq-core/src/test/java/org/apache/activemq/spring/SpringConsumer.java
+++ b/activemq-core/src/test/java/org/apache/activemq/spring/SpringConsumer.java
@@ -16,10 +16,6 @@
*/
package org.apache.activemq.spring;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.jms.core.JmsTemplate;
-
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
@@ -29,6 +25,10 @@ import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.Session;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.jms.core.JmsTemplate;
+
public class SpringConsumer extends ConsumerBean implements MessageListener {
private static final Log log = LogFactory.getLog(SpringConsumer.class);
private JmsTemplate template;
@@ -58,8 +58,7 @@ public class SpringConsumer extends ConsumerBean implements MessageListener {
session = connection.createSession(true, Session.CLIENT_ACKNOWLEDGE);
consumer = session.createConsumer(destination, selector, false);
consumer.setMessageListener(this);
- }
- catch (JMSException ex) {
+ } catch (JMSException ex) {
log.error("", ex);
throw ex;
}
@@ -81,14 +80,13 @@ public class SpringConsumer extends ConsumerBean implements MessageListener {
super.onMessage(message);
try {
message.acknowledge();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
log.error("Failed to acknowledge: " + e, e);
}
}
// Properties
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public Destination getDestination() {
return destination;
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/spring/SpringProducer.java b/activemq-core/src/test/java/org/apache/activemq/spring/SpringProducer.java
index d4c4abc813..67608c8241 100755
--- a/activemq-core/src/test/java/org/apache/activemq/spring/SpringProducer.java
+++ b/activemq-core/src/test/java/org/apache/activemq/spring/SpringProducer.java
@@ -16,15 +16,15 @@
*/
package org.apache.activemq.spring;
-import org.springframework.jms.core.JmsTemplate;
-import org.springframework.jms.core.MessageCreator;
-
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;
+import org.springframework.jms.core.JmsTemplate;
+import org.springframework.jms.core.MessageCreator;
+
public class SpringProducer {
private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
.getLog(SpringProducer.class);
diff --git a/activemq-core/src/test/java/org/apache/activemq/spring/SpringTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/spring/SpringTestSupport.java
index a2dd16a65f..b5befa27cf 100644
--- a/activemq-core/src/test/java/org/apache/activemq/spring/SpringTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/spring/SpringTestSupport.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.spring;
+import java.util.Iterator;
+import java.util.List;
+
import junit.framework.TestCase;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import java.util.Iterator;
-import java.util.List;
-
/**
* @version $Revision: 1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/streams/JMSInputStreamTest.java b/activemq-core/src/test/java/org/apache/activemq/streams/JMSInputStreamTest.java
index 0be7391627..b8b708f274 100755
--- a/activemq-core/src/test/java/org/apache/activemq/streams/JMSInputStreamTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/streams/JMSInputStreamTest.java
@@ -18,18 +18,16 @@ package org.apache.activemq.streams;
import java.io.DataInputStream;
import java.io.DataOutputStream;
+import java.util.concurrent.atomic.AtomicBoolean;
import javax.jms.Destination;
import junit.framework.Test;
-
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.JmsTestSupport;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* JMSInputStreamTest
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/JmsResourceProvider.java b/activemq-core/src/test/java/org/apache/activemq/test/JmsResourceProvider.java
index 28df74ffe0..6679151a40 100755
--- a/activemq-core/src/test/java/org/apache/activemq/test/JmsResourceProvider.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/JmsResourceProvider.java
@@ -19,13 +19,13 @@ package org.apache.activemq.test;
import javax.jms.Connection;
import javax.jms.ConnectionConsumer;
import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.ServerSessionPool;
import javax.jms.Session;
-import javax.jms.DeliveryMode;
import javax.jms.Topic;
import org.apache.activemq.ActiveMQConnectionFactory;
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveTest.java
index 0d3ac4bab5..b26f79da6d 100755
--- a/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveTest.java
@@ -27,9 +27,8 @@ import javax.jms.Topic;
* @version $Revision: 1.2 $
*/
public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport {
- private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
- .getLog(JmsTopicSendReceiveTest.class);
-
+ private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(JmsTopicSendReceiveTest.class);
+
protected Connection connection;
protected void setUp() throws Exception {
@@ -51,14 +50,12 @@ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport {
producer = session.createProducer(null);
producer.setDeliveryMode(deliveryMode);
- log.info("Created producer: " + producer + " delivery mode = " +
- (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT"));
+ log.info("Created producer: " + producer + " delivery mode = " + (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT"));
if (topic) {
consumerDestination = session.createTopic(getConsumerSubject());
producerDestination = session.createTopic(getProducerSubject());
- }
- else {
+ } else {
consumerDestination = session.createQueue(getConsumerSubject());
producerDestination = session.createQueue(getProducerSubject());
}
@@ -78,33 +75,32 @@ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport {
protected void tearDown() throws Exception {
log.info("Dumping stats...");
- //TODO
- //connectionFactory.getFactoryStats().dump(new IndentPrinter());
+ // TODO
+ // connectionFactory.getFactoryStats().dump(new IndentPrinter());
log.info("Closing down connection");
/** TODO we should be able to shut down properly */
session.close();
connection.close();
- }
-
+ }
+
/**
- * Creates a session.
+ * Creates a session.
*
- * @return session
+ * @return session
* @throws JMSException
*/
protected Session createConsumerSession() throws JMSException {
if (useSeparateSession) {
return connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- }
- else {
+ } else {
return session;
}
}
/**
- * Creates a durable suscriber or a consumer.
+ * Creates a durable suscriber or a consumer.
*
* @return MessageConsumer - durable suscriber or consumer.
* @throws JMSException
@@ -112,7 +108,7 @@ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport {
protected MessageConsumer createConsumer() throws JMSException {
if (durable) {
log.info("Creating durable consumer");
- return consumeSession.createDurableSubscriber((Topic) consumerDestination, getName());
+ return consumeSession.createDurableSubscriber((Topic)consumerDestination, getName());
}
return consumeSession.createConsumer(consumerDestination);
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.java b/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.java
index 27b9cf0304..ea7848b3ab 100644
--- a/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.test;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.BrokerService;
+import java.util.Iterator;
+import java.util.List;
import javax.jms.JMSException;
import javax.jms.Message;
-import java.util.Iterator;
-import java.util.List;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
/**
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java b/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java
index 4e528e0bbb..26b2c45072 100755
--- a/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java
@@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory;
* @version $Revision: 1.3 $
*/
public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTestSupport {
-
+
protected static final Log log = LogFactory.getLog(JmsTopicSendReceiveWithTwoConnectionsTest.class);
protected Connection sendConnection;
@@ -69,14 +69,12 @@ public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTes
producer = session.createProducer(null);
producer.setDeliveryMode(deliveryMode);
- log.info("Created producer: " + producer + " delivery mode = " +
- (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT"));
+ log.info("Created producer: " + producer + " delivery mode = " + (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT"));
if (topic) {
consumerDestination = session.createTopic(getConsumerSubject());
producerDestination = session.createTopic(getProducerSubject());
- }
- else {
+ } else {
consumerDestination = session.createQueue(getConsumerSubject());
producerDestination = session.createQueue(getProducerSubject());
}
@@ -93,7 +91,7 @@ public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTes
protected MessageConsumer createConsumer() throws JMSException {
return receiveSession.createConsumer(consumerDestination);
}
-
+
/*
* @see junit.framework.TestCase#tearDown()
*/
@@ -117,7 +115,7 @@ public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTes
/**
* Creates a connection.
*
- * @return Connection
+ * @return Connection
* @throws Exception
*/
protected Connection createSendConnection() throws Exception {
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/TemporaryDestinationToFromNameTest.java b/activemq-core/src/test/java/org/apache/activemq/test/TemporaryDestinationToFromNameTest.java
index c8512745ee..52a59cfe82 100644
--- a/activemq-core/src/test/java/org/apache/activemq/test/TemporaryDestinationToFromNameTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/TemporaryDestinationToFromNameTest.java
@@ -16,12 +16,12 @@
*/
package org.apache.activemq.test;
-import org.apache.activemq.EmbeddedBrokerAndConnectionTestSupport;
-
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.Topic;
+import org.apache.activemq.EmbeddedBrokerAndConnectionTestSupport;
+
/**
* @version $Revision: 1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java b/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java
index b70e50e257..ddd5ee72da 100644
--- a/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java
@@ -16,18 +16,18 @@
*/
package org.apache.activemq.test.message;
-import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsAndEmbeddedBrokerTest;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javax.jms.JMSException;
+import javax.jms.Message;
+
+import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsAndEmbeddedBrokerTest;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* Tests that a Message can have nested Map and List properties attached.
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java b/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java
index c5d6cea71c..166e916aeb 100644
--- a/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java
@@ -16,18 +16,18 @@
*/
package org.apache.activemq.test.message;
-import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsAndEmbeddedBrokerTest;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsAndEmbeddedBrokerTest;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithLastImagePolicyWithWildcardTest.java b/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithLastImagePolicyWithWildcardTest.java
index e4e61a618a..634852f7ab 100644
--- a/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithLastImagePolicyWithWildcardTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithLastImagePolicyWithWildcardTest.java
@@ -16,12 +16,12 @@
*/
package org.apache.activemq.test.retroactive;
-import org.apache.activemq.command.ActiveMQTopic;
-
-import javax.jms.MessageProducer;
-import javax.jms.TextMessage;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.TextMessage;
+
+import org.apache.activemq.command.ActiveMQTopic;
/**
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java b/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java
index b650391937..02087db788 100644
--- a/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java
@@ -21,11 +21,11 @@ import java.util.Date;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
-import javax.jms.JMSException;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.EmbeddedBrokerTestSupport;
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java b/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java
index e2eccd6de7..9a0ed676a0 100644
--- a/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java
@@ -16,13 +16,8 @@
*/
package org.apache.activemq.test.retroactive;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
-import org.apache.activemq.broker.BrokerFactory;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.util.MessageIdList;
-import org.apache.activemq.xbean.BrokerFactoryBean;
-import org.springframework.core.io.ClassPathResource;
+import java.net.URI;
+import java.util.Date;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
@@ -31,8 +26,11 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
-import java.net.URI;
-import java.util.Date;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.EmbeddedBrokerTestSupport;
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.util.MessageIdList;
/**
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/rollback/DelegatingTransactionalMessageListener.java b/activemq-core/src/test/java/org/apache/activemq/test/rollback/DelegatingTransactionalMessageListener.java
index b8760a1f16..0e7e9b9da6 100644
--- a/activemq-core/src/test/java/org/apache/activemq/test/rollback/DelegatingTransactionalMessageListener.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/rollback/DelegatingTransactionalMessageListener.java
@@ -16,9 +16,6 @@
*/
package org.apache.activemq.test.rollback;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
@@ -27,6 +24,8 @@ import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.Session;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class DelegatingTransactionalMessageListener implements MessageListener {
private static final transient Log log = LogFactory.getLog(DelegatingTransactionalMessageListener.class);
@@ -43,8 +42,7 @@ public class DelegatingTransactionalMessageListener implements MessageListener {
session = connection.createSession(transacted, ackMode);
MessageConsumer consumer = session.createConsumer(destination);
consumer.setMessageListener(this);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw new IllegalStateException("Could not listen to " + destination, e);
}
}
@@ -53,8 +51,7 @@ public class DelegatingTransactionalMessageListener implements MessageListener {
try {
underlyingListener.onMessage(message);
session.commit();
- }
- catch (Throwable e) {
+ } catch (Throwable e) {
rollback();
}
}
@@ -62,8 +59,7 @@ public class DelegatingTransactionalMessageListener implements MessageListener {
private void rollback() {
try {
session.rollback();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
log.error("Failed to rollback: " + e, e);
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/test/rollback/RollbacksWhileConsumingLargeQueueTest.java b/activemq-core/src/test/java/org/apache/activemq/test/rollback/RollbacksWhileConsumingLargeQueueTest.java
index 824e411dd9..05c211f296 100644
--- a/activemq-core/src/test/java/org/apache/activemq/test/rollback/RollbacksWhileConsumingLargeQueueTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/test/rollback/RollbacksWhileConsumingLargeQueueTest.java
@@ -16,6 +16,10 @@
*/
package org.apache.activemq.test.rollback;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -29,10 +33,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.jms.core.MessageCreator;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
/**
* @version $Revision$
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/StubTransportListener.java b/activemq-core/src/test/java/org/apache/activemq/transport/StubTransportListener.java
index 05d76f354d..9554d704f8 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/StubTransportListener.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/StubTransportListener.java
@@ -16,12 +16,10 @@
*/
package org.apache.activemq.transport;
+import java.io.IOException;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
-
-import java.io.IOException;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/TopicClusterTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/TopicClusterTest.java
index 635b9530c2..d1bbac5d1b 100755
--- a/activemq-core/src/test/java/org/apache/activemq/transport/TopicClusterTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/TopicClusterTest.java
@@ -20,6 +20,7 @@ package org.apache.activemq.transport;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.Connection;
import javax.jms.DeliveryMode;
@@ -33,7 +34,6 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import junit.framework.TestCase;
-
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
@@ -44,8 +44,6 @@ import org.apache.activemq.util.ServiceStopper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.atomic.AtomicInteger;
-
/**
* @version $Revision$
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/failover/BadConnectionTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/failover/BadConnectionTest.java
index 73d094a39c..e61e84cfb5 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/failover/BadConnectionTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/failover/BadConnectionTest.java
@@ -20,7 +20,6 @@ import java.io.IOException;
import java.net.URI;
import junit.framework.TestCase;
-
import org.apache.activemq.command.ActiveMQMessage;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportFactory;
@@ -29,11 +28,10 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
- *
* @version $Revision: 1.1 $
*/
public class BadConnectionTest extends TestCase {
-
+
protected static final Log log = LogFactory.getLog(BadConnectionTest.class);
protected Transport transport;
@@ -42,11 +40,11 @@ public class BadConnectionTest extends TestCase {
try {
transport.asyncRequest(new ActiveMQMessage(), null);
fail("This should never succeed");
- }
- catch (IOException e) {
+ } catch (IOException e) {
log.info("Caught expected exception: " + e, e);
}
}
+
protected Transport createTransport() throws Exception {
return TransportFactory.connect(new URI("failover://(tcp://doesNotExist:1234)?useExponentialBackOff=false&maxReconnectAttempts=3&initialReconnectDelay=100"));
}
@@ -71,9 +69,9 @@ public class BadConnectionTest extends TestCase {
}
protected void tearDown() throws Exception {
- if (transport != null) {
+ if (transport != null) {
transport.stop();
}
}
-
+
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java
index 42370988e4..b6b919cce5 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java
@@ -19,6 +19,9 @@ package org.apache.activemq.transport.failover;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.DeliveryMode;
@@ -29,7 +32,6 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import junit.framework.TestCase;
-
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;
@@ -41,10 +43,6 @@ import org.apache.activemq.util.ServiceStopper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* @version $Revision: 1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java
index 9b39cf2fdc..26f84e28ec 100755
--- a/activemq-core/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java
@@ -18,11 +18,12 @@ package org.apache.activemq.transport.fanout;
import java.io.IOException;
import java.net.URI;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import javax.jms.DeliveryMode;
import junit.framework.Test;
-
import org.apache.activemq.broker.StubConnection;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQQueue;
@@ -39,9 +40,6 @@ import org.apache.activemq.transport.mock.MockTransport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
public class FanoutTransportBrokerTest extends NetworkTestSupport {
private static final Log log = LogFactory.getLog(FanoutTransportBrokerTest.class);
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOJmsDurableTopicSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOJmsDurableTopicSendReceiveTest.java
index 39e8bad751..84f955e2bb 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOJmsDurableTopicSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOJmsDurableTopicSendReceiveTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.activemq.transport.nio;
-import org.apache.activemq.JmsDurableTopicSendReceiveTest;
import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.JmsDurableTopicSendReceiveTest;
import org.apache.activemq.broker.BrokerService;
public class NIOJmsDurableTopicSendReceiveTest extends JmsDurableTopicSendReceiveTest {
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOPersistentSendAndReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOPersistentSendAndReceiveTest.java
index 8be59b5396..330557f907 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOPersistentSendAndReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOPersistentSendAndReceiveTest.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.transport.nio;
-import org.apache.activemq.broker.BrokerService;
-
import javax.jms.DeliveryMode;
+import org.apache.activemq.broker.BrokerService;
+
public class NIOPersistentSendAndReceiveTest extends NIOJmsSendAndReceiveTest {
protected BrokerService broker;
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOTransportBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOTransportBrokerTest.java
index 59bfdefd67..ea103873e3 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOTransportBrokerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/nio/NIOTransportBrokerTest.java
@@ -16,10 +16,9 @@
*/
package org.apache.activemq.transport.nio;
-import org.apache.activemq.transport.TransportBrokerTestSupport;
-
import junit.framework.Test;
import junit.textui.TestRunner;
+import org.apache.activemq.transport.TransportBrokerTestSupport;
public class NIOTransportBrokerTest extends TransportBrokerTestSupport {
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java
index fe349438c2..0416f77ca9 100755
--- a/activemq-core/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java
@@ -17,6 +17,16 @@
package org.apache.activemq.transport.peer;
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+import junit.framework.TestCase;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.advisory.AdvisorySupport;
import org.apache.activemq.command.ActiveMQDestination;
@@ -29,18 +39,6 @@ import org.apache.activemq.util.MessageIdList;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import junit.framework.TestCase;
-
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java b/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java
index 2f41ca4423..06c6b4b814 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java
@@ -16,6 +16,11 @@
*/
package org.apache.activemq.transport.reliable;
+import java.io.IOException;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.DatagramChannel;
+
import org.apache.activemq.openwire.OpenWireFormat;
import org.apache.activemq.transport.udp.ByteBufferPool;
import org.apache.activemq.transport.udp.CommandDatagramChannel;
@@ -24,13 +29,7 @@ import org.apache.activemq.transport.udp.UdpTransport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.io.IOException;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.channels.DatagramChannel;
-
/**
- *
* @version $Revision: $
*/
public class UnreliableCommandDatagramChannel extends CommandDatagramChannel {
@@ -39,9 +38,9 @@ public class UnreliableCommandDatagramChannel extends CommandDatagramChannel {
private DropCommandStrategy dropCommandStrategy;
- public UnreliableCommandDatagramChannel(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize,
- SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller, ReplayBuffer replayBuffer, DatagramChannel channel,
- ByteBufferPool bufferPool, DropCommandStrategy strategy) {
+ public UnreliableCommandDatagramChannel(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize, SocketAddress targetAddress,
+ DatagramHeaderMarshaller headerMarshaller, ReplayBuffer replayBuffer, DatagramChannel channel, ByteBufferPool bufferPool,
+ DropCommandStrategy strategy) {
super(transport, wireFormat, datagramSize, targetAddress, headerMarshaller, channel, bufferPool);
this.dropCommandStrategy = strategy;
}
@@ -50,11 +49,10 @@ public class UnreliableCommandDatagramChannel extends CommandDatagramChannel {
if (dropCommandStrategy.shouldDropCommand(commandId, address, redelivery)) {
writeBuffer.flip();
log.info("Dropping datagram with command: " + commandId);
-
+
// lets still add it to the replay buffer though!
getReplayBuffer().addBuffer(commandId, writeBuffer);
- }
- else {
+ } else {
super.sendWriteBuffer(commandId, address, writeBuffer, redelivery);
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java b/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java
index 9a7191a641..755eb454a2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java
@@ -16,16 +16,15 @@
*/
package org.apache.activemq.transport.reliable;
-import org.apache.activemq.openwire.OpenWireFormat;
-import org.apache.activemq.transport.udp.CommandChannel;
-import org.apache.activemq.transport.udp.CommandDatagramChannel;
-import org.apache.activemq.transport.udp.UdpTransport;
-
import java.io.IOException;
import java.net.SocketAddress;
import java.net.URI;
import java.net.UnknownHostException;
+import org.apache.activemq.openwire.OpenWireFormat;
+import org.apache.activemq.transport.udp.CommandChannel;
+import org.apache.activemq.transport.udp.UdpTransport;
+
/**
* An unreliable UDP transport that will randomly discard packets to simulate a
* bad network (or UDP buffers being flooded).
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java
index fb8246346a..148920e0ec 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java
@@ -16,6 +16,9 @@
*/
package org.apache.activemq.transport.reliable;
+import java.net.SocketAddress;
+import java.net.URI;
+
import org.apache.activemq.openwire.OpenWireFormat;
import org.apache.activemq.transport.CommandJoiner;
import org.apache.activemq.transport.Transport;
@@ -23,11 +26,6 @@ import org.apache.activemq.transport.udp.ResponseRedirectInterceptor;
import org.apache.activemq.transport.udp.UdpTransport;
import org.apache.activemq.transport.udp.UdpTransportTest;
-import java.net.SocketAddress;
-import java.net.URI;
-import java.util.HashSet;
-import java.util.Set;
-
/**
*
* @version $Revision: $
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSslTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSslTest.java
index e8ff8c901a..d3c583a05d 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSslTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSslTest.java
@@ -16,14 +16,12 @@
*/
package org.apache.activemq.transport.stomp;
-import org.apache.activemq.transport.tcp.SslSocketHelper;
-
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.SSLSocket;
-import javax.net.SocketFactory;
+import java.io.IOException;
import java.net.Socket;
import java.net.URI;
-import java.io.IOException;
+
+import javax.net.SocketFactory;
+import javax.net.ssl.SSLSocketFactory;
/**
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
index d2b83fece4..165e3a3067 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
@@ -16,20 +16,27 @@
*/
package org.apache.activemq.transport.stomp;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.CombinationTestSupport;
-import org.apache.activemq.broker.*;
-import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.command.ActiveMQTextMessage;
-
-import javax.jms.*;
-import javax.jms.Connection;
import java.io.IOException;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.net.URI;
-import java.util.regex.Pattern;
import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.CombinationTestSupport;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.TransportConnector;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.ActiveMQTextMessage;
public class StompTest extends CombinationTestSupport {
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java
index 3eb46d94b3..eabf69850b 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java
@@ -19,6 +19,10 @@ package org.apache.activemq.transport.tcp;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.net.SocketFactory;
import org.apache.activemq.CombinationTestSupport;
import org.apache.activemq.command.WireFormatInfo;
@@ -29,11 +33,6 @@ import org.apache.activemq.transport.TransportFactory;
import org.apache.activemq.transport.TransportListener;
import org.apache.activemq.transport.TransportServer;
-import javax.net.SocketFactory;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
public class InactivityMonitorTest extends CombinationTestSupport implements TransportAcceptListener {
private TransportServer server;
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslSocketHelper.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslSocketHelper.java
index df1e993398..96236cbb9b 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslSocketHelper.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslSocketHelper.java
@@ -16,11 +16,12 @@
*/
package org.apache.activemq.transport.tcp;
-import javax.management.remote.JMXPrincipal;
-import javax.net.ssl.SSLSocket;
import java.io.IOException;
import java.security.cert.X509Certificate;
+import javax.management.remote.JMXPrincipal;
+import javax.net.ssl.SSLSocket;
+
/**
* @version $Revision$
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportBrokerTest.java
index 615be3b94a..dc39173de1 100755
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportBrokerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportBrokerTest.java
@@ -16,10 +16,9 @@
*/
package org.apache.activemq.transport.tcp;
-import org.apache.activemq.transport.TransportBrokerTestSupport;
-
import junit.framework.Test;
import junit.textui.TestRunner;
+import org.apache.activemq.transport.TransportBrokerTestSupport;
public class SslTransportBrokerTest extends TransportBrokerTestSupport {
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java
index 201accf221..e812605009 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java
@@ -97,7 +97,7 @@ public class SslTransportFactoryTest extends TestCase {
optionSettings[j] = getMthNaryDigit(i, j, 3) - 1;
if (optionSettings[j] != -1) {
- options.put(optionNames[j], (optionSettings[j] == 1 ? "true" : "false"));
+ options.put(optionNames[j], optionSettings[j] == 1 ? "true" : "false");
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java
index 4875644156..3469890026 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java
@@ -17,11 +17,11 @@
package org.apache.activemq.transport.tcp;
-import junit.framework.TestCase;
-
import java.io.IOException;
import java.net.URI;
+import junit.framework.TestCase;
+
public class SslTransportServerTest extends TestCase {
private SslTransportServer sslTransportServer;
private StubSSLServerSocket sslServerSocket;
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportTest.java
index 6fe1bc20ac..d049745450 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportTest.java
@@ -24,24 +24,22 @@ import javax.management.remote.JMXPrincipal;
import javax.net.ssl.SSLSocket;
import junit.framework.TestCase;
-
import org.apache.activemq.command.ConnectionInfo;
import org.apache.activemq.transport.StubTransportListener;
import org.apache.activemq.wireformat.ObjectStreamWireFormat;
/**
* Unit tests for the SslTransport class.
- *
*/
public class SslTransportTest extends TestCase {
-
+
SSLSocket sslSocket;
StubTransportListener stubListener;
-
+
String username;
String password;
String certDistinguishedName;
-
+
protected void setUp() throws Exception {
certDistinguishedName = "ThisNameIsDistinguished";
username = "SomeUserName";
@@ -51,54 +49,48 @@ public class SslTransportTest extends TestCase {
protected void tearDown() throws Exception {
super.tearDown();
}
-
- private void createTransportAndConsume( boolean wantAuth, boolean needAuth ) throws IOException {
- JMXPrincipal principal = new JMXPrincipal( certDistinguishedName );
- X509Certificate cert = new StubX509Certificate( principal );
- StubSSLSession sslSession =
- new StubSSLSession( cert );
-
- sslSocket = new StubSSLSocket( sslSession );
+
+ private void createTransportAndConsume(boolean wantAuth, boolean needAuth) throws IOException {
+ JMXPrincipal principal = new JMXPrincipal(certDistinguishedName);
+ X509Certificate cert = new StubX509Certificate(principal);
+ StubSSLSession sslSession = new StubSSLSession(cert);
+
+ sslSocket = new StubSSLSocket(sslSession);
sslSocket.setWantClientAuth(wantAuth);
sslSocket.setNeedClientAuth(needAuth);
-
- SslTransport transport = new SslTransport(
- new ObjectStreamWireFormat(), sslSocket );
-
+
+ SslTransport transport = new SslTransport(new ObjectStreamWireFormat(), sslSocket);
+
stubListener = new StubTransportListener();
-
- transport.setTransportListener( stubListener );
-
+
+ transport.setTransportListener(stubListener);
+
ConnectionInfo sentInfo = new ConnectionInfo();
-
+
sentInfo.setUserName(username);
sentInfo.setPassword(password);
-
+
transport.doConsume(sentInfo);
}
-
+
public void testKeepClientUserName() throws IOException {
createTransportAndConsume(true, true);
-
- final ConnectionInfo receivedInfo =
- (ConnectionInfo) stubListener.getCommands().remove();
-
+
+ final ConnectionInfo receivedInfo = (ConnectionInfo)stubListener.getCommands().remove();
+
X509Certificate receivedCert;
-
+
try {
- receivedCert = ((X509Certificate[])receivedInfo.getTransportContext())[0];
+ receivedCert = ((X509Certificate[])receivedInfo.getTransportContext())[0];
} catch (Exception e) {
receivedCert = null;
}
-
- if ( receivedCert == null ) {
+
+ if (receivedCert == null) {
fail("Transmitted certificate chain was not attached to ConnectionInfo.");
}
-
- assertEquals("Received certificate distinguished name did not match the one transmitted.",
- certDistinguishedName, receivedCert.getSubjectDN().getName());
-
+
+ assertEquals("Received certificate distinguished name did not match the one transmitted.", certDistinguishedName, receivedCert.getSubjectDN().getName());
+
}
}
-
-
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBrokerTest.java
index 63f4e66eac..1dca333e9b 100755
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBrokerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBrokerTest.java
@@ -16,9 +16,8 @@
*/
package org.apache.activemq.transport.tcp;
-import org.apache.activemq.transport.TransportBrokerTestSupport;
-
import junit.framework.Test;
+import org.apache.activemq.transport.TransportBrokerTestSupport;
public class TcpTransportBrokerTest extends TransportBrokerTestSupport {
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java
index 2beffe75e5..1bd1f22421 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java
@@ -16,13 +16,13 @@
*/
package org.apache.activemq.transport.tcp;
+import javax.jms.Connection;
+import javax.jms.JMSException;
+
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.EmbeddedBrokerTestSupport;
import org.apache.activemq.broker.BrokerService;
-import javax.jms.Connection;
-import javax.jms.JMSException;
-
/**
* @version $Revision$
*/
@@ -34,7 +34,7 @@ public class TransportUriTest extends EmbeddedBrokerTestSupport {
public void testUriOptionsWork() throws Exception {
String uri = prefix + bindAddress + postfix;
-// System.out.println("Connecting via: " + uri);
+ // System.out.println("Connecting via: " + uri);
connection = new ActiveMQConnectionFactory(uri).createConnection();
connection.start();
@@ -42,33 +42,29 @@ public class TransportUriTest extends EmbeddedBrokerTestSupport {
public void testBadVersionNumberDoesNotWork() throws Exception {
String uri = prefix + bindAddress + postfix + "&minmumWireFormatVersion=65535";
-// System.out.println("Connecting via: " + uri);
+ // System.out.println("Connecting via: " + uri);
try {
connection = new ActiveMQConnectionFactory(uri).createConnection();
connection.start();
fail("Should have thrown an exception!");
- }
- catch (Exception expected) {
+ } catch (Exception expected) {
}
}
-
public void testBadPropertyNameFails() throws Exception {
String uri = prefix + bindAddress + postfix + "&cheese=abc";
-// System.out.println("Connecting via: " + uri);
+ // System.out.println("Connecting via: " + uri);
try {
connection = new ActiveMQConnectionFactory(uri).createConnection();
connection.start();
fail("Should have thrown an exception!");
- }
- catch (Exception expected) {
+ } catch (Exception expected) {
expected.printStackTrace();
}
}
-
protected void setUp() throws Exception {
bindAddress = "tcp://localhost:61616";
super.setUp();
@@ -78,8 +74,7 @@ public class TransportUriTest extends EmbeddedBrokerTestSupport {
if (connection != null) {
try {
connection.close();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
e.printStackTrace();
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java
index 6c5cc06eb1..01869680e2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java
@@ -19,25 +19,20 @@ package org.apache.activemq.transport.tcp;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
import org.apache.activemq.CombinationTestSupport;
import org.apache.activemq.command.CommandTypes;
import org.apache.activemq.command.WireFormatInfo;
-import org.apache.activemq.openwire.OpenWireFormat;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportAcceptListener;
import org.apache.activemq.transport.TransportFactory;
import org.apache.activemq.transport.TransportListener;
import org.apache.activemq.transport.TransportServer;
-import javax.net.SocketFactory;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-
public class WireformatNegociationTest extends CombinationTestSupport {
private TransportServer server;
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/udp/UdpTransportUsingServerTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/udp/UdpTransportUsingServerTest.java
index ce415c889b..400cb61cdf 100644
--- a/activemq-core/src/test/java/org/apache/activemq/transport/udp/UdpTransportUsingServerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/udp/UdpTransportUsingServerTest.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.transport.udp;
+import java.net.URI;
+
import org.apache.activemq.command.ConsumerInfo;
import org.apache.activemq.command.Response;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportFactory;
import org.apache.activemq.transport.TransportServer;
-import java.net.URI;
-
/**
*
* @version $Revision$
diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/vm/VMTransportBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/vm/VMTransportBrokerTest.java
index 81d0d54d4c..c4f9ab2063 100755
--- a/activemq-core/src/test/java/org/apache/activemq/transport/vm/VMTransportBrokerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/transport/vm/VMTransportBrokerTest.java
@@ -16,9 +16,8 @@
*/
package org.apache.activemq.transport.vm;
-import org.apache.activemq.transport.TransportBrokerTestSupport;
-
import junit.framework.Test;
+import org.apache.activemq.transport.TransportBrokerTestSupport;
public class VMTransportBrokerTest extends TransportBrokerTestSupport {
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/ChangeSessionDeliveryModeTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/ChangeSessionDeliveryModeTest.java
index df70077088..67ca60ce12 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/ChangeSessionDeliveryModeTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/ChangeSessionDeliveryModeTest.java
@@ -16,6 +16,7 @@
*/
package org.apache.activemq.usecases;
+
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.IllegalStateException;
@@ -33,8 +34,9 @@ import org.apache.activemq.test.TestSupport;
public class ChangeSessionDeliveryModeTest extends TestSupport implements MessageListener {
/**
- * test following condition- which are defined by JMS Spec 1.1: MessageConsumers cannot use a MessageListener and
- * receive() from the same session
+ * test following condition- which are defined by JMS Spec 1.1:
+ * MessageConsumers cannot use a MessageListener and receive() from the same
+ * session
*
* @throws Exception
*/
@@ -47,12 +49,11 @@ public class ChangeSessionDeliveryModeTest extends TestSupport implements Messag
consumer1.setMessageListener(this);
JMSException jmsEx = null;
MessageConsumer consumer2 = consumerSession.createConsumer(destination);
-
+
try {
consumer2.receive(10);
fail("Did not receive expected exception.");
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
assertTrue(e instanceof IllegalStateException);
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/CompositeConsumeTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/CompositeConsumeTest.java
index 677f3a0c53..9e1b005d61 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/CompositeConsumeTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/CompositeConsumeTest.java
@@ -16,12 +16,12 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.command.ActiveMQTopic;
-import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest;
-
import javax.jms.Destination;
import javax.jms.Message;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest;
+
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java
index 1fcab46860..8535549e5a 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java
@@ -16,9 +16,7 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.command.ActiveMQTopic;
-import org.apache.activemq.test.JmsSendReceiveTestSupport;
+import java.util.List;
import javax.jms.Connection;
import javax.jms.Destination;
@@ -27,7 +25,10 @@ import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.Session;
-import java.util.List;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.test.JmsSendReceiveTestSupport;
/**
* @version $Revision: 1.1.1.1 $
@@ -67,8 +68,7 @@ public class CompositePublishTest extends JmsSendReceiveTestSupport {
if (topic) {
consumerDestination = session.createTopic(getConsumerSubject());
producerDestination = session.createTopic(getProducerSubject());
- }
- else {
+ } else {
consumerDestination = session.createQueue(getConsumerSubject());
producerDestination = session.createQueue(getProducerSubject());
}
@@ -86,7 +86,6 @@ public class CompositePublishTest extends JmsSendReceiveTestSupport {
consumers[i].setMessageListener(createMessageListener(i, messageLists[i]));
}
-
LOG.info("Started connections");
}
@@ -109,7 +108,7 @@ public class CompositePublishTest extends JmsSendReceiveTestSupport {
* Returns the destinations to which we consume
*/
protected Destination[] getDestinations() {
- return new Destination[]{new ActiveMQTopic(getPrefix() + "FOO.BAR"), new ActiveMQTopic(getPrefix() + "FOO.*"), new ActiveMQTopic(getPrefix() + "FOO.X.Y")};
+ return new Destination[] {new ActiveMQTopic(getPrefix() + "FOO.BAR"), new ActiveMQTopic(getPrefix() + "FOO.*"), new ActiveMQTopic(getPrefix() + "FOO.X.Y")};
}
protected String getPrefix() {
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java
index 8f38443a37..9bcfdf3b30 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java
@@ -16,16 +16,13 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
-import org.apache.activemq.EmbeddedBrokerAndConnectionTestSupport;
-
-import javax.jms.Connection;
import javax.jms.Session;
import javax.jms.TemporaryQueue;
import junit.framework.Test;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
+import org.apache.activemq.EmbeddedBrokerAndConnectionTestSupport;
/**
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java
index 3220009870..527544a027 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java
@@ -19,9 +19,6 @@ package org.apache.activemq.usecases;
import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.BrokerService;
-
import javax.jms.Connection;
import javax.jms.Queue;
import javax.jms.QueueConnection;
@@ -32,6 +29,8 @@ import javax.jms.Session;
import javax.jms.Topic;
import junit.framework.TestCase;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
/**
* @author Peter Henning
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/DurableConsumerCloseAndReconnectTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/DurableConsumerCloseAndReconnectTest.java
index a7b46e0553..9e07214d0b 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/DurableConsumerCloseAndReconnectTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/DurableConsumerCloseAndReconnectTest.java
@@ -16,9 +16,6 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.test.TestSupport;
-
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
@@ -30,6 +27,9 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.test.TestSupport;
+
/**
* @version $Revision: 1.1.1.1 $
*/
@@ -42,6 +42,7 @@ public class DurableConsumerCloseAndReconnectTest extends TestSupport {
private MessageProducer producer;
private Destination destination;
private int messageCount;
+
protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
return new ActiveMQConnectionFactory("vm://localhost?broker.deleteAllMessagesOnStartup=false");
}
@@ -57,7 +58,7 @@ public class DurableConsumerCloseAndReconnectTest extends TestSupport {
// now lets try again without one connection open
consumeMessagesDeliveredWhileConsumerClosed();
- //now delete the db
+ // now delete the db
ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("vm://localhost?broker.deleteAllMessagesOnStartup=true");
dummyConnection = fac.createConnection();
dummyConnection.start();
@@ -86,7 +87,7 @@ public class DurableConsumerCloseAndReconnectTest extends TestSupport {
message = consumer.receive(RECEIVE_TIMEOUT);
assertTrue("Should have received a message!", message != null);
message.acknowledge();
-
+
closeConsumer();
log.info("Now lets create the consumer again and because we didn't ack, we should get it again");
@@ -104,7 +105,7 @@ public class DurableConsumerCloseAndReconnectTest extends TestSupport {
message = consumer.receive(RECEIVE_TIMEOUT);
assertTrue("Should have received a message!", message != null);
message.acknowledge();
-
+
closeConsumer();
}
@@ -119,7 +120,7 @@ public class DurableConsumerCloseAndReconnectTest extends TestSupport {
producer.setDeliveryMode(DeliveryMode.PERSISTENT);
TextMessage msg = session.createTextMessage("This is a test: " + messageCount++);
producer.send(msg);
-
+
producer.close();
producer = null;
closeSession();
@@ -128,8 +129,7 @@ public class DurableConsumerCloseAndReconnectTest extends TestSupport {
protected Destination createDestination() throws JMSException {
if (isTopic()) {
return session.createTopic(getSubject());
- }
- else {
+ } else {
return session.createQueue(getSubject());
}
}
@@ -161,9 +161,8 @@ public class DurableConsumerCloseAndReconnectTest extends TestSupport {
private MessageConsumer createConsumer(String durableName) throws JMSException {
if (destination instanceof Topic) {
- return session.createDurableSubscriber((Topic) destination, durableName);
- }
- else {
+ return session.createDurableSubscriber((Topic)destination, durableName);
+ } else {
return session.createConsumer(destination);
}
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java b/activemq-core/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java
index 762226adcd..2accd6a00b 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/DurableSubscriptionTestSupport.java
@@ -307,8 +307,8 @@ abstract public class DurableSubscriptionTestSupport extends TestSupport {
Topic topic = session.createTopic("topic-" + getName());
MessageConsumer consumer = session.createDurableSubscriber(topic, "sub1");
// Drain any messages that may allready be in the sub
- while (consumer.receive(1000) != null)
- ;
+ while (consumer.receive(1000) != null) {
+ }
// See if the durable sub works in a new session.
session.close();
@@ -334,8 +334,8 @@ abstract public class DurableSubscriptionTestSupport extends TestSupport {
Topic topic = session.createTopic("topic-" + getName());
MessageConsumer consumer = session.createDurableSubscriber(topic, "sub1");
// Drain any messages that may allready be in the sub
- while (consumer.receive(1000) != null)
- ;
+ while (consumer.receive(1000) != null) {
+ }
// See if the durable sub works in a new connection.
// The embeded broker shutsdown when his connections are closed.
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsUsingTcpTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsUsingTcpTest.java
index 8b6994d936..d0201062f3 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsUsingTcpTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsUsingTcpTest.java
@@ -16,17 +16,17 @@
*/
package org.apache.activemq.usecases;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
import org.apache.activemq.network.DemandForwardingBridge;
import org.apache.activemq.network.NetworkBridgeConfiguration;
import org.apache.activemq.transport.TransportFactory;
-import java.util.List;
-import java.util.Iterator;
-import java.util.ArrayList;
-import java.net.URI;
-
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/NewConsumerCreatesDestinationTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/NewConsumerCreatesDestinationTest.java
index f577ac65ce..e461c9ad5b 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/NewConsumerCreatesDestinationTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/NewConsumerCreatesDestinationTest.java
@@ -16,19 +16,17 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
+import java.util.Set;
+
+import javax.jms.Destination;
+import javax.jms.Session;
+
import org.apache.activemq.EmbeddedBrokerAndConnectionTestSupport;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.Session;
-
-import java.util.Set;
-
/**
*
* @version $Revision: $
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java
index 70d8b36d70..e4f809908a 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java
@@ -16,19 +16,28 @@
*/
package org.apache.activemq.usecases;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Session;
+
import junit.framework.TestCase;
import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.util.IOHelper;
import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.util.IOHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.jms.*;
-import java.util.List;
-import java.util.Collections;
-import java.util.ArrayList;
-import java.io.File;
-
public final class PublishOnQueueConsumedMessageInTransactionTest extends TestCase implements MessageListener {
private static final Log LOG = LogFactory.getLog(PublishOnQueueConsumedMessageInTransactionTest.class);
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageUsingActivemqXMLTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageUsingActivemqXMLTest.java
index 279d04c042..2106c8cc78 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageUsingActivemqXMLTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageUsingActivemqXMLTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.activemq.usecases;
+import java.io.File;
+
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.xbean.BrokerFactoryBean;
@@ -24,8 +26,6 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
-import java.io.File;
-
/**
* Test Publish/Consume queue using the release activemq.xml configuration file
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumedMessageTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumedMessageTest.java
index d4fd2aec73..f53ee583b3 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumedMessageTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumedMessageTest.java
@@ -16,20 +16,19 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest;
-
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageProducer;
+import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest;
+
/**
* @version $Revision: 1.1.1.1 $
*/
public class PublishOnTopicConsumedMessageTest extends JmsTopicSendReceiveWithTwoConnectionsTest {
private MessageProducer replyProducer;
-
public synchronized void onMessage(Message message) {
// lets resend the message somewhere else
@@ -37,10 +36,9 @@ public class PublishOnTopicConsumedMessageTest extends JmsTopicSendReceiveWithTw
Message msgCopy = (Message)((org.apache.activemq.command.Message)message).copy();
replyProducer.send(msgCopy);
- //log.info("Sending reply: " + message);
+ // log.info("Sending reply: " + message);
super.onMessage(message);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
log.info("Failed to send message: " + e);
e.printStackTrace();
}
@@ -53,8 +51,7 @@ public class PublishOnTopicConsumedMessageTest extends JmsTopicSendReceiveWithTw
if (topic) {
replyDestination = receiveSession.createTopic("REPLY." + getSubject());
- }
- else {
+ } else {
replyDestination = receiveSession.createQueue("REPLY." + getSubject());
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumerMessageUsingActivemqXMLTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumerMessageUsingActivemqXMLTest.java
index 429a9f768b..41870300a8 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumerMessageUsingActivemqXMLTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumerMessageUsingActivemqXMLTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.activemq.usecases;
+import java.io.File;
+
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.xbean.BrokerFactoryBean;
@@ -24,8 +26,6 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
-import java.io.File;
-
/**
* Test Publish/Consume topic using the release activemq.xml configuration file
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/QueueRedeliverTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/QueueRedeliverTest.java
index 309df518a5..19c39fb7f5 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/QueueRedeliverTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/QueueRedeliverTest.java
@@ -16,15 +16,14 @@
*/
package org.apache.activemq.usecases;
-
/**
* @version $Revision: 1.1.1.1 $
*/
public class QueueRedeliverTest extends TopicRedeliverTest {
-
- protected void setUp() throws Exception{
+
+ protected void setUp() throws Exception {
super.setUp();
topic = false;
}
-
+
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/QueueRepeaterTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/QueueRepeaterTest.java
index 6159c10be6..976f087dab 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/QueueRepeaterTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/QueueRepeaterTest.java
@@ -17,6 +17,7 @@
package org.apache.activemq.usecases;
import java.util.Date;
+import java.util.concurrent.CountDownLatch;
import javax.jms.Connection;
import javax.jms.Destination;
@@ -29,20 +30,17 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import junit.framework.TestCase;
-
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CountDownLatch;
-
/**
* @author pragmasoft
* @version $Revision: 1.1.1.1 $
*/
public final class QueueRepeaterTest extends TestCase {
-
+
private static final Log log = LogFactory.getLog(QueueRepeaterTest.class);
private volatile String receivedText;
@@ -72,20 +70,18 @@ public final class QueueRepeaterTest extends TestCase {
public void onMessage(Message m) {
try {
- TextMessage tm = (TextMessage) m;
+ TextMessage tm = (TextMessage)m;
receivedText = tm.getText();
latch.countDown();
log.info("consumer received message :" + receivedText);
consumerSession.commit();
log.info("committed transaction");
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
try {
consumerSession.rollback();
log.info("rolled back transaction");
- }
- catch (JMSException e1) {
+ } catch (JMSException e1) {
log.info(e1);
e1.printStackTrace();
}
@@ -103,8 +99,7 @@ public final class QueueRepeaterTest extends TestCase {
tm.setText("Hello, " + new Date());
producer.send(tm);
log.info("producer sent message :" + tm.getText());
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
e.printStackTrace();
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
index c7b1413a81..331722cd2b 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
@@ -16,8 +16,10 @@
*/
package org.apache.activemq.usecases;
-import java.util.HashMap;
import java.net.URI;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
@@ -25,24 +27,15 @@ import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
-import org.apache.activemq.ActiveMQConnection;
+
import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.BrokerFactory;
-import org.apache.activemq.broker.Broker;
+import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.test.TestSupport;
import org.apache.activemq.util.IdGenerator;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
/**
* @version $Revision: 1.1.1.1 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/StartAndStopBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/StartAndStopBrokerTest.java
index 9e2cc3482b..64e4f6f3f2 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/StartAndStopBrokerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/StartAndStopBrokerTest.java
@@ -16,14 +16,14 @@
*/
package org.apache.activemq.usecases;
-import junit.framework.TestCase;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.BrokerFactory;
-import org.apache.activemq.broker.TransportConnector;
+import java.net.URI;
import javax.jms.JMSException;
-import java.net.URI;
+
+import junit.framework.TestCase;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerService;
/**
* @author Oliver Belikan
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/StartAndStopClientAndBrokerDoesNotLeaveThreadsRunningTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/StartAndStopClientAndBrokerDoesNotLeaveThreadsRunningTest.java
index 1ff29edb54..eaf0edc383 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/StartAndStopClientAndBrokerDoesNotLeaveThreadsRunningTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/StartAndStopClientAndBrokerDoesNotLeaveThreadsRunningTest.java
@@ -15,10 +15,6 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.spring.ConsumerBean;
-
import javax.jms.Connection;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
@@ -27,6 +23,9 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import junit.framework.TestCase;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.spring.ConsumerBean;
/**
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/SubscribeClosePublishThenConsumeTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/SubscribeClosePublishThenConsumeTest.java
index 2b61a3e104..3fb5187abb 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/SubscribeClosePublishThenConsumeTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/SubscribeClosePublishThenConsumeTest.java
@@ -16,9 +16,6 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.test.TestSupport;
-
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Message;
@@ -28,6 +25,9 @@ import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.test.TestSupport;
+
/**
* @author Paul Smith
* @version $Revision: 1.1.1.1 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TestSupport.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TestSupport.java
index 19a3a0e1c1..2cedaaca36 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TestSupport.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TestSupport.java
@@ -16,13 +16,6 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.command.ActiveMQMessage;
-import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.command.ActiveMQTopic;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
@@ -30,6 +23,12 @@ import javax.jms.Message;
import javax.jms.TextMessage;
import junit.framework.TestCase;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* Useful base class for unit test cases
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java
index d72146f020..f5abdb0fff 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkTest.java
@@ -16,12 +16,13 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.JmsMultipleBrokersTestSupport;
-import org.apache.activemq.util.MessageIdList;
+import java.net.URI;
import javax.jms.Destination;
import javax.jms.MessageConsumer;
-import java.net.URI;
+
+import org.apache.activemq.JmsMultipleBrokersTestSupport;
+import org.apache.activemq.util.MessageIdList;
/**
* @version $Revision: 1.1.1.1 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkUsingTcpTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkUsingTcpTest.java
index 025548af71..537b3ab112 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkUsingTcpTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkUsingTcpTest.java
@@ -16,16 +16,16 @@
*/
package org.apache.activemq.usecases;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
import org.apache.activemq.network.DemandForwardingBridge;
import org.apache.activemq.network.NetworkBridgeConfiguration;
import org.apache.activemq.transport.TransportFactory;
-import java.util.List;
-import java.util.ArrayList;
-import java.net.URI;
-
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkTest.java
index fbfa939f72..02271398f0 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkTest.java
@@ -16,13 +16,14 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.util.MessageIdList;
-import org.apache.activemq.JmsMultipleBrokersTestSupport;
-
-import javax.jms.MessageConsumer;
-import javax.jms.Destination;
import java.net.URI;
+import javax.jms.Destination;
+import javax.jms.MessageConsumer;
+
+import org.apache.activemq.JmsMultipleBrokersTestSupport;
+import org.apache.activemq.util.MessageIdList;
+
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkUsingTcpTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkUsingTcpTest.java
index 67ecd51905..cedc879d44 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkUsingTcpTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkUsingTcpTest.java
@@ -16,16 +16,16 @@
*/
package org.apache.activemq.usecases;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
import org.apache.activemq.network.DemandForwardingBridge;
import org.apache.activemq.network.NetworkBridgeConfiguration;
import org.apache.activemq.transport.TransportFactory;
-import java.util.List;
-import java.util.ArrayList;
-import java.net.URI;
-
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
index 017e2f6433..a480a4e831 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
@@ -129,7 +129,7 @@ public class TopicRedeliverTest extends TestSupport {
producerSession.commit();
Message recMsg = consumer.receive(RECEIVE_TIMEOUT);
- assertTrue(recMsg.getJMSRedelivered() == false);
+ assertFalse(recMsg.getJMSRedelivered());
recMsg = consumer.receive(RECEIVE_TIMEOUT);
consumerSession.rollback();
recMsg = consumer.receive(RECEIVE_TIMEOUT);
@@ -169,7 +169,7 @@ public class TopicRedeliverTest extends TestSupport {
producerSession.commit();
Message recMsg = consumer.receive(RECEIVE_TIMEOUT);
- assertTrue(recMsg.getJMSRedelivered() == false);
+ assertFalse(recMsg.getJMSRedelivered());
consumerSession.close();
consumerSession = connection.createSession(true, Session.CLIENT_ACKNOWLEDGE);
consumer = consumerSession.createConsumer(destination);
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java
index 8a88542c22..1bbf984b7a 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java
@@ -18,6 +18,7 @@ package org.apache.activemq.usecases;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.CountDownLatch;
import javax.jms.Connection;
import javax.jms.Destination;
@@ -30,14 +31,11 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import junit.framework.TestCase;
-
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CountDownLatch;
-
/**
* Test case for AMQ-268
*
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java
index a6e5146cf9..63a600749f 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java
@@ -17,6 +17,7 @@
package org.apache.activemq.usecases;
import java.util.Date;
+import java.util.concurrent.CountDownLatch;
import javax.jms.Connection;
import javax.jms.Destination;
@@ -29,20 +30,17 @@ import javax.jms.Session;
import javax.jms.TextMessage;
import junit.framework.TestCase;
-
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.CountDownLatch;
-
/**
* @author pragmasoft
* @version $Revision: 1.1.1.1 $
*/
public final class TransactionTest extends TestCase {
-
+
private static final Log log = LogFactory.getLog(TransactionTest.class);
private volatile String receivedText;
@@ -72,20 +70,18 @@ public final class TransactionTest extends TestCase {
public void onMessage(Message m) {
try {
- TextMessage tm = (TextMessage) m;
+ TextMessage tm = (TextMessage)m;
receivedText = tm.getText();
latch.countDown();
log.info("consumer received message :" + receivedText);
consumerSession.commit();
log.info("committed transaction");
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
try {
consumerSession.rollback();
log.info("rolled back transaction");
- }
- catch (JMSException e1) {
+ } catch (JMSException e1) {
log.info(e1);
e1.printStackTrace();
}
@@ -103,8 +99,7 @@ public final class TransactionTest extends TestCase {
tm.setText("Hello, " + new Date());
producer.send(tm);
log.info("producer sent message :" + tm.getText());
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
e.printStackTrace();
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TransientQueueRedeliverTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TransientQueueRedeliverTest.java
index 4ed1df60e2..6e6a4db730 100755
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TransientQueueRedeliverTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TransientQueueRedeliverTest.java
@@ -18,16 +18,15 @@ package org.apache.activemq.usecases;
import javax.jms.DeliveryMode;
-
/**
* @version $Revision: 1.1.1.1 $
*/
public class TransientQueueRedeliverTest extends TopicRedeliverTest {
-
- protected void setUp() throws Exception{
+
+ protected void setUp() throws Exception {
super.setUp();
topic = false;
deliveryMode = DeliveryMode.NON_PERSISTENT;
}
-
+
}
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMessageNotSentToRemoteWhenNoConsumerTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMessageNotSentToRemoteWhenNoConsumerTest.java
index 140a08587f..28e69986ca 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMessageNotSentToRemoteWhenNoConsumerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMessageNotSentToRemoteWhenNoConsumerTest.java
@@ -16,22 +16,22 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.TransportConnector;
-import org.apache.activemq.network.DemandForwardingBridge;
-import org.apache.activemq.network.NetworkBridgeConfiguration;
-import org.apache.activemq.transport.TransportFactory;
-import org.apache.activemq.JmsMultipleBrokersTestSupport;
-import org.apache.activemq.command.Command;
-import org.apache.activemq.util.MessageIdList;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.Destination;
import javax.jms.MessageConsumer;
-import java.util.List;
-import java.util.ArrayList;
-import java.net.URI;
-import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.activemq.JmsMultipleBrokersTestSupport;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.TransportConnector;
+import org.apache.activemq.command.Command;
+import org.apache.activemq.network.DemandForwardingBridge;
+import org.apache.activemq.network.NetworkBridgeConfiguration;
+import org.apache.activemq.transport.TransportFactory;
+import org.apache.activemq.util.MessageIdList;
/**
* @version $Revision: 1.1.1.1 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java
index 63f13b7faf..9a26714ee7 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java
@@ -16,27 +16,26 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.CombinationTestSupport;
-import org.apache.activemq.util.MessageIdList;
-import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.xbean.XBeanBrokerFactory;
-
import java.net.URI;
import java.util.Arrays;
-import junit.framework.Test;
-
-import javax.jms.Destination;
-import javax.jms.ConnectionFactory;
import javax.jms.Connection;
-import javax.jms.Session;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
+import javax.jms.Session;
import javax.jms.TextMessage;
+import junit.framework.Test;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.CombinationTestSupport;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.util.MessageIdList;
+import org.apache.activemq.xbean.XBeanBrokerFactory;
+
public class TwoBrokerMulticastQueueTest extends CombinationTestSupport {
public static Test suite() {
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueClientsReconnectTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueClientsReconnectTest.java
index fc47d721fe..3f4d9046d2 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueClientsReconnectTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueClientsReconnectTest.java
@@ -16,16 +16,17 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.JmsMultipleBrokersTestSupport;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.ActiveMQPrefetchPolicy;
+import java.net.URI;
+import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.Message;
-import javax.jms.Connection;
-import javax.jms.Session;
import javax.jms.MessageConsumer;
-import java.net.URI;
+import javax.jms.Session;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.ActiveMQPrefetchPolicy;
+import org.apache.activemq.JmsMultipleBrokersTestSupport;
/**
* @version $Revision: 1.1.1.1 $
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingHttpTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingHttpTest.java
index 292c1c38e2..3efb946dd1 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingHttpTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingHttpTest.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.ActiveMQConnectionFactory;
-
import javax.jms.JMSException;
+import org.apache.activemq.ActiveMQConnectionFactory;
+
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingJavaConfigurationTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingJavaConfigurationTest.java
index 65ae939173..86f39661f0 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingJavaConfigurationTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingJavaConfigurationTest.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.usecases;
+import javax.jms.JMSException;
+
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;
-import javax.jms.JMSException;
-
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingTcpTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingTcpTest.java
index e022f9dec8..0ed09d0c4f 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingTcpTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingTcpTest.java
@@ -19,14 +19,11 @@ package org.apache.activemq.usecases;
import javax.jms.JMSException;
import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.xbean.BrokerFactoryBean;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
+import org.apache.activemq.xbean.BrokerFactoryBean;
import org.springframework.core.io.ClassPathResource;
-import java.io.IOException;
-import java.net.URISyntaxException;
-
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoMulticastDiscoveryBrokerTopicSendReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoMulticastDiscoveryBrokerTopicSendReceiveTest.java
index 367ca58f82..15b8e550f1 100644
--- a/activemq-core/src/test/java/org/apache/activemq/usecases/TwoMulticastDiscoveryBrokerTopicSendReceiveTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TwoMulticastDiscoveryBrokerTopicSendReceiveTest.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.usecases;
-import org.apache.activemq.ActiveMQConnectionFactory;
-
import javax.jms.JMSException;
+import org.apache.activemq.ActiveMQConnectionFactory;
+
/**
* @version $Revision: 1.1.1.1 $
*/
diff --git a/activemq-core/src/test/java/org/apache/activemq/util/DataByteArrayOutputStreamTest.java b/activemq-core/src/test/java/org/apache/activemq/util/DataByteArrayOutputStreamTest.java
index 117b1b3684..9c12f22daa 100644
--- a/activemq-core/src/test/java/org/apache/activemq/util/DataByteArrayOutputStreamTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/util/DataByteArrayOutputStreamTest.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.util;
-import junit.framework.TestCase;
-
import java.io.IOException;
+import junit.framework.TestCase;
+
public class DataByteArrayOutputStreamTest extends TestCase {
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/util/MarshallingSupportTest.java b/activemq-core/src/test/java/org/apache/activemq/util/MarshallingSupportTest.java
index 2583a9747f..c551a9fc0e 100644
--- a/activemq-core/src/test/java/org/apache/activemq/util/MarshallingSupportTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/util/MarshallingSupportTest.java
@@ -4,8 +4,8 @@
package org.apache.activemq.util;
-import java.io.IOException;
import java.util.Properties;
+
import junit.framework.TestCase;
/**
diff --git a/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithEmbeddedBrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithEmbeddedBrokerTest.java
index b9f24cdf65..5f6df74ec9 100644
--- a/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithEmbeddedBrokerTest.java
+++ b/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithEmbeddedBrokerTest.java
@@ -16,10 +16,10 @@
*/
package org.apache.activemq.xbean;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
-
import javax.jms.Connection;
+import org.apache.activemq.EmbeddedBrokerTestSupport;
+
/**
*
* @author Neil Clayton