You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2015/08/04 20:54:20 UTC

[1/4] activemq git commit: Adding in 5.12.0 for the upcoming release.

Repository: activemq
Updated Branches:
  refs/heads/master da36f78a6 -> 82e3ce805


Adding in 5.12.0 for the upcoming release.

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/7f4bf843
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/7f4bf843
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/7f4bf843

Branch: refs/heads/master
Commit: 7f4bf84342f08c5c37a801a58edd52d3015a9cd8
Parents: da36f78
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon Aug 3 18:50:40 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Mon Aug 3 18:50:40 2015 -0400

----------------------------------------------------------------------
 activemq-spring/src/main/resources/META-INF/spring.schemas | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/7f4bf843/activemq-spring/src/main/resources/META-INF/spring.schemas
----------------------------------------------------------------------
diff --git a/activemq-spring/src/main/resources/META-INF/spring.schemas b/activemq-spring/src/main/resources/META-INF/spring.schemas
index 6b219b6..225e99a 100644
--- a/activemq-spring/src/main/resources/META-INF/spring.schemas
+++ b/activemq-spring/src/main/resources/META-INF/spring.schemas
@@ -5,9 +5,9 @@
 ## The ASF licenses this file to You under the Apache License, Version 2.0
 ## (the "License"); you may not use this file except in compliance with
 ## the License.  You may obtain a copy of the License at
-## 
+##
 ## http://www.apache.org/licenses/LICENSE-2.0
-## 
+##
 ## Unless required by applicable law or agreed to in writing, software
 ## distributed under the License is distributed on an "AS IS" BASIS,
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,6 +37,7 @@ http\://activemq.apache.org/schema/core/activemq-core-5.9.1.xsd=activemq.xsd
 http\://activemq.apache.org/schema/core/activemq-core-5.10.0.xsd=activemq.xsd
 http\://activemq.apache.org/schema/core/activemq-core-5.10.1.xsd=activemq.xsd
 http\://activemq.apache.org/schema/core/activemq-core-5.11.0.xsd=activemq.xsd
+http\://activemq.apache.org/schema/core/activemq-core-5.12.0.xsd=activemq.xsd
 
 http\://camel.apache.org/schema/osgi/camel-osgi.xsd=camel-osgi.xsd
 http\://camel.apache.org/schema/spring/camel-spring.xsd=camel-spring.xsd


[2/4] activemq git commit: Fix a bunch of javadoc warnings produced during release profile builds.

Posted by ta...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/util/osgi/Activator.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/util/osgi/Activator.java b/activemq-broker/src/main/java/org/apache/activemq/util/osgi/Activator.java
index 80a1431..b33c3a5 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/util/osgi/Activator.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/util/osgi/Activator.java
@@ -75,9 +75,9 @@ public class Activator implements BundleActivator, SynchronousBundleListener, Ob
 
         debug("activating");
         this.bundleContext = bundleContext;
-        
+
         cachePackageCapabilities(Service.class, Transport.class, DiscoveryAgent.class, PersistenceAdapter.class);
-        
+
         debug("checking existing bundles");
         bundleContext.addBundleListener(this);
         for (Bundle bundle : bundleContext.getBundles()) {
@@ -91,7 +91,7 @@ public class Activator implements BundleActivator, SynchronousBundleListener, Ob
 
     /**
      * Caches the package capabilities that are needed for a set of interface classes
-     *  
+     *
      * @param classes interfaces we want to track
      */
     private void cachePackageCapabilities(Class<?> ... classes) {
@@ -100,7 +100,7 @@ public class Activator implements BundleActivator, SynchronousBundleListener, Ob
         for (Class<?> clazz: classes) {
             packageNames.add(clazz.getPackage().getName());
         }
-        
+
         List<BundleCapability> ourExports = ourWiring.getCapabilities(PACKAGE_NAMESPACE);
         for (BundleCapability ourExport : ourExports) {
             String ourPkgName = (String) ourExport.getAttributes().get(PACKAGE_NAMESPACE);
@@ -243,9 +243,9 @@ public class Activator implements BundleActivator, SynchronousBundleListener, Ob
     /**
      * We consider a bundle to be a candidate for objects if it imports at least
      * one of the packages of our interfaces
-     * 
+     *
      * @param bundle
-     * @return
+     * @return true if the bundle is improting.
      */
     private boolean isImportingUs(Bundle bundle) {
         BundleWiring wiring = bundle.adapt(BundleWiring.class);


[3/4] activemq git commit: Fix a bunch of javadoc warnings produced during release profile builds.

Posted by ta...@apache.org.
Fix a bunch of javadoc warnings produced during release profile builds.

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/5e05df1c
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/5e05df1c
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/5e05df1c

Branch: refs/heads/master
Commit: 5e05df1cb76af9a4d2e7d59cb3711747c5814b75
Parents: 7f4bf84
Author: Timothy Bish <ta...@gmail.com>
Authored: Tue Aug 4 11:54:46 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Tue Aug 4 11:54:46 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/activemq/broker/Broker.java | 18 ++--
 .../apache/activemq/broker/BrokerService.java   |  3 -
 .../org/apache/activemq/broker/Connection.java  | 23 +++---
 .../activemq/broker/ConnectionContext.java      |  2 +-
 .../java/org/apache/activemq/broker/Locker.java |  4 +-
 .../activemq/broker/PublishedAddressPolicy.java |  5 +-
 .../activemq/broker/jmx/AnnotatedMBean.java     | 20 ++---
 .../broker/jmx/CompositeDataHelper.java         | 10 ++-
 .../broker/jmx/ConnectionViewMBean.java         |  6 +-
 .../activemq/broker/jmx/ConnectorViewMBean.java |  2 +-
 .../broker/jmx/DestinationViewMBean.java        | 13 +--
 .../activemq/broker/jmx/HealthViewMBean.java    |  7 +-
 .../jmx/InactiveDurableSubscriptionView.java    |  3 +-
 .../broker/jmx/Log4JConfigViewMBean.java        |  4 +-
 .../activemq/broker/jmx/ManagementContext.java  |  2 +-
 .../activemq/broker/jmx/ProducerViewMBean.java  |  4 +-
 .../broker/jmx/SubscriptionViewMBean.java       |  5 +-
 .../broker/region/PrefetchSubscription.java     |  2 +-
 .../broker/region/QueueDispatchSelector.java    | 13 ++-
 .../activemq/broker/region/Subscription.java    |  5 +-
 .../cursors/QueueDispatchPendingList.java       | 12 +--
 .../java/org/apache/activemq/memory/Cache.java  | 20 ++---
 .../org/apache/activemq/memory/CacheEntry.java  |  3 -
 .../activemq/network/LdapNetworkConnector.java  | 25 ++++--
 .../activemq/network/jms/JmsConnector.java      |  2 +-
 .../network/jms/ReconnectionPolicy.java         |  2 +-
 .../network/jms/SimpleJmsQueueConnector.java    | 22 ++---
 .../network/jms/SimpleJmsTopicConnector.java    | 23 +++---
 .../activemq/network/jms/TopicBridge.java       | 10 ++-
 .../plugin/DiscardingDLQBrokerPlugin.java       | 11 ++-
 .../ForcePersistencyModeBrokerPlugin.java       | 86 ++++++++++----------
 .../plugin/SubQueueSelectorCacheBroker.java     |  5 +-
 .../SubQueueSelectorCacheBrokerPlugin.java      |  7 +-
 .../JaasCertificateAuthenticationBroker.java    |  2 +-
 .../activemq/store/TopicMessageStore.java       | 40 +++++----
 .../activemq/store/TopicReferenceStore.java     | 46 +++++++----
 .../transport/TransportLoggerFactory.java       | 22 ++---
 .../org/apache/activemq/util/HexSupport.java    | 34 ++++----
 .../java/org/apache/activemq/util/IOHelper.java |  4 +-
 .../org/apache/activemq/util/LinkedNode.java    |  6 +-
 .../apache/activemq/util/osgi/Activator.java    | 12 +--
 41 files changed, 294 insertions(+), 251 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/Broker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/Broker.java b/activemq-broker/src/main/java/org/apache/activemq/broker/Broker.java
index 5d052e9..fa8e4fd 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/Broker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/Broker.java
@@ -42,8 +42,6 @@ import org.apache.activemq.usage.Usage;
 /**
  * The Message Broker which routes messages, maintains subscriptions and
  * connections, acknowledges messages and handles transactions.
- *
- *
  */
 public interface Broker extends Region, Service {
 
@@ -51,7 +49,7 @@ public interface Broker extends Region, Service {
      * Get a Broker from the Broker Stack that is a particular class
      *
      * @param type
-     * @return
+     * @return a Broker instance.
      */
     Broker getAdaptor(Class type);
 
@@ -117,7 +115,7 @@ public interface Broker extends Region, Service {
     /**
      * Adds a producer.
      *
-     * @param context the enviorment the operation is being executed under.
+     * @param context the environment the operation is being executed under.
      * @throws Exception TODO
      */
     @Override
@@ -126,7 +124,7 @@ public interface Broker extends Region, Service {
     /**
      * Removes a producer.
      *
-     * @param context the enviorment the operation is being executed under.
+     * @param context the environment the operation is being executed under.
      * @throws Exception TODO
      */
     @Override
@@ -146,8 +144,10 @@ public interface Broker extends Region, Service {
 
     /**
      * return a reference destination map of a region based on the destination type
+     *
      * @param destination
-     * @return
+     *
+     * @return destination Map
      */
     public Map<ActiveMQDestination, Destination> getDestinationMap(ActiveMQDestination destination);
 
@@ -155,7 +155,7 @@ public interface Broker extends Region, Service {
      * Gets a list of all the prepared xa transactions.
      *
      * @param context transaction ids
-     * @return
+     * @return array of TransactionId values
      * @throws Exception TODO
      */
     TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception;
@@ -186,7 +186,6 @@ public interface Broker extends Region, Service {
      * @param xid
      * @throws Exception TODO
      */
-
     void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception;
 
     /**
@@ -253,6 +252,7 @@ public interface Broker extends Region, Service {
      *
      * @param context
      * @param info
+     *
      * @throws Exception
      */
     void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception;
@@ -318,7 +318,7 @@ public interface Broker extends Region, Service {
      *
      * @param context
      * @param messageReference
-     * @param subscription, may be null
+     * @param subscription (may be null)
      */
     void messageExpired(ConnectionContext context, MessageReference messageReference, Subscription subscription);
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java
index 0290a76..5c12069 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java
@@ -2242,8 +2242,6 @@ public class BrokerService implements Service {
      * Factory method to create a new broker
      *
      * @throws Exception
-     * @throws
-     * @throws
      */
     protected Broker createBroker() throws Exception {
         regionBroker = createRegionBroker();
@@ -3037,7 +3035,6 @@ public class BrokerService implements Service {
 
     /**
      * Sets if the broker allowed to restart on shutdown.
-     * @return
      */
     public void setRestartAllowed(boolean restartAllowed) {
         this.restartAllowed = restartAllowed;

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/Connection.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/Connection.java b/activemq-broker/src/main/java/org/apache/activemq/broker/Connection.java
index 416827b..8548a95 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/Connection.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/Connection.java
@@ -16,16 +16,16 @@
  */
 package org.apache.activemq.broker;
 
+import java.io.IOException;
+
 import org.apache.activemq.Service;
 import org.apache.activemq.broker.region.ConnectionStatistics;
 import org.apache.activemq.command.Command;
 import org.apache.activemq.command.ConnectionControl;
 import org.apache.activemq.command.Response;
 
-import java.io.IOException;
-
 /**
- * 
+ *
  */
 public interface Connection extends Service {
 
@@ -36,21 +36,21 @@ public interface Connection extends Service {
 
     /**
      * Sends a message to the client.
-     * 
+     *
      * @param message the message to send to the client.
      */
     void dispatchSync(Command message);
 
     /**
      * Sends a message to the client.
-     * 
+     *
      * @param command
      */
     void dispatchAsync(Command command);
 
     /**
      * Services a client command and submits it to the broker.
-     * 
+     *
      * @param command
      * @return Response
      */
@@ -58,7 +58,7 @@ public interface Connection extends Service {
 
     /**
      * Handles an unexpected error associated with a connection.
-     * 
+     *
      * @param error
      */
     void serviceException(Throwable error);
@@ -106,18 +106,19 @@ public interface Connection extends Service {
     void serviceExceptionAsync(IOException e);
 
     String getConnectionId();
-    
+
     /**
      * return true if a network connection
-     * @return
+     *
+     * @return if this is a network connection
      */
     boolean isNetworkConnection();
-    
+
     /**
      * @return true if a fault tolerant connection
      */
     boolean isFaultTolerantConnection();
-    
+
     void updateClient(ConnectionControl control);
 
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/ConnectionContext.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/ConnectionContext.java b/activemq-broker/src/main/java/org/apache/activemq/broker/ConnectionContext.java
index 66d4a1c..8c4db9a 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/ConnectionContext.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/ConnectionContext.java
@@ -186,7 +186,7 @@ public class ConnectionContext {
     }
 
     /**
-     * @return
+     * @return true if in recovery mode.
      */
     public boolean isInRecoveryMode() {
         return inRecoveryMode;

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/Locker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/Locker.java b/activemq-broker/src/main/java/org/apache/activemq/broker/Locker.java
index 11a2636..f6bc4b6 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/Locker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/Locker.java
@@ -16,11 +16,11 @@
  */
 package org.apache.activemq.broker;
 
+import java.io.IOException;
+
 import org.apache.activemq.Service;
 import org.apache.activemq.store.PersistenceAdapter;
 
-import java.io.IOException;
-
 /**
  * Represents a lock service to ensure that a broker is the only master
  */

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/PublishedAddressPolicy.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/PublishedAddressPolicy.java b/activemq-broker/src/main/java/org/apache/activemq/broker/PublishedAddressPolicy.java
index f620185..53aeead 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/PublishedAddressPolicy.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/PublishedAddressPolicy.java
@@ -22,7 +22,6 @@ import java.net.UnknownHostException;
 import java.util.HashMap;
 import java.util.Locale;
 
-import org.apache.activemq.transport.vm.VMTransport;
 import org.apache.activemq.util.InetAddressUtil;
 
 /**
@@ -96,7 +95,9 @@ public class PublishedAddressPolicy {
      * logic for this method.
      *
      * @param uriHostEntry
-     * @return
+     *
+     * @return the value published for the given host.
+     *
      * @throws UnknownHostException
      */
     protected String getPublishedHostValue(String uriHostEntry) throws UnknownHostException {

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java
index a2bdd62..aa8e8ab 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java
@@ -138,7 +138,8 @@ public class AnnotatedMBean extends StandardMBean {
      * Extracts the Method from the MBeanOperationInfo
      *
      * @param op
-     * @return
+     *
+     * @return a Method
      */
     private Method getMethod(MBeanOperationInfo op) {
         final MBeanParameterInfo[] params = op.getSignature();
@@ -156,7 +157,8 @@ public class AnnotatedMBean extends StandardMBean {
      * @param mbean
      * @param method
      * @param params
-     * @return
+     *
+     * @return a Method
      */
     private static Method getMethod(Class<?> mbean, String method, String... params) {
         try {
@@ -216,13 +218,11 @@ public class AnnotatedMBean extends StandardMBean {
         return super.invoke(s, objects, strings);
     }
 
-    private Method getMBeanMethod(Class clazz, String methodName, String[] signature) throws ReflectiveOperationException
-    {
-       Class[] parameterTypes = new Class[signature.length];
-       for (int i = 0; i < signature.length; i++)
-       {
-          parameterTypes[i] = Class.forName(signature[i]);
-       }
-       return clazz.getMethod(methodName, parameterTypes);
+    private Method getMBeanMethod(Class clazz, String methodName, String[] signature) throws ReflectiveOperationException {
+        Class[] parameterTypes = new Class[signature.length];
+        for (int i = 0; i < signature.length; i++) {
+            parameterTypes[i] = Class.forName(signature[i]);
+        }
+        return clazz.getMethod(methodName, parameterTypes);
     }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/CompositeDataHelper.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/CompositeDataHelper.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/CompositeDataHelper.java
index 73a7917..b9614b1 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/CompositeDataHelper.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/CompositeDataHelper.java
@@ -17,14 +17,15 @@
  */
 package org.apache.activemq.broker.jmx;
 
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.TabularData;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.TabularData;
+
 /**
- * 
+ *
  */
 public class CompositeDataHelper {
 
@@ -56,7 +57,8 @@ public class CompositeDataHelper {
      * object
      *
      * @param cdata
-     * @return
+     *
+     * @return a Map of user properties
      */
     public static Map getMessageUserProperties(CompositeData cdata) {
         Map map = new HashMap();

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java
index 843ba49..cd1210a 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java
@@ -19,12 +19,9 @@ package org.apache.activemq.broker.jmx;
 import javax.management.ObjectName;
 
 import org.apache.activemq.Service;
-import org.apache.activemq.broker.TransportConnectionState;
-import org.apache.activemq.state.TransactionState;
-
-import java.util.Collection;
 
 public interface ConnectionViewMBean extends Service {
+
     /**
      * @return true if the Connection is slow
      */
@@ -118,4 +115,5 @@ public interface ConnectionViewMBean extends Service {
      */
     @MBeanInfo("The age in ms of the oldest active transaction established on this Connection.")
     public Long getOldestActiveTransactionDuration();
+
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java
index 6649af2..647d34a 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java
@@ -52,7 +52,7 @@ public interface ConnectorViewMBean extends Service {
     /**
      * Returns true if link stealing is enabled on this Connector
      *
-     * @returns true if link stealing is enabled.
+     * @return true if link stealing is enabled.
      */
     @MBeanInfo("Link Stealing enabled")
     boolean isAllowLinkStealingEnabled();

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
index aedc15d..8d41a53 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
@@ -36,7 +36,7 @@ public interface DestinationViewMBean {
     String getName();
 
     /**
-     * Resets the managment counters.
+     * Resets the management counters.
      */
     @MBeanInfo("Resets statistics.")
     void resetStatistics();
@@ -122,9 +122,9 @@ public interface DestinationViewMBean {
     long getQueueSize();
 
     /**
-     * Returns the memory size of all messages in this destination's store 
+     * Returns the memory size of all messages in this destination's store
      *
-     * @return Returns the memory size of all messages in this destination's store 
+     * @return Returns the memory size of all messages in this destination's store
      */
     @MBeanInfo("The memory size of all messages in this destination's store.")
     long getStoreMessageSize();
@@ -193,7 +193,7 @@ public interface DestinationViewMBean {
      * @param body the text to send
      * @param user
      * @param password
-     * @return
+     * @return a string value
      * @throws Exception
      */
     @MBeanInfo("Sends a TextMessage to a password-protected destination.")
@@ -206,11 +206,14 @@ public interface DestinationViewMBean {
      * @param body the text to send
      * @param user
      * @param password
-     * @return
+     *
+     * @return a string value
+     *
      * @throws Exception
      */
     @MBeanInfo("Sends a TextMessage to a password-protected destination.")
     String sendTextMessage(@MBeanInfo("headers") Map<String,String> headers, @MBeanInfo("body") String body, @MBeanInfo("user") String user, @MBeanInfo("password") String password) throws Exception;
+
     /**
      * @return the percentage of amount of memory used
      */

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/HealthViewMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/HealthViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/HealthViewMBean.java
index aa1b520..2adf140 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/HealthViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/HealthViewMBean.java
@@ -16,9 +16,10 @@
  */
 package org.apache.activemq.broker.jmx;
 
-import javax.management.openmbean.TabularData;
 import java.util.List;
 
+import javax.management.openmbean.TabularData;
+
 /**
  * Returns the status events of the broker to indicate any warnings.
  */
@@ -31,13 +32,13 @@ public interface HealthViewMBean {
      * of {@link HealthStatus} on your classpath or you use something
      * like <a href="http://jolokia.org/">jolokia</a> to access JMX.
      *
-     * If in doubt, please use the {@link #status()} method instead!
+     * If in doubt, please use the {@link #getCurrentStatus()} method instead!
      */
     @MBeanInfo("List of warnings and errors about the current health of the Broker - empty list is Good!")
     List<HealthStatus> healthList() throws Exception;
 
     /**
-     * @return  String representation of the current Broker state
+     * @return String representation of the current Broker state
      */
     @MBeanInfo("String representation of current Broker state")
     String getCurrentStatus();

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java
index 3602a3a..65e49f4 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java
@@ -38,9 +38,10 @@ public class InactiveDurableSubscriptionView extends DurableSubscriptionView imp
      * Constructor
      *
      * @param broker
+     * @param brokerService
      * @param clientId
-     * @param userName
      * @param subInfo
+     * @param subscription
      */
     public InactiveDurableSubscriptionView(ManagedRegionBroker broker, BrokerService brokerService, String clientId, SubscriptionInfo subInfo, Subscription subscription) {
         super(broker, brokerService, clientId, null, subscription);

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/Log4JConfigViewMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/Log4JConfigViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/Log4JConfigViewMBean.java
index 2e67446..81c7722 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/Log4JConfigViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/Log4JConfigViewMBean.java
@@ -48,7 +48,7 @@ public interface Log4JConfigViewMBean {
     /**
      * list of all the logger names and their levels
      *
-     * @returns a List of all known loggers names.
+     * @return a List of all known loggers names.
      *
      * @throws Exception if an error occurs while getting the loggers.
      */
@@ -61,7 +61,7 @@ public interface Log4JConfigViewMBean {
      * @param loggerName
      *        the name of the logger whose level should be queried.
      *
-     * @returns the current log level of the given logger.
+     * @return the current log level of the given logger.
      *
      * @throws Exception if an error occurs while getting the log level.
      */

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
index b08d53c..907c0e6 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
@@ -521,7 +521,7 @@ public class ManagementContext implements Service {
     }
 
     /**
-     * @return
+     * @return an MBeanServer instance
      * @throws NullPointerException
      * @throws MalformedObjectNameException
      * @throws IOException

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ProducerViewMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ProducerViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ProducerViewMBean.java
index 4776283..cdf3754 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ProducerViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ProducerViewMBean.java
@@ -67,13 +67,13 @@ public interface ProducerViewMBean {
     boolean isDestinationTemporary();
 
     /**
-     * @returns the windows size configured for the producer
+     * @return the windows size configured for the producer
      */
     @MBeanInfo("Configured Window Size for the Producer")
     int getProducerWindowSize();
 
     /**
-     * @returns if the Producer is configured for Async dispatch
+     * @return if the Producer is configured for Async dispatch
      */
     @MBeanInfo("Is the producer configured for Async Dispatch")
     boolean isDispatchAsync();

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java
index 3c3aab3..1907b98 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java
@@ -113,9 +113,8 @@ public interface SubscriptionViewMBean {
     int getDispatchedQueueSize();
 
     /**
-     * The same as the number of messages dispatched -
-     * making it explicit
-     * @return
+     * The same as the number of messages dispatched - making it explicit
+     * @return number of messages waiting for an acknowledge.
      */
     @MBeanInfo("Number of messages dispatched awaiting acknowledgement.")
     int getMessageCountAwaitingAcknowledge();

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
index ebd8a7d..ef1b372 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
@@ -548,7 +548,7 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
     /**
      * Used to determine if the broker can dispatch to the consumer.
      *
-     * @return
+     * @return true if the subscription is full
      */
     @Override
     public boolean isFull() {

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueDispatchSelector.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueDispatchSelector.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueDispatchSelector.java
index 56f6076..7d3f69f 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueDispatchSelector.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueDispatchSelector.java
@@ -23,9 +23,9 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Queue dispatch policy that determines if a message can be sent to a subscription
- * 
+ *
  * @org.apache.xbean.XBean
- * 
+ *
  */
 public class QueueDispatchSelector extends SimpleDispatchSelector {
     private static final Logger LOG = LoggerFactory.getLogger(QueueDispatchSelector.class);
@@ -38,22 +38,21 @@ public class QueueDispatchSelector extends SimpleDispatchSelector {
     public QueueDispatchSelector(ActiveMQDestination destination) {
         super(destination);
     }
-    
+
     public Subscription getExclusiveConsumer() {
         return exclusiveConsumer;
     }
     public void setExclusiveConsumer(Subscription exclusiveConsumer) {
         this.exclusiveConsumer = exclusiveConsumer;
     }
-    
+
     public boolean isExclusiveConsumer(Subscription s) {
         return s == this.exclusiveConsumer;
     }
-    
-       
+
     public boolean canSelect(Subscription subscription,
             MessageReference m) throws Exception {
-       
+
         boolean result = !paused && super.canDispatch(subscription, m);
         if (result && !subscription.isBrowser()) {
             result = exclusiveConsumer == null || exclusiveConsumer == subscription;

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/region/Subscription.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Subscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Subscription.java
index 2c8afed..9452b99 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Subscription.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Subscription.java
@@ -21,6 +21,7 @@ import java.util.List;
 
 import javax.jms.InvalidSelectorException;
 import javax.management.ObjectName;
+
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ConsumerInfo;
@@ -66,7 +67,7 @@ public interface Subscription extends SubscriptionRecovery {
      * Is the subscription interested in the message?
      * @param node
      * @param context
-     * @return
+     * @return true if matching
      * @throws IOException
      */
     boolean matches(MessageReference node, MessageEvaluationContext context) throws IOException;
@@ -74,7 +75,7 @@ public interface Subscription extends SubscriptionRecovery {
     /**
      * Is the subscription interested in messages in the destination?
      * @param destination
-     * @return
+     * @return true if matching
      */
     boolean matches(ActiveMQDestination destination);
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/QueueDispatchPendingList.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/QueueDispatchPendingList.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/QueueDispatchPendingList.java
index 8c6032b..380569e 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/QueueDispatchPendingList.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/QueueDispatchPendingList.java
@@ -16,15 +16,15 @@
  */
 package org.apache.activemq.broker.region.cursors;
 
-import org.apache.activemq.broker.region.MessageReference;
-import org.apache.activemq.broker.region.QueueMessageReference;
-import org.apache.activemq.command.MessageId;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.activemq.broker.region.MessageReference;
+import org.apache.activemq.broker.region.QueueMessageReference;
+import org.apache.activemq.command.MessageId;
+
 /**
  * An abstraction that keeps the correct order of messages that need to be dispatched
  * to consumers, but also hides the fact that there might be redelivered messages that
@@ -60,7 +60,7 @@ public class QueueDispatchPendingList implements PendingList {
      * @param message
      *      The MessageReference that is to be added to this list.
      *
-     * @return
+     * @return the pending node.
      */
     @Override
     public PendingNode addMessageFirst(MessageReference message) {
@@ -74,7 +74,7 @@ public class QueueDispatchPendingList implements PendingList {
      * @param message
      *      The MessageReference that is to be added to this list.
      *
-     * @return
+     * @return the pending node.
      */
     @Override
     public PendingNode addMessageLast(MessageReference message) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/memory/Cache.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/memory/Cache.java b/activemq-broker/src/main/java/org/apache/activemq/memory/Cache.java
index fcd713d..835d2f4 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/memory/Cache.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/memory/Cache.java
@@ -18,15 +18,13 @@ package org.apache.activemq.memory;
 
 /**
  * Defines the interface used to cache messages.
- * 
- * 
  */
 public interface Cache {
 
     /**
      * Gets an object that was previously <code>put</code> into this object.
-     * 
-     * @param msgid
+     *
+     * @param key
      * @return null if the object was not previously put or if the object has
      *         expired out of the cache.
      */
@@ -34,16 +32,16 @@ public interface Cache {
 
     /**
      * Puts an object into the cache.
-     * 
-     * @param messageID
-     * @param message
+     *
+     * @param key
+     * @param value
      */
     Object put(Object key, Object value);
 
     /**
      * Removes an object from the cache.
-     * 
-     * @param messageID
+     *
+     * @param key
      * @return the object associated with the key if it was still in the cache.
      */
     Object remove(Object key);
@@ -56,8 +54,8 @@ public interface Cache {
 
     /**
      * How big is the cache right now?
-     * 
-     * @return
+     *
+     * @return the size.
      */
     int size();
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/memory/CacheEntry.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/memory/CacheEntry.java b/activemq-broker/src/main/java/org/apache/activemq/memory/CacheEntry.java
index 8f256cf..e855302 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/memory/CacheEntry.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/memory/CacheEntry.java
@@ -31,8 +31,6 @@ public class CacheEntry {
     }
 
     /**
-     * 
-     * @param entry
      * @return false if you are trying to remove the tail pointer.
      */
     public boolean remove() {
@@ -53,5 +51,4 @@ public class CacheEntry {
 
         return true;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java b/activemq-broker/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java
index 0d3342e..341ea30 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java
@@ -98,7 +98,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * sets the LDAP server URI
      *
-     * @param _uri
+     * @param uri
      *            LDAP server URI
      */
     public void setUri(URI uri) throws Exception {
@@ -114,7 +114,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * sets the base LDAP dn used for lookup operations
      *
-     * @param _base
+     * @param base
      *            LDAP base dn
      */
     public void setBase(String base) {
@@ -124,7 +124,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * sets the LDAP user for access credentials
      *
-     * @param _user
+     * @param user
      *            LDAP dn of user
      */
     public void setUser(String user) {
@@ -134,9 +134,10 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * sets the LDAP password for access credentials
      *
-     * @param _password
+     * @param password
      *            user password
      */
+    @Override
     public void setPassword(String password) {
         this.password = password;
     }
@@ -144,7 +145,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * sets LDAP anonymous authentication access credentials
      *
-     * @param _anonymousAuthentication
+     * @param anonymousAuthentication
      *            set to true to use anonymous authentication
      */
     public void setAnonymousAuthentication(boolean anonymousAuthentication) {
@@ -154,7 +155,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * sets the LDAP search scope
      *
-     * @param _searchScope
+     * @param searchScope
      *            LDAP JNDI search scope
      */
     public void setSearchScope(String searchScope) throws Exception {
@@ -174,7 +175,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * sets the LDAP search filter as defined in RFC 2254
      *
-     * @param _searchFilter
+     * @param searchFilter
      *            LDAP search filter
      * @see <a href="http://www.faqs.org/rfcs/rfc2254.html">RFC 2254</a>
      */
@@ -186,7 +187,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
      * enables/disable a persistent search to the LDAP server as defined in
      * draft-ietf-ldapext-psearch-03.txt (2.16.840.1.113730.3.4.3)
      *
-     * @param _searchEventListener
+     * @param searchEventListener
      *            enable = true, disable = false (default)
      * @see <a
      *      href="http://www.ietf.org/proceedings/01mar/I-D/draft-ietf-ldapext-psearch-03.txt">draft-ietf-ldapext-psearch-03.txt</a>
@@ -198,6 +199,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * start the connector
      */
+    @Override
     public void start() throws Exception {
         LOG.info("connecting...");
         Hashtable<String, String> env = new Hashtable<String, String>();
@@ -262,6 +264,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * stop the connector
      */
+    @Override
     public void stop() throws Exception {
         LOG.info("stopping context...");
         for (NetworkConnector connector : connectorMap.values()) {
@@ -273,6 +276,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
         context.close();
     }
 
+    @Override
     public String toString() {
         return this.getClass().getName() + getName() + "[" + ldapURI.toString() + "]";
     }
@@ -395,6 +399,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * invoked when an entry has been added during a persistent search
      */
+    @Override
     public void objectAdded(NamingEvent event) {
         LOG.debug("entry added");
         try {
@@ -407,6 +412,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * invoked when an entry has been removed during a persistent search
      */
+    @Override
     public void objectRemoved(NamingEvent event) {
         LOG.debug("entry removed");
         try {
@@ -419,6 +425,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * invoked when an entry has been renamed during a persistent search
      */
+    @Override
     public void objectRenamed(NamingEvent event) {
         LOG.debug("entry renamed");
         // XXX: getNameInNamespace method does not seem to work properly,
@@ -433,6 +440,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * invoked when an entry has been changed during a persistent search
      */
+    @Override
     public void objectChanged(NamingEvent event) {
         LOG.debug("entry changed");
         try {
@@ -447,6 +455,7 @@ public class LdapNetworkConnector extends NetworkConnector implements NamespaceC
     /**
      * invoked when an exception has occurred during a persistent search
      */
+    @Override
     public void namingExceptionThrown(NamingExceptionEvent event) {
         LOG.error("ERR: caught unexpected exception", event.getException());
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/jms/JmsConnector.java b/activemq-broker/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
index 388706f..73759d1 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
@@ -260,7 +260,7 @@ public abstract class JmsConnector implements Service {
     }
 
     /**
-     * @param inboundMessageConvertor The inboundMessageConvertor to set.
+     * @param jmsMessageConvertor The jmsMessageConvertor to set.
      */
     public void setInboundMessageConvertor(JmsMesageConvertor jmsMessageConvertor) {
         this.inboundMessageConvertor = jmsMessageConvertor;

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/network/jms/ReconnectionPolicy.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/jms/ReconnectionPolicy.java b/activemq-broker/src/main/java/org/apache/activemq/network/jms/ReconnectionPolicy.java
index e2de129..061ba2a 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/network/jms/ReconnectionPolicy.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/jms/ReconnectionPolicy.java
@@ -51,7 +51,7 @@ public class ReconnectionPolicy {
      * Sets the maximum number of a times a Message send should be retried before
      * a JMSExeception is thrown indicating that the operation failed.
      *
-     * @param maxRetries
+     * @param maxSendRetries
      * 			number of send retries that will be performed.
      */
     public void setMaxSendRetries(int maxSendRetries) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsQueueConnector.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsQueueConnector.java b/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsQueueConnector.java
index 2d9a470..47961e9 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsQueueConnector.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsQueueConnector.java
@@ -77,7 +77,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
     }
 
     /**
-     * @param localQueueConnectionFactory The localQueueConnectionFactory to
+     * @param localConnectionFactory The localQueueConnectionFactory to
      *                set.
      */
     public void setLocalQueueConnectionFactory(QueueConnectionFactory localConnectionFactory) {
@@ -99,8 +99,8 @@ public class SimpleJmsQueueConnector extends JmsConnector {
     }
 
     /**
-     * @param outboundQueueConnectionFactoryName The
-     *                outboundQueueConnectionFactoryName to set.
+     * @param foreignQueueConnectionFactoryName The
+     *                foreignQueueConnectionFactoryName to set.
      */
     public void setOutboundQueueConnectionFactoryName(String foreignQueueConnectionFactoryName) {
         this.outboundQueueConnectionFactoryName = foreignQueueConnectionFactoryName;
@@ -142,15 +142,14 @@ public class SimpleJmsQueueConnector extends JmsConnector {
     }
 
     /**
-     * @param outboundQueueConnection The outboundQueueConnection to set.
+     * @param foreignQueueConnection The foreignQueueConnection to set.
      */
     public void setOutboundQueueConnection(QueueConnection foreignQueueConnection) {
         this.foreignConnection.set(foreignQueueConnection);
     }
 
     /**
-     * @param outboundQueueConnectionFactory The outboundQueueConnectionFactory
-     *                to set.
+     * @param foreignQueueConnectionFactory The foreignQueueConnectionFactory to set.
      */
     public void setOutboundQueueConnectionFactory(QueueConnectionFactory foreignQueueConnectionFactory) {
         this.outboundQueueConnectionFactory = foreignQueueConnectionFactory;
@@ -166,7 +165,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
             if (outboundQueueConnectionFactory == null) {
                 // look it up from JNDI
                 if (outboundQueueConnectionFactoryName != null) {
-                    outboundQueueConnectionFactory = (QueueConnectionFactory)jndiOutboundTemplate
+                    outboundQueueConnectionFactory = jndiOutboundTemplate
                         .lookup(outboundQueueConnectionFactoryName, QueueConnectionFactory.class);
                     if (outboundUsername != null) {
                         newConnection = outboundQueueConnectionFactory
@@ -225,7 +224,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
                 if (embeddedConnectionFactory == null) {
                     // look it up from JNDI
                     if (localConnectionFactoryName != null) {
-                        localQueueConnectionFactory = (QueueConnectionFactory)jndiLocalTemplate
+                        localQueueConnectionFactory = jndiLocalTemplate
                             .lookup(localConnectionFactoryName, QueueConnectionFactory.class);
                         if (localUsername != null) {
                             newConnection = localQueueConnectionFactory
@@ -350,6 +349,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
         }
     }
 
+    @Override
     protected Destination createReplyToBridge(Destination destination, Connection replyToProducerConnection,
                                               Connection replyToConsumerConnection) {
         Queue replyToProducerQueue = (Queue)destination;
@@ -359,6 +359,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
             InboundQueueBridge bridge = (InboundQueueBridge)replyToBridges.get(replyToProducerQueue);
             if (bridge == null) {
                 bridge = new InboundQueueBridge() {
+                    @Override
                     protected Destination processReplyToDestination(Destination destination) {
                         return null;
                     }
@@ -390,6 +391,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
             OutboundQueueBridge bridge = (OutboundQueueBridge)replyToBridges.get(replyToProducerQueue);
             if (bridge == null) {
                 bridge = new OutboundQueueBridge() {
+                    @Override
                     protected Destination processReplyToDestination(Destination destination) {
                         return null;
                     }
@@ -430,7 +432,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
         if (preferJndiDestinationLookup) {
             try {
                 // look-up the Queue
-                result = (Queue)jndiOutboundTemplate.lookup(queueName, Queue.class);
+                result = jndiOutboundTemplate.lookup(queueName, Queue.class);
             } catch (NamingException e) {
                 try {
                     result = session.createQueue(queueName);
@@ -448,7 +450,7 @@ public class SimpleJmsQueueConnector extends JmsConnector {
             } catch (JMSException e) {
                 // look-up the Queue
                 try {
-                    result = (Queue)jndiOutboundTemplate.lookup(queueName, Queue.class);
+                    result = jndiOutboundTemplate.lookup(queueName, Queue.class);
                 } catch (NamingException e1) {
                     String errStr = "Failed to look-up Queue for name: " + queueName;
                     LOG.error(errStr, e);

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsTopicConnector.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsTopicConnector.java b/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsTopicConnector.java
index 68d91c3..b451ad7 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsTopicConnector.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/jms/SimpleJmsTopicConnector.java
@@ -80,8 +80,8 @@ public class SimpleJmsTopicConnector extends JmsConnector {
     /**
      * @param localTopicConnectionFactory The localTopicConnectionFactory to set.
      */
-    public void setLocalTopicConnectionFactory(TopicConnectionFactory localConnectionFactory) {
-        this.localTopicConnectionFactory = localConnectionFactory;
+    public void setLocalTopicConnectionFactory(TopicConnectionFactory localTopicConnectionFactory) {
+        this.localTopicConnectionFactory = localTopicConnectionFactory;
     }
 
     /**
@@ -99,7 +99,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
     }
 
     /**
-     * @param outboundTopicConnectionFactoryName The outboundTopicConnectionFactoryName to set.
+     * @param foreignTopicConnectionFactoryName The foreignTopicConnectionFactoryName to set.
      */
     public void setOutboundTopicConnectionFactoryName(String foreignTopicConnectionFactoryName) {
         this.outboundTopicConnectionFactoryName = foreignTopicConnectionFactoryName;
@@ -141,14 +141,14 @@ public class SimpleJmsTopicConnector extends JmsConnector {
     }
 
     /**
-     * @param outboundTopicConnection The outboundTopicConnection to set.
+     * @param foreignTopicConnection The foreignTopicConnection to set.
      */
     public void setOutboundTopicConnection(TopicConnection foreignTopicConnection) {
         this.foreignConnection.set(foreignTopicConnection);
     }
 
     /**
-     * @param outboundTopicConnectionFactory The outboundTopicConnectionFactory to set.
+     * @param foreignTopicConnectionFactory The foreignTopicConnectionFactory to set.
      */
     public void setOutboundTopicConnectionFactory(TopicConnectionFactory foreignTopicConnectionFactory) {
         this.outboundTopicConnectionFactory = foreignTopicConnectionFactory;
@@ -164,7 +164,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
             if (outboundTopicConnectionFactory == null) {
                 // look it up from JNDI
                 if (outboundTopicConnectionFactoryName != null) {
-                    outboundTopicConnectionFactory = (TopicConnectionFactory)jndiOutboundTemplate
+                    outboundTopicConnectionFactory = jndiOutboundTemplate
                         .lookup(outboundTopicConnectionFactoryName, TopicConnectionFactory.class);
                     if (outboundUsername != null) {
                         newConnection = outboundTopicConnectionFactory
@@ -223,7 +223,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
                 if (embeddedConnectionFactory == null) {
                     // look it up from JNDI
                     if (localConnectionFactoryName != null) {
-                        localTopicConnectionFactory = (TopicConnectionFactory)jndiLocalTemplate
+                        localTopicConnectionFactory = jndiLocalTemplate
                             .lookup(localConnectionFactoryName, TopicConnectionFactory.class);
                         if (localUsername != null) {
                             newConnection = localTopicConnectionFactory
@@ -348,6 +348,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
         }
     }
 
+    @Override
     protected Destination createReplyToBridge(Destination destination, Connection replyToProducerConnection,
                                               Connection replyToConsumerConnection) {
         Topic replyToProducerTopic = (Topic)destination;
@@ -357,6 +358,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
             InboundTopicBridge bridge = (InboundTopicBridge)replyToBridges.get(replyToProducerTopic);
             if (bridge == null) {
                 bridge = new InboundTopicBridge() {
+                    @Override
                     protected Destination processReplyToDestination(Destination destination) {
                         return null;
                     }
@@ -388,6 +390,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
             OutboundTopicBridge bridge = (OutboundTopicBridge)replyToBridges.get(replyToProducerTopic);
             if (bridge == null) {
                 bridge = new OutboundTopicBridge() {
+                    @Override
                     protected Destination processReplyToDestination(Destination destination) {
                         return null;
                     }
@@ -428,7 +431,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
         if (preferJndiDestinationLookup) {
             try {
                 // look-up the Queue
-                result = (Topic)jndiOutboundTemplate.lookup(topicName, Topic.class);
+                result = jndiOutboundTemplate.lookup(topicName, Topic.class);
             } catch (NamingException e) {
                 try {
                     result = session.createTopic(topicName);
@@ -446,7 +449,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
             } catch (JMSException e) {
                 // look-up the Topic
                 try {
-                    result = (Topic)jndiOutboundTemplate.lookup(topicName, Topic.class);
+                    result = jndiOutboundTemplate.lookup(topicName, Topic.class);
                 } catch (NamingException e1) {
                     String errStr = "Failed to look-up Topic for name: " + topicName;
                     LOG.error(errStr, e);
@@ -456,7 +459,7 @@ public class SimpleJmsTopicConnector extends JmsConnector {
                 }
             }
         }
+
         return result;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/network/jms/TopicBridge.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/jms/TopicBridge.java b/activemq-broker/src/main/java/org/apache/activemq/network/jms/TopicBridge.java
index 1480daf..189e120 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/network/jms/TopicBridge.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/jms/TopicBridge.java
@@ -43,6 +43,7 @@ class TopicBridge extends DestinationBridge {
     protected TopicConnection consumerConnection;
     protected TopicConnection producerConnection;
 
+    @Override
     public void stop() throws Exception {
         super.stop();
         if (consumerSession != null) {
@@ -53,6 +54,7 @@ class TopicBridge extends DestinationBridge {
         }
     }
 
+    @Override
     protected MessageConsumer createConsumer() throws JMSException {
         // set up the consumer
         if (consumerConnection == null) return null;
@@ -78,6 +80,7 @@ class TopicBridge extends DestinationBridge {
         return consumer;
     }
 
+    @Override
     protected synchronized MessageProducer createProducer() throws JMSException {
         if (producerConnection == null) return null;
         producerSession = producerConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -85,6 +88,7 @@ class TopicBridge extends DestinationBridge {
         return producer;
     }
 
+    @Override
     protected synchronized void sendMessage(Message message) throws JMSException {
         if (producer == null && createProducer() == null) {
             throw new JMSException("Producer for remote queue not available.");
@@ -119,14 +123,14 @@ class TopicBridge extends DestinationBridge {
     }
 
     /**
-     * @return Returns the subscriptionName.
+     * @return Returns the consumerName.
      */
     public String getConsumerName() {
         return consumerName;
     }
 
     /**
-     * @param subscriptionName The subscriptionName to set.
+     * @param consumerName The consumerName to set.
      */
     public void setConsumerName(String consumerName) {
         this.consumerName = consumerName;
@@ -188,10 +192,12 @@ class TopicBridge extends DestinationBridge {
         this.selector = selector;
     }
 
+    @Override
     protected Connection getConnnectionForConsumer() {
         return getConsumerConnection();
     }
 
+    @Override
     protected Connection getConnectionForProducer() {
         return getProducerConnection();
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/plugin/DiscardingDLQBrokerPlugin.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/plugin/DiscardingDLQBrokerPlugin.java b/activemq-broker/src/main/java/org/apache/activemq/plugin/DiscardingDLQBrokerPlugin.java
index 343bb15..227aed0 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/plugin/DiscardingDLQBrokerPlugin.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/plugin/DiscardingDLQBrokerPlugin.java
@@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
  * @version 1.0
  */
 public class DiscardingDLQBrokerPlugin implements BrokerPlugin {
+
     public DiscardingDLQBrokerPlugin() {
     }
 
@@ -41,12 +42,16 @@ public class DiscardingDLQBrokerPlugin implements BrokerPlugin {
     private int reportInterval = 1000;
 
     /**
-     * Installs the plugin into the interceptor chain of the broker, returning the new intercepted broker to use.
+     * Installs the plugin into the intercepter chain of the broker, returning the new
+     * intercepted broker to use.
+     *
      * @param broker Broker
-     * @throws Exception
+     *
      * @return Broker
-     * @todo Implement this org.apache.activemq.broker.BrokerPlugin method
+     *
+     * @throws Exception
      */
+    @Override
     public Broker installPlugin(Broker broker) throws Exception {
         log.info("Installing Discarding Dead Letter Queue broker plugin[dropAll={}; dropTemporaryTopics={}; dropTemporaryQueues={}; dropOnly={}; reportInterval={}]", new Object[]{
                 isDropAll(), isDropTemporaryTopics(), isDropTemporaryQueues(), getDropOnly(), reportInterval

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/plugin/ForcePersistencyModeBrokerPlugin.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/plugin/ForcePersistencyModeBrokerPlugin.java b/activemq-broker/src/main/java/org/apache/activemq/plugin/ForcePersistencyModeBrokerPlugin.java
index 5b6d6e4..585f8c0 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/plugin/ForcePersistencyModeBrokerPlugin.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/plugin/ForcePersistencyModeBrokerPlugin.java
@@ -16,58 +16,60 @@
  */
 package org.apache.activemq.plugin;
 
-
 import org.apache.activemq.broker.Broker;
 import org.apache.activemq.broker.BrokerPlugin;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 /**
- * A Plugin which allows to force every incoming message to be PERSISTENT or NON-PERSISTENT. 
- * 
- * Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent
- * messages. 
- *  @org.apache.xbean.XBean element="forcePersistencyModeBrokerPlugin"
+ * A Plugin which allows to force every incoming message to be PERSISTENT or
+ * NON-PERSISTENT.
+ *
+ * Useful, if you have set the broker usage policy to process ONLY persistent or
+ * ONLY non-persistent messages.
+ *
+ * @org.apache.xbean.XBean element="forcePersistencyModeBrokerPlugin"
  */
 public class ForcePersistencyModeBrokerPlugin implements BrokerPlugin {
-  private static Logger LOG = LoggerFactory.getLogger(ForcePersistencyModeBrokerPlugin.class);
-  private boolean persistenceFlag = false;
-  
-  /**
- * Constructor
- */
-public ForcePersistencyModeBrokerPlugin() {
-  }
+    private static Logger LOG = LoggerFactory.getLogger(ForcePersistencyModeBrokerPlugin.class);
+    private boolean persistenceFlag = false;
 
-  /** 
- * @param broker
- * @return the Broker
- * @throws Exception
- * @see org.apache.activemq.broker.BrokerPlugin#installPlugin(org.apache.activemq.broker.Broker)
- */
+    /**
+     * Constructor
+     */
+    public ForcePersistencyModeBrokerPlugin() {}
 
-  public Broker installPlugin(Broker broker) throws Exception{
-    ForcePersistencyModeBroker pB = new ForcePersistencyModeBroker(broker);
-    pB.setPersistenceFlag(isPersistenceForced());
-    LOG.info("Installing ForcePersistencyModeBroker plugin: persistency enforced={}", pB.isPersistent());
-    return pB;
-  }
+    /**
+     * @param broker
+     *
+     * @return the Broker
+     *
+     * @throws Exception
+     *
+     * @see org.apache.activemq.broker.BrokerPlugin#installPlugin(org.apache.activemq.broker.Broker)
+     */
+    @Override
+    public Broker installPlugin(Broker broker) throws Exception {
+        ForcePersistencyModeBroker pB = new ForcePersistencyModeBroker(broker);
+        pB.setPersistenceFlag(isPersistenceForced());
+        LOG.info("Installing ForcePersistencyModeBroker plugin: persistency enforced={}", pB.isPersistent());
+        return pB;
+    }
 
-  /** Sets the persistency mode.
-   *  
-   * @param persistenceFlag
-   */
-  public void setPersistenceFlag(final boolean persistenceFlag) {
-    this.persistenceFlag = persistenceFlag;
-  }
+    /**
+     * Sets the persistence mode.
+     *
+     * @param persistenceFlag
+     */
+    public void setPersistenceFlag(final boolean persistenceFlag) {
+        this.persistenceFlag = persistenceFlag;
+    }
 
-  /**
-   * @return the mode the (activated) plugin will set the message delivery mode 
-   */
-  public final boolean isPersistenceForced() {
-    return persistenceFlag;
-  }
-  
+    /**
+     * @return the mode the (activated) plugin will set the message delivery
+     *         mode
+     */
+    public final boolean isPersistenceForced() {
+        return persistenceFlag;
+    }
 }
-

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
index 9880ab7..f76f75e 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
@@ -52,8 +52,9 @@ import org.slf4j.LoggerFactory;
  * <p/>
  * This is influenced by code snippets developed by Maciej Rakowicz
  *
- * @see https://issues.apache.org/activemq/browse/AMQ-3004
- * @see http://mail-archives.apache.org/mod_mbox/activemq-users/201011.mbox/%3C8A013711-2613-450A-A487-379E784AF1D6@homeaway.co.uk%3E
+ * Refer to:
+ * https://issues.apache.org/activemq/browse/AMQ-3004
+ * http://mail-archives.apache.org/mod_mbox/activemq-users/201011.mbox/%3C8A013711-2613-450A-A487-379E784AF1D6@homeaway.co.uk%3E
  */
 public class SubQueueSelectorCacheBroker extends BrokerFilter implements Runnable {
     private static final Logger LOG = LoggerFactory.getLogger(SubQueueSelectorCacheBroker.class);

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBrokerPlugin.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBrokerPlugin.java b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBrokerPlugin.java
index 72be2cd..62072ac 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBrokerPlugin.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBrokerPlugin.java
@@ -16,13 +16,13 @@
  */
 package org.apache.activemq.plugin;
 
+import static org.apache.activemq.plugin.SubQueueSelectorCacheBroker.MAX_PERSIST_INTERVAL;
+
 import java.io.File;
 
 import org.apache.activemq.broker.Broker;
 import org.apache.activemq.broker.BrokerPlugin;
 
-import static org.apache.activemq.plugin.SubQueueSelectorCacheBroker.MAX_PERSIST_INTERVAL;
-
 /**
  * A plugin which allows the caching of the selector from a subscription queue.
  * <p/>
@@ -31,8 +31,7 @@ import static org.apache.activemq.plugin.SubQueueSelectorCacheBroker.MAX_PERSIST
  * <p/>
  * This is influenced by code snippets developed by Maciej Rakowicz
  *
- * @author Roelof Naude roelof(dot)naude(at)gmail.com
- *@org.apache.xbean.XBean element="virtualSelectorCacheBrokerPlugin"
+ * @org.apache.xbean.XBean element="virtualSelectorCacheBrokerPlugin"
  */
 public class SubQueueSelectorCacheBrokerPlugin implements BrokerPlugin {
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/security/JaasCertificateAuthenticationBroker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/security/JaasCertificateAuthenticationBroker.java b/activemq-broker/src/main/java/org/apache/activemq/security/JaasCertificateAuthenticationBroker.java
index bf80d69..c768e7d 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/security/JaasCertificateAuthenticationBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/security/JaasCertificateAuthenticationBroker.java
@@ -45,7 +45,7 @@ public class JaasCertificateAuthenticationBroker extends BrokerFilter implements
      * Simple constructor. Leaves everything to superclass.
      *
      * @param next The Broker that does the actual work for this Filter.
-     * @param jassConfiguration The JAAS domain configuration name (refere to
+     * @param jaasConfiguration The JAAS domain configuration name (refere to
      *                JAAS documentation).
      */
     public JaasCertificateAuthenticationBroker(Broker next, String jaasConfiguration) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/store/TopicMessageStore.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/store/TopicMessageStore.java b/activemq-broker/src/main/java/org/apache/activemq/store/TopicMessageStore.java
index 0343c11..163b184 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/store/TopicMessageStore.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/store/TopicMessageStore.java
@@ -17,7 +17,9 @@
 package org.apache.activemq.store;
 
 import java.io.IOException;
+
 import javax.jms.JMSException;
+
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.command.MessageAck;
 import org.apache.activemq.command.MessageId;
@@ -25,27 +27,27 @@ import org.apache.activemq.command.SubscriptionInfo;
 
 /**
  * A MessageStore for durable topic subscriptions
- * 
- * 
  */
 public interface TopicMessageStore extends MessageStore {
+
     /**
      * Stores the last acknowledged messgeID for the given subscription so that
      * we can recover and commence dispatching messages from the last checkpoint
-     * 
+     *
      * @param context
      * @param clientId
      * @param subscriptionName
      * @param messageId
-     * @param subscriptionPersistentId
+     * @param ack
+     *
      * @throws IOException
      */
     void acknowledge(ConnectionContext context, String clientId, String subscriptionName, MessageId messageId, MessageAck ack) throws IOException;
-    
+
     /**
      * @param clientId
      * @param subscriptionName
-     * @param sub
+     *
      * @throws IOException
      * @throws JMSException
      */
@@ -57,11 +59,11 @@ public interface TopicMessageStore extends MessageStore {
      * <p/> e.g. if we dispatched some messages to a new durable topic
      * subscriber, then went down before acknowledging any messages, we need to
      * know the correct point from which to recover from.
-     * 
+     *
      * @param clientId
      * @param subscriptionName
      * @param listener
-     * @param subscription
+     *
      * @throws Exception
      */
     void recoverSubscription(String clientId, String subscriptionName, MessageRecoveryListener listener) throws Exception;
@@ -69,18 +71,19 @@ public interface TopicMessageStore extends MessageStore {
     /**
      * For an active subscription - retrieve messages from the store for the
      * subscriber after the lastMessageId messageId <p/>
-     * 
+     *
      * @param clientId
      * @param subscriptionName
      * @param maxReturned
      * @param listener
+     *
      * @throws Exception
      */
     void recoverNextMessages(String clientId, String subscriptionName, int maxReturned, MessageRecoveryListener listener) throws Exception;
 
     /**
      * A hint to the Store to reset any batching state for a durable subscriber
-     * 
+     *
      * @param clientId
      * @param subscriptionName
      */
@@ -89,27 +92,31 @@ public interface TopicMessageStore extends MessageStore {
     /**
      * Get the number of messages ready to deliver from the store to a durable
      * subscriber
-     * 
+     *
      * @param clientId
      * @param subscriberName
+     *
      * @return the outstanding message count
+     *
      * @throws IOException
      */
     int getMessageCount(String clientId, String subscriberName) throws IOException;
 
     /**
      * Finds the subscriber entry for the given consumer info
-     * 
+     *
      * @param clientId
      * @param subscriptionName
+     *
      * @return the SubscriptionInfo
+     *
      * @throws IOException
      */
     SubscriptionInfo lookupSubscription(String clientId, String subscriptionName) throws IOException;
 
     /**
      * Lists all the durable subscriptions for a given destination.
-     * 
+     *
      * @return an array SubscriptionInfos
      * @throws IOException
      */
@@ -122,11 +129,10 @@ public interface TopicMessageStore extends MessageStore {
      * new subscription. Otherwise, if retroactive is true, then create the
      * subscription without it having an acknowledged message so that on
      * recovery, all message recorded for the topic get replayed.
-     * 
-     * @param clientId
-     * @param subscriptionName
-     * @param selector
+     *
+     * @param subscriptionInfo
      * @param retroactive
+     *
      * @throws IOException
      */
     void addSubscription(SubscriptionInfo subscriptionInfo, boolean retroactive) throws IOException;

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/store/TopicReferenceStore.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/store/TopicReferenceStore.java b/activemq-broker/src/main/java/org/apache/activemq/store/TopicReferenceStore.java
index 2eb1d77..9c65cc1 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/store/TopicReferenceStore.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/store/TopicReferenceStore.java
@@ -26,22 +26,22 @@ import org.apache.activemq.command.SubscriptionInfo;
 
 /**
  * A MessageStore for durable topic subscriptions
- * 
- * 
  */
 public interface TopicReferenceStore extends ReferenceStore, TopicMessageStore {
+    
     /**
      * Removes the last acknowledged messgeID for the given subscription so that
      * we can recover and commence dispatching messages from the last checkpoint
      * N.B. - all messages previous to this one for a given subscriber
      * should also be acknowledged
-     * 
+     *
      * @param context
      * @param clientId
      * @param subscriptionName
      * @param messageId
-     * @param subscriptionPersistentId
+     * 
      * @return true if there are no more references to the message - or the message is null
+     * 
      * @throws IOException
      */
     boolean acknowledgeReference(ConnectionContext context, String clientId, String subscriptionName, MessageId messageId) throws IOException;
@@ -49,10 +49,11 @@ public interface TopicReferenceStore extends ReferenceStore, TopicMessageStore {
     /**
      * @param clientId
      * @param subscriptionName
-     * @param sub
+     * 
      * @throws IOException
      * @throws JMSException
      */
+    @Override
     void deleteSubscription(String clientId, String subscriptionName) throws IOException;
 
     /**
@@ -61,62 +62,74 @@ public interface TopicReferenceStore extends ReferenceStore, TopicMessageStore {
      * <p/> e.g. if we dispatched some messages to a new durable topic
      * subscriber, then went down before acknowledging any messages, we need to
      * know the correct point from which to recover from.
-     * 
+     *
      * @param clientId
      * @param subscriptionName
      * @param listener
-     * @param subscription
+     *
      * @throws Exception
      */
+    @Override
     void recoverSubscription(String clientId, String subscriptionName, MessageRecoveryListener listener) throws Exception;
 
     /**
      * For an active subscription - retrieve messages from the store for the
      * subscriber after the lastMessageId messageId <p/>
-     * 
+     *
      * @param clientId
      * @param subscriptionName
      * @param maxReturned
      * @param listener
+     * 
      * @throws Exception
      */
+    @Override
     void recoverNextMessages(String clientId, String subscriptionName, int maxReturned, MessageRecoveryListener listener) throws Exception;
 
     /**
      * A hint to the Store to reset any batching state for a durable subsriber
-     * 
+     *
      * @param clientId
      * @param subscriptionName
      */
+    @Override
     void resetBatching(String clientId, String subscriptionName);
 
     /**
      * Get the number of messages ready to deliver from the store to a durable
      * subscriber
-     * 
+     *
      * @param clientId
      * @param subscriberName
+     * 
      * @return the outstanding message count
+     * 
      * @throws IOException
      */
+    @Override
     int getMessageCount(String clientId, String subscriberName) throws IOException;
 
     /**
      * Finds the subscriber entry for the given consumer info
-     * 
+     *
      * @param clientId
      * @param subscriptionName
+     * 
      * @return the SubscriptionInfo
+     * 
      * @throws IOException
      */
+    @Override
     SubscriptionInfo lookupSubscription(String clientId, String subscriptionName) throws IOException;
 
     /**
-     * Lists all the durable subscirptions for a given destination.
-     * 
+     * Lists all the durable subscriptions for a given destination.
+     *
      * @return an array SubscriptionInfos
+     * 
      * @throws IOException
      */
+    @Override
     SubscriptionInfo[] getAllSubscriptions() throws IOException;
 
     /**
@@ -126,11 +139,10 @@ public interface TopicReferenceStore extends ReferenceStore, TopicMessageStore {
      * new subscription. Otherwise, if retroactive is true, then create the
      * subscription without it having an acknowledged message so that on
      * recovery, all message recorded for the topic get replayed.
-     * 
-     * @param clientId
-     * @param subscriptionName
-     * @param selector
+     *
+     * @param subscriptionInfo
      * @param retroactive
+     *
      * @throws IOException
      */
     void addSubsciption(SubscriptionInfo subscriptionInfo, boolean retroactive) throws IOException;

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java b/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java
index 6ba2f3a..37ee004 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java
@@ -16,14 +16,16 @@
  */
 package org.apache.activemq.transport;
 
+import java.io.IOException;
+
+import javax.management.ObjectName;
+
 import org.apache.activemq.broker.jmx.AnnotatedMBean;
 import org.apache.activemq.broker.jmx.ManagementContext;
 import org.apache.activemq.util.IOExceptionSupport;
 import org.apache.activemq.util.LogWriterFinder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import javax.management.ObjectName;
 
 /**
  * Singleton class to create TransportLogger objects.
@@ -31,9 +33,9 @@ import javax.management.ObjectName;
  * a TransportLoggerControlMBean is created and registered.
  * This MBean permits enabling and disabling the logging for
  * all TransportLogger objects at once.
- * 
+ *
  * @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com
- * 
+ *
  * @see TransportLoggerControlMBean
  */
 public class TransportLoggerFactory {
@@ -50,13 +52,13 @@ public class TransportLoggerFactory {
     public static String defaultLogWriterName = "default";
     /**
      * If transport logging is enabled, it will be possible to control
-     * the transport loggers or not based on this value 
+     * the transport loggers or not based on this value
      */
     private static boolean defaultDynamicManagement = false;
     /**
      * If transport logging is enabled, the transport loggers will initially
      * output or not depending on this value.
-     * This setting only has a meaning if 
+     * This setting only has a meaning if
      */
     private static boolean defaultInitialBehavior = true;
     /**
@@ -110,7 +112,7 @@ public class TransportLoggerFactory {
         int id = getNextId();
         return createTransportLogger(next, id, createLog(id), defaultLogWriterName, defaultDynamicManagement, defaultInitialBehavior, defaultJmxPort);
     }
-    
+
     /**
      * Creates a TransportLogger object, that will be inserted in the Transport Stack.
      * Uses the default initial behavior and the default log writer.
@@ -150,7 +152,7 @@ public class TransportLoggerFactory {
      * @param dynamicManagement Specifies if JMX will be used to switch on/off the TransportLogger to be created.
      * @param startLogging Specifies if this TransportLogger should be initially active or not. Only has a meaning if
      * dynamicManagement = true.
-     * @param jmxPort the port to be used by the JMX server. It should only be different from 1099 (broker's default JMX port)
+     * @param jmxport the port to be used by the JMX server. It should only be different from 1099 (broker's default JMX port)
      * when it's a client that is using Transport Logging. In a broker, if the port is different from 1099, 2 JMX servers will
      * be created, both identical, with all the MBeans.
      * @return A TransportLogger object.
@@ -183,7 +185,7 @@ public class TransportLoggerFactory {
     private static Logger createLog(int id) {
         return LoggerFactory.getLogger(TransportLogger.class.getName()+".Connection:" + id);
     }
-    
+
     /**
      * Starts the management context.
      * Creates and registers a TransportLoggerControl MBean which enables the user
@@ -201,7 +203,7 @@ public class TransportLoggerFactory {
          try {
              this.objectName = new ObjectName(this.managementContext.getJmxDomainName()+":"+ "Type=TransportLoggerControl");
              AnnotatedMBean.registerMBean(this.managementContext, new TransportLoggerControl(this.managementContext),this.objectName);
-             
+
              this.transportLoggerControlCreated = true;
 
          } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/util/HexSupport.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/util/HexSupport.java b/activemq-broker/src/main/java/org/apache/activemq/util/HexSupport.java
index e44171c..9a47fae 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/util/HexSupport.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/util/HexSupport.java
@@ -18,11 +18,11 @@ package org.apache.activemq.util;
 
 /**
  * Used to convert to hex from byte arrays and back.
- * 
- * 
+ *
+ *
  */
 public final class HexSupport {
-    
+
     private static final String[] HEX_TABLE = new String[]{
         "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f",
         "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f",
@@ -42,15 +42,15 @@ public final class HexSupport {
         "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff",
     };
     private static final int[] INT_OFFSETS = new int[]{
-    	24,16,8,0
+        24,16,8,0
     };
-    
+
     private HexSupport() {
     }
-    
+
     /**
      * @param hex
-     * @return
+     * @return array of bytes
      */
     public static byte[] toBytesFromHex(String hex) {
         byte rc[] = new byte[hex.length() / 2];
@@ -64,7 +64,7 @@ public final class HexSupport {
 
     /**
      * @param bytes
-     * @return
+     * @return string hex value
      */
     public static String toHexFromBytes(byte[] bytes) {
         StringBuffer rc = new StringBuffer(bytes.length * 2);
@@ -75,21 +75,21 @@ public final class HexSupport {
     }
 
     /**
-     * 
-     * @param value 
+     *
+     * @param value
      * @param trim if the leading 0's should be trimmed off.
-     * @return
+     * @return string hex value
      */
     public static String toHexFromInt(int value, boolean trim) {
         StringBuffer rc = new StringBuffer(INT_OFFSETS.length*2);
         for (int i = 0; i < INT_OFFSETS.length; i++) {
-        	int b = 0xFF & (value>>INT_OFFSETS[i]);
-        	if( !(trim && b == 0) ) { 
-        		rc.append(HEX_TABLE[b]);
-        		trim=false;
-        	}
+            int b = 0xFF & (value>>INT_OFFSETS[i]);
+            if( !(trim && b == 0) ) {
+                rc.append(HEX_TABLE[b]);
+                trim=false;
+            }
         }
+
         return rc.toString();
     }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/util/IOHelper.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/util/IOHelper.java b/activemq-broker/src/main/java/org/apache/activemq/util/IOHelper.java
index 9f06029..a1ba3ec 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/util/IOHelper.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/util/IOHelper.java
@@ -66,7 +66,7 @@ public final class IOHelper {
      * and "." characters.
      *
      * @param name
-     * @return
+     * @return safe name of the directory
      */
     public static String toFileSystemDirectorySafeName(String name) {
         return toFileSystemSafeName(name, true, MAX_DIR_NAME_LENGTH);
@@ -84,7 +84,7 @@ public final class IOHelper {
      * @param name
      * @param dirSeparators
      * @param maxFileLength
-     * @return
+     * @return file system safe name
      */
     public static String toFileSystemSafeName(String name, boolean dirSeparators, int maxFileLength) {
         int size = name.length();

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e05df1c/activemq-broker/src/main/java/org/apache/activemq/util/LinkedNode.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/util/LinkedNode.java b/activemq-broker/src/main/java/org/apache/activemq/util/LinkedNode.java
index 591b42d..03a5157 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/util/LinkedNode.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/util/LinkedNode.java
@@ -19,7 +19,7 @@ package org.apache.activemq.util;
 /**
  * Provides a base class for you to extend when you want object to maintain a
  * doubly linked list to other objects without using a collection class.
- * 
+ *
  * @author chirino
  */
 public class LinkedNode {
@@ -103,7 +103,6 @@ public class LinkedNode {
 
     /**
      * @param leftHead the node to link after this node.
-     * @return
      * @return this
      */
     public LinkedNode linkBefore(LinkedNode leftHead) {
@@ -148,11 +147,10 @@ public class LinkedNode {
         // Update our links..
         reset();
     }
-    
+
     public void reset() {
         next = this;
         prev = this;
         tail = true;
     }
-
 }


[4/4] activemq git commit: https://issues.apache.org/jira/browse/AMQ-5916

Posted by ta...@apache.org.
https://issues.apache.org/jira/browse/AMQ-5916

Apply patch from Ganesh Murthy to resolve issue of creation of durable
subscriber fails via broker AdminView due to lack of SecurityContext on
ConnectionContext

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/82e3ce80
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/82e3ce80
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/82e3ce80

Branch: refs/heads/master
Commit: 82e3ce805ee349a83c0684c908d6ebe0d546f432
Parents: 5e05df1
Author: Timothy Bish <ta...@gmail.com>
Authored: Tue Aug 4 14:51:15 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Tue Aug 4 14:51:15 2015 -0400

----------------------------------------------------------------------
 .../apache/activemq/broker/jmx/BrokerView.java  |  21 ++-
 .../jmx/JMXRemoveDurableSubscriberTest.java     | 166 +++++++++++++++++++
 2 files changed, 185 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/82e3ce80/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
index 350992c..98417b1 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
@@ -418,7 +418,7 @@ public class BrokerView implements BrokerViewMBean {
     @Override
     public ObjectName createDurableSubscriber(String clientId, String subscriberName, String topicName,
                                               String selector) throws Exception {
-        ConnectionContext context = new ConnectionContext();
+        ConnectionContext context = getConnectionContext();
         context.setBroker(safeGetBroker());
         context.setClientId(clientId);
         ConsumerInfo info = new ConsumerInfo();
@@ -443,7 +443,7 @@ public class BrokerView implements BrokerViewMBean {
         RemoveSubscriptionInfo info = new RemoveSubscriptionInfo();
         info.setClientId(clientId);
         info.setSubscriptionName(subscriberName);
-        ConnectionContext context = new ConnectionContext();
+        ConnectionContext context = getConnectionContext();
         context.setBroker(safeGetBroker());
         context.setClientId(clientId);
         brokerService.getBroker().removeSubscription(context, info);
@@ -549,4 +549,21 @@ public class BrokerView implements BrokerViewMBean {
 
         return broker;
     }
+
+    private ConnectionContext getConnectionContext() {
+        ConnectionContext context;
+        if(broker == null) {
+            context = new ConnectionContext();
+
+        }
+        else {
+            ConnectionContext sharedContext = BrokerSupport.getConnectionContext(broker.getContextBroker());
+            //Make a local copy of the sharedContext. We do this because we do not want to set a clientId on the
+            //global sharedContext. Taking a copy of the sharedContext is a good way to make sure that we are not
+            //messing up the shared context
+            context = sharedContext.copy();
+        }
+
+        return context;
+    }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/82e3ce80/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/JMXRemoveDurableSubscriberTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/JMXRemoveDurableSubscriberTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/JMXRemoveDurableSubscriberTest.java
new file mode 100644
index 0000000..8fc489a
--- /dev/null
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/JMXRemoveDurableSubscriberTest.java
@@ -0,0 +1,166 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.broker.jmx;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.activemq.broker.BrokerPlugin;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.filter.DestinationMapEntry;
+import org.apache.activemq.security.AuthorizationEntry;
+import org.apache.activemq.security.AuthorizationMap;
+import org.apache.activemq.security.AuthorizationPlugin;
+import org.apache.activemq.security.DefaultAuthorizationMap;
+import org.apache.activemq.security.JaasAuthenticationPlugin;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Makes sure a durable subscriber can be added and deleted from the
+ * brokerServer.getAdminView() when JAAS authentication and authorization are
+ * setup
+ */
+public class JMXRemoveDurableSubscriberTest {
+
+    private static final Logger LOG = LoggerFactory.getLogger(JMXRemoveDurableSubscriberTest.class);
+
+    private BrokerService brokerService;
+
+    @SuppressWarnings("rawtypes")
+    @Before
+    public void setUp() throws Exception {
+        brokerService = new BrokerService();
+
+        JaasAuthenticationPlugin jaasAuthenticationPlugin = new JaasAuthenticationPlugin();
+        jaasAuthenticationPlugin.setDiscoverLoginConfig(true);
+
+        BrokerPlugin[] brokerPlugins = new BrokerPlugin[2];
+        brokerPlugins[0] = jaasAuthenticationPlugin;
+
+        AuthorizationPlugin authorizationPlugin = new AuthorizationPlugin();
+
+        List<DestinationMapEntry> destinationMapEntries = new ArrayList<DestinationMapEntry>();
+
+        // Add Authorization Entries.
+        AuthorizationEntry authEntry1 = new AuthorizationEntry();
+        authEntry1.setRead("manager,viewer,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser, admin");
+        authEntry1.setWrite("manager,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser,admin");
+        authEntry1.setAdmin("manager,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser,admin");
+        authEntry1.setQueue(">");
+
+        AuthorizationEntry authEntry2 = new AuthorizationEntry();
+        authEntry2.setRead("manager,viewer,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser, admin");
+        authEntry2.setWrite("manager,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser,admin");
+        authEntry2.setAdmin("manager,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser,admin");
+        authEntry2.setTopic(">");
+
+        AuthorizationEntry authEntry3 = new AuthorizationEntry();
+        authEntry3.setRead("manager,viewer,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser, admin");
+        authEntry3.setWrite("manager,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser,admin");
+        authEntry3.setAdmin("manager,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser,admin");
+        authEntry3.setTopic("ActiveMQ.Advisory.>");
+
+        destinationMapEntries.add(authEntry1);
+        destinationMapEntries.add(authEntry2);
+        destinationMapEntries.add(authEntry3);
+
+        AuthorizationMap authorizationMap = new DefaultAuthorizationMap(destinationMapEntries);
+
+        authorizationPlugin.setMap(authorizationMap);
+
+        brokerPlugins[1] = authorizationPlugin;
+
+        brokerService.setPlugins(brokerPlugins);
+
+        brokerService.setBrokerName("ActiveMQBroker");
+        brokerService.setPersistent(false);
+        brokerService.setUseVirtualTopics(false);
+        brokerService.setUseJmx(true);
+        brokerService.addConnector("tcp://localhost:0");
+        brokerService.start();
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        if (brokerService != null) {
+            try {
+                brokerService.stop();
+            } catch (Exception e) {
+            }
+        }
+    }
+
+    /**
+     * Creates a durable subscription via the AdminView
+     */
+    @Test(timeout = 60000)
+    public void testCreateDurableSubsciber() throws Exception {
+
+        String clientId = "10";
+
+        // Add a topic called test topic
+        brokerService.getAdminView().addTopic("testTopic");
+
+        boolean createSubscriberSecurityException = false;
+
+        String subscriberName = "testSubscriber";
+
+        // Create a durable subscriber with the name testSubscriber
+        try {
+            brokerService.getAdminView().createDurableSubscriber(clientId, subscriberName, "testTopic", null);
+            LOG.info("Successfully created durable subscriber " + subscriberName + " via AdminView");
+        } catch (java.lang.SecurityException se1) {
+            if (se1.getMessage().equals("User is not authenticated.")) {
+                createSubscriberSecurityException = true;
+            }
+        }
+        assertFalse(createSubscriberSecurityException);
+
+        // Delete the durable subscriber that was created earlier.
+        boolean destroySubscriberSecurityException = false;
+        try {
+            brokerService.getAdminView().destroyDurableSubscriber(clientId, subscriberName);
+            LOG.info("Successfully destroyed durable subscriber " + subscriberName + " via AdminView");
+        } catch (java.lang.SecurityException se2) {
+            if (se2.getMessage().equals("User is not authenticated.")) {
+                destroySubscriberSecurityException = true;
+            }
+        }
+        assertFalse(destroySubscriberSecurityException);
+
+        // Just to make sure the subscriber was actually deleted, try deleting
+        // the subscriber again
+        // and that should throw an exception
+        boolean subscriberAlreadyDeleted = false;
+        try {
+            brokerService.getAdminView().destroyDurableSubscriber(clientId, subscriberName);
+            LOG.info("Successfully destroyed durable subscriber " + subscriberName + " via AdminView");
+        } catch (javax.jms.InvalidDestinationException t) {
+            if (t.getMessage().equals("No durable subscription exists for clientID: 10 and subscriptionName: testSubscriber")) {
+                subscriberAlreadyDeleted = true;
+            }
+        }
+        assertTrue(subscriberAlreadyDeleted);
+    }
+}