You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2007/08/09 18:40:08 UTC
svn commit: r564271 [3/18] - in /activemq/trunk:
activemq-core/src/main/java/org/apache/activemq/
activemq-core/src/main/java/org/apache/activemq/advisory/
activemq-core/src/main/java/org/apache/activemq/blob/
activemq-core/src/main/java/org/apache/act...
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java Thu Aug 9 09:37:49 2007
@@ -22,85 +22,105 @@
public interface BrokerViewMBean extends Service {
- /**
- * @return The unique id of the broker.
- */
- public abstract String getBrokerId();
+ /**
+ * @return The unique id of the broker.
+ */
+ String getBrokerId();
/**
- * The Broker will fush it's caches so that the garbage
- * collector can recalaim more memory.
+ * The Broker will fush it's caches so that the garbage collector can
+ * recalaim more memory.
*
* @throws Exception
*/
- public void gc() throws Exception;
-
-
- public void resetStatistics();
-
- public void enableStatistics();
- public void disableStatistics();
- public boolean isStatisticsEnabled();
-
- public long getTotalEnqueueCount();
- public long getTotalDequeueCount();
- public long getTotalConsumerCount();
- public long getTotalMessageCount();
-
- public int getMemoryPercentageUsed();
- public long getMemoryLimit();
- public void setMemoryLimit(long limit);
+ void gc() throws Exception;
+
+ void resetStatistics();
+
+ void enableStatistics();
+
+ void disableStatistics();
+
+ boolean isStatisticsEnabled();
+
+ long getTotalEnqueueCount();
+
+ long getTotalDequeueCount();
+
+ long getTotalConsumerCount();
+
+ long getTotalMessageCount();
+
+ int getMemoryPercentageUsed();
+
+ long getMemoryLimit();
+
+ void setMemoryLimit(long limit);
/**
* Shuts down the JVM.
- * @param exitCode the exit code that will be reported by the JVM process when it exits.
+ *
+ * @param exitCode the exit code that will be reported by the JVM process
+ * when it exits.
*/
- public void terminateJVM(int exitCode);
-
+ void terminateJVM(int exitCode);
+
/**
* Stop the broker and all it's components.
*/
- public void stop() throws Exception;
-
- public ObjectName[] getTopics();
- public ObjectName[] getQueues();
- public ObjectName[] getTemporaryTopics();
- public ObjectName[] getTemporaryQueues();
-
- public ObjectName[] getTopicSubscribers();
- public ObjectName[] getDurableTopicSubscribers();
- public ObjectName[] getInactiveDurableTopicSubscribers();
- public ObjectName[] getQueueSubscribers();
- public ObjectName[] getTemporaryTopicSubscribers();
- public ObjectName[] getTemporaryQueueSubscribers();
-
- /**
+ void stop() throws Exception;
+
+ ObjectName[] getTopics();
+
+ ObjectName[] getQueues();
+
+ ObjectName[] getTemporaryTopics();
+
+ ObjectName[] getTemporaryQueues();
+
+ ObjectName[] getTopicSubscribers();
+
+ ObjectName[] getDurableTopicSubscribers();
+
+ ObjectName[] getInactiveDurableTopicSubscribers();
+
+ ObjectName[] getQueueSubscribers();
+
+ ObjectName[] getTemporaryTopicSubscribers();
+
+ ObjectName[] getTemporaryQueueSubscribers();
+
+ /**
* Adds a Topic destination to the broker.
+ *
* @param name The name of the Topic
* @throws Exception
*/
- public void addTopic(String name) throws Exception;
+ void addTopic(String name) throws Exception;
/**
* Adds a Queue destination to the broker.
+ *
* @param name The name of the Queue
* @throws Exception
*/
- public void addQueue(String name) throws Exception;
+ void addQueue(String name) throws Exception;
- /**
+ /**
* Removes a Topic destination from the broker.
+ *
* @param name The name of the Topic
* @throws Exception
*/
- public void removeTopic(String name) throws Exception;
+ void removeTopic(String name) throws Exception;
/**
* Removes a Queue destination from the broker.
+ *
* @param name The name of the Queue
* @throws Exception
*/
- public void removeQueue(String name) throws Exception;
+ void removeQueue(String name) throws Exception;
/**
* Creates a new durable topic subscriber
@@ -109,10 +129,9 @@
* @param subscriberName the durable subscriber name
* @param topicName the name of the topic to subscribe to
* @param selector a selector or null
- *
* @return the object name of the MBean registered in JMX
*/
- public ObjectName createDurableSubscriber(String clientId, String subscriberName, String topicName, String selector) throws Exception;
+ ObjectName createDurableSubscriber(String clientId, String subscriberName, String topicName, String selector) throws Exception;
/**
* Destroys a durable subscriber
@@ -120,6 +139,6 @@
* @param clientId the JMS client ID
* @param subscriberName the durable subscriber name
*/
- public void destroyDurableSubscriber(String clientId, String subscriberName) throws Exception;
-
+ void destroyDurableSubscriber(String clientId, String subscriberName) throws Exception;
+
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java Thu Aug 9 09:37:49 2007
@@ -22,52 +22,52 @@
/**
* @return true if the Connection is slow
*/
- public boolean isSlow();
+ boolean isSlow();
/**
* @return if after being marked, the Connection is still writing
*/
- public boolean isBlocked();
+ boolean isBlocked();
/**
* @return true if the Connection is connected
*/
- public boolean isConnected();
+ boolean isConnected();
/**
* @return true if the Connection is active
*/
- public boolean isActive();
+ boolean isActive();
/**
* Returns the number of messages to be dispatched to this connection
*/
- public int getDispatchQueueSize();
+ int getDispatchQueueSize();
/**
* Resets the statistics
*/
- public void resetStatistics();
+ void resetStatistics();
/**
* Returns the number of messages enqueued on this connection
*
* @return the number of messages enqueued on this connection
*/
- public long getEnqueueCount();
+ long getEnqueueCount();
/**
* Returns the number of messages dequeued on this connection
*
* @return the number of messages dequeued on this connection
*/
- public long getDequeueCount();
+ long getDequeueCount();
/**
* Returns the source address for this connection
*
* @return the souce address for this connection
*/
- public String getRemoteAddress();
+ String getRemoteAddress();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorView.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorView.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorView.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorView.java Thu Aug 9 09:37:49 2007
@@ -46,37 +46,36 @@
public BrokerInfo getBrokerInfo() {
return connector.getBrokerInfo();
}
-
+
/**
* Resets the statistics
*/
public void resetStatistics() {
connector.getStatistics().reset();
}
-
-
+
/**
* enable statistics gathering
- */
+ */
public void enableStatistics() {
- connector.getStatistics().setEnabled(true);
- }
-
+ connector.getStatistics().setEnabled(true);
+ }
+
/**
* disable statistics gathering
- */
+ */
public void disableStatistics() {
- connector.getStatistics().setEnabled(false);
- }
-
+ connector.getStatistics().setEnabled(false);
+ }
+
/**
* Returns true if statistics is enabled
*
* @return true if statistics is enabled
- */
+ */
public boolean isStatisticsEnabled() {
- return connector.getStatistics().isEnabled();
- }
+ return connector.getStatistics().isEnabled();
+ }
/**
* Returns the number of messages enqueued on this connector
@@ -85,7 +84,7 @@
*/
public long getEnqueueCount() {
return connector.getStatistics().getEnqueues().getCount();
-
+
}
/**
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java Thu Aug 9 09:37:49 2007
@@ -23,37 +23,37 @@
/**
* Resets the statistics
*/
- public void resetStatistics();
+ void resetStatistics();
/**
* enable statistics gathering
*/
- public void enableStatistics();
+ void enableStatistics();
/**
* disable statistics gathering
*/
- public void disableStatistics();
+ void disableStatistics();
/**
* Returns true if statistics is enabled
*
* @return true if statistics is enabled
*/
- public boolean isStatisticsEnabled();
+ boolean isStatisticsEnabled();
/**
* Returns the number of messages enqueued on this connector
*
* @return the number of messages enqueued on this connector
*/
- public long getEnqueueCount();
+ long getEnqueueCount();
/**
* Returns the number of messages dequeued on this connector
*
* @return the number of messages dequeued on this connector
*/
- public long getDequeueCount();
+ long getDequeueCount();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java Thu Aug 9 09:37:49 2007
@@ -48,7 +48,7 @@
import org.apache.commons.logging.LogFactory;
public class DestinationView implements DestinationViewMBean {
- private static final Log log = LogFactory.getLog(DestinationViewMBean.class);
+ private static final Log LOG = LogFactory.getLog(DestinationViewMBean.class);
protected final Destination destination;
protected final ManagedRegionBroker broker;
@@ -147,7 +147,7 @@
}
} catch (Throwable e) {
- log.warn("exception browsing destination", e);
+ LOG.warn("exception browsing destination", e);
}
}
@@ -188,7 +188,7 @@
}
} catch (Throwable e) {
- log.warn("exception browsing destination", e);
+ LOG.warn("exception browsing destination", e);
}
}
return answer;
@@ -224,7 +224,7 @@
}
}
} catch (Throwable e) {
- log.warn("exception browsing destination", e);
+ LOG.warn("exception browsing destination", e);
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java Thu Aug 9 09:37:49 2007
@@ -24,121 +24,131 @@
import javax.management.openmbean.OpenDataException;
import javax.management.openmbean.TabularData;
-
public interface DestinationViewMBean {
-
+
/**
* Returns the name of this destination
*/
- public String getName();
-
- /**
- * Resets the managment counters.
- */
- public void resetStatistics();
+ String getName();
+
+ /**
+ * Resets the managment counters.
+ */
+ void resetStatistics();
/**
* Returns the number of messages that have been sent to the destination.
- *
+ *
* @return The number of messages that have been sent to the destination.
*/
- public long getEnqueueCount();
-
+ long getEnqueueCount();
+
/**
- * Returns the number of messages that have been delivered (potentially not acknowledged) to consumers.
- *
- * @return The number of messages that have been delivered (potentially not acknowledged) to consumers.
+ * Returns the number of messages that have been delivered (potentially not
+ * acknowledged) to consumers.
+ *
+ * @return The number of messages that have been delivered (potentially not
+ * acknowledged) to consumers.
*/
- public long getDispatchCount();
-
+ long getDispatchCount();
+
/**
- * Returns the number of messages that have been acknowledged from the destination.
- *
- * @return The number of messages that have been acknowledged from the destination.
+ * Returns the number of messages that have been acknowledged from the
+ * destination.
+ *
+ * @return The number of messages that have been acknowledged from the
+ * destination.
*/
- public long getDequeueCount();
+ long getDequeueCount();
/**
* Returns the number of consumers subscribed this destination.
- *
+ *
* @return The number of consumers subscribed this destination.
*/
- public long getConsumerCount();
+ long getConsumerCount();
/**
- * Returns the number of messages in this destination which are yet to be consumed
- *
- * @return Returns the number of messages in this destination which are yet to be consumed
+ * Returns the number of messages in this destination which are yet to be
+ * consumed
+ *
+ * @return Returns the number of messages in this destination which are yet
+ * to be consumed
*/
- public long getQueueSize();
-
+ long getQueueSize();
+
/**
* @return An array of all the messages in the destination's queue.
*/
- public CompositeData[] browse() throws OpenDataException;
-
+ CompositeData[] browse() throws OpenDataException;
+
/**
* @return A list of all the messages in the destination's queue.
*/
- public TabularData browseAsTable() throws OpenDataException;
+ TabularData browseAsTable() throws OpenDataException;
/**
* @return An array of all the messages in the destination's queue.
- * @throws InvalidSelectorException
+ * @throws InvalidSelectorException
*/
- public CompositeData[] browse(String selector) throws OpenDataException, InvalidSelectorException;
-
+ CompositeData[] browse(String selector) throws OpenDataException, InvalidSelectorException;
+
/**
* @return A list of all the messages in the destination's queue.
- * @throws InvalidSelectorException
+ * @throws InvalidSelectorException
*/
- public TabularData browseAsTable(String selector) throws OpenDataException, InvalidSelectorException;
+ TabularData browseAsTable(String selector) throws OpenDataException, InvalidSelectorException;
/**
* Sends a TextMesage to the destination.
+ *
* @param body the text to send
* @return the message id of the message sent.
* @throws Exception
*/
- public String sendTextMessage(String body) throws Exception;
+ String sendTextMessage(String body) throws Exception;
/**
* Sends a TextMesage to the destination.
- * @param headers the message headers and properties to set. Can only container Strings maped to primitive types.
+ *
+ * @param headers the message headers and properties to set. Can only
+ * container Strings maped to primitive types.
* @param body the text to send
* @return the message id of the message sent.
* @throws Exception
*/
- public String sendTextMessage(Map headers, String body) throws Exception;
+ String sendTextMessage(Map headers, String body) throws Exception;
+
+ int getMemoryPercentageUsed();
+
+ long getMemoryLimit();
- public int getMemoryPercentageUsed();
- public long getMemoryLimit();
- public void setMemoryLimit(long limit);
+ void setMemoryLimit(long limit);
/**
* Browses the current destination returning a list of messages
*/
- public List browseMessages() throws InvalidSelectorException;
+ List browseMessages() throws InvalidSelectorException;
/**
- * Browses the current destination with the given selector returning a list of messages
+ * Browses the current destination with the given selector returning a list
+ * of messages
*/
- public List browseMessages(String selector) throws InvalidSelectorException;
-
-
+ List browseMessages(String selector) throws InvalidSelectorException;
+
/**
* @return longest time a message is held by a destination
*/
- public long getMaxEnqueueTime();
-
+ long getMaxEnqueueTime();
+
/**
* @return shortest time a message is held by a destination
*/
- public long getMinEnqueueTime();
-
+ long getMinEnqueueTime();
+
/**
* @return average time a message is held by a destination
*/
- public double getAverageEnqueueTime();
+ double getAverageEnqueueTime();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DurableSubscriptionViewMBean.java Thu Aug 9 09:37:49 2007
@@ -27,7 +27,7 @@
/**
* @return name of the durable subscription name
*/
- public String getSubscriptionName();
+ String getSubscriptionName();
/**
* Browse messages for this durable subscriber
@@ -35,7 +35,7 @@
* @return messages
* @throws OpenDataException
*/
- public CompositeData[] browse() throws OpenDataException;
+ CompositeData[] browse() throws OpenDataException;
/**
* Browse messages for this durable subscriber
@@ -43,11 +43,11 @@
* @return messages
* @throws OpenDataException
*/
- public TabularData browseAsTable() throws OpenDataException;
+ TabularData browseAsTable() throws OpenDataException;
/**
* Destroys the durable subscription so that messages will no longer be
* stored for this subscription
*/
- public void destroy() throws Exception;
+ void destroy() throws Exception;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java Thu Aug 9 09:37:49 2007
@@ -73,7 +73,7 @@
import org.apache.commons.logging.LogFactory;
public class ManagedRegionBroker extends RegionBroker {
- private static final Log log = LogFactory.getLog(ManagedRegionBroker.class);
+ private static final Log LOG = LogFactory.getLog(ManagedRegionBroker.class);
private final MBeanServer mbeanServer;
private final ObjectName brokerObjectName;
private final Map topics = new ConcurrentHashMap();
@@ -113,7 +113,7 @@
try {
mbeanServer.unregisterMBean(name);
} catch (InstanceNotFoundException e) {
- log.warn("The MBean: " + name + " is no longer registered with JMX");
+ LOG.warn("The MBean: " + name + " is no longer registered with JMX");
} catch (Exception e) {
stopper.onException(this, e);
}
@@ -148,13 +148,13 @@
view = new TopicView(this, (Topic)destination);
} else {
view = null;
- log.warn("JMX View is not supported for custom destination: " + destination);
+ LOG.warn("JMX View is not supported for custom destination: " + destination);
}
if (view != null) {
registerDestination(objectName, destName, view);
}
} catch (Exception e) {
- log.error("Failed to register destination " + destName, e);
+ LOG.error("Failed to register destination " + destName, e);
}
}
@@ -163,7 +163,7 @@
ObjectName objectName = createObjectName(destName);
unregisterDestination(objectName);
} catch (Exception e) {
- log.error("Failed to unregister " + destName, e);
+ LOG.error("Failed to unregister " + destName, e);
}
}
@@ -205,7 +205,7 @@
subscriptionMap.put(sub, objectName);
return objectName;
} catch (Exception e) {
- log.error("Failed to register subscription " + sub, e);
+ LOG.error("Failed to register subscription " + sub, e);
return null;
}
}
@@ -216,7 +216,7 @@
try {
unregisterSubscription(name);
} catch (Exception e) {
- log.error("Failed to unregister subscription " + sub, e);
+ LOG.error("Failed to unregister subscription " + sub, e);
}
}
}
@@ -239,8 +239,8 @@
mbeanServer.registerMBean(view, key);
registeredMBeans.add(key);
} catch (Throwable e) {
- log.warn("Failed to register MBean: " + key);
- log.debug("Failure reason: " + e, e);
+ LOG.warn("Failed to register MBean: " + key);
+ LOG.debug("Failure reason: " + e, e);
}
}
@@ -253,8 +253,8 @@
try {
mbeanServer.unregisterMBean(key);
} catch (Throwable e) {
- log.warn("Failed to unregister MBean: " + key);
- log.debug("Failure reason: " + e, e);
+ LOG.warn("Failed to unregister MBean: " + key);
+ LOG.debug("Failure reason: " + e, e);
}
}
}
@@ -282,7 +282,7 @@
mbeanServer.unregisterMBean(inactiveName);
}
} catch (Throwable e) {
- log.error("Unable to unregister inactive durable subscriber: " + subscriptionKey, e);
+ LOG.error("Unable to unregister inactive durable subscriber: " + subscriptionKey, e);
}
} else {
topicSubscribers.put(key, view);
@@ -294,8 +294,8 @@
mbeanServer.registerMBean(view, key);
registeredMBeans.add(key);
} catch (Throwable e) {
- log.warn("Failed to register MBean: " + key);
- log.debug("Failure reason: " + e, e);
+ LOG.warn("Failed to register MBean: " + key);
+ LOG.debug("Failure reason: " + e, e);
}
}
@@ -310,8 +310,8 @@
try {
mbeanServer.unregisterMBean(key);
} catch (Throwable e) {
- log.warn("Failed to unregister MBean: " + key);
- log.debug("Failure reason: " + e, e);
+ LOG.warn("Failed to unregister MBean: " + key);
+ LOG.debug("Failure reason: " + e, e);
}
}
DurableSubscriptionView view = (DurableSubscriptionView)durableTopicSubscribers.remove(key);
@@ -337,7 +337,7 @@
if (infos != null) {
for (int i = 0; i < infos.length; i++) {
SubscriptionInfo info = infos[i];
- log.debug("Restoring durable subscription: " + info);
+ LOG.debug("Restoring durable subscription: " + info);
SubscriptionKey key = new SubscriptionKey(info);
subscriptions.put(key, info);
}
@@ -364,14 +364,14 @@
mbeanServer.registerMBean(view, objectName);
registeredMBeans.add(objectName);
} catch (Throwable e) {
- log.warn("Failed to register MBean: " + key);
- log.debug("Failure reason: " + e, e);
+ LOG.warn("Failed to register MBean: " + key);
+ LOG.debug("Failure reason: " + e, e);
}
inactiveDurableTopicSubscribers.put(objectName, view);
subscriptionKeys.put(key, objectName);
} catch (Exception e) {
- log.error("Failed to register subscription " + info, e);
+ LOG.error("Failed to register subscription " + info, e);
}
}
@@ -382,7 +382,7 @@
try {
c[i] = OpenTypeSupport.convert((Message)messages.get(i));
} catch (Throwable e) {
- log.error("failed to browse : " + view, e);
+ LOG.error("failed to browse : " + view, e);
}
}
return c;
@@ -428,7 +428,7 @@
}
});
} catch (Throwable e) {
- log.error("Failed to browse messages for Subscription " + view, e);
+ LOG.error("Failed to browse messages for Subscription " + view, e);
}
return result;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java Thu Aug 9 09:37:49 2007
@@ -40,7 +40,7 @@
* @version $Revision: 1.1 $
*/
public class ManagedTransportConnection extends TransportConnection {
- private static final Log log = LogFactory.getLog(ManagedTransportConnection.class);
+ private static final Log LOG = LogFactory.getLog(ManagedTransportConnection.class);
private final MBeanServer server;
private final ObjectName connectorName;
@@ -101,8 +101,8 @@
try {
server.registerMBean(mbean, name);
} catch (Throwable e) {
- log.warn("Failed to register MBean: " + name);
- log.debug("Failure reason: " + e, e);
+ LOG.warn("Failed to register MBean: " + name);
+ LOG.debug("Failure reason: " + e, e);
}
}
}
@@ -112,8 +112,8 @@
try {
server.unregisterMBean(name);
} catch (Throwable e) {
- log.warn("Failed to unregister mbean: " + name);
- log.debug("Failure reason: " + e, e);
+ LOG.warn("Failed to unregister mbean: " + name);
+ LOG.debug("Failure reason: " + e, e);
}
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkBridgeView.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkBridgeView.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkBridgeView.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkBridgeView.java Thu Aug 9 09:37:49 2007
@@ -1,12 +1,12 @@
/**
+ * 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
*
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed 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
+ * 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,
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkBridgeViewMBean.java Thu Aug 9 09:37:49 2007
@@ -1,12 +1,12 @@
/**
+ * 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
*
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed 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
+ * 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,
@@ -19,12 +19,17 @@
import org.apache.activemq.Service;
public interface NetworkBridgeViewMBean extends Service {
-
- public String getLocalAddress();
- public String getRemoteAddress();
- public String getRemoteBrokerName();
- public String getLocalBrokerName();
- public long getEnqueueCounter();
- public long getDequeueCounter();
-}
\ No newline at end of file
+ String getLocalAddress();
+
+ String getRemoteAddress();
+
+ String getRemoteBrokerName();
+
+ String getLocalBrokerName();
+
+ long getEnqueueCounter();
+
+ long getDequeueCounter();
+
+}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/NetworkConnectorViewMBean.java Thu Aug 9 09:37:49 2007
@@ -20,42 +20,42 @@
public interface NetworkConnectorViewMBean extends Service {
- public String getName();
+ String getName();
- public int getNetworkTTL();
+ int getNetworkTTL();
- public int getPrefetchSize();
+ int getPrefetchSize();
- public String getUserName();
+ String getUserName();
- public boolean isBridgeTempDestinations();
+ boolean isBridgeTempDestinations();
- public boolean isConduitSubscriptions();
+ boolean isConduitSubscriptions();
- public boolean isDecreaseNetworkConsumerPriority();
+ boolean isDecreaseNetworkConsumerPriority();
- public boolean isDispatchAsync();
+ boolean isDispatchAsync();
- public boolean isDynamicOnly();
+ boolean isDynamicOnly();
- public void setBridgeTempDestinations(boolean bridgeTempDestinations);
+ void setBridgeTempDestinations(boolean bridgeTempDestinations);
- public void setConduitSubscriptions(boolean conduitSubscriptions);
+ void setConduitSubscriptions(boolean conduitSubscriptions);
- public void setDispatchAsync(boolean dispatchAsync);
+ void setDispatchAsync(boolean dispatchAsync);
- public void setDynamicOnly(boolean dynamicOnly);
+ void setDynamicOnly(boolean dynamicOnly);
- public void setNetworkTTL(int networkTTL);
+ void setNetworkTTL(int networkTTL);
- public void setPassword(String password);
+ void setPassword(String password);
- public void setPrefetchSize(int prefetchSize);
+ void setPrefetchSize(int prefetchSize);
- public void setUserName(String userName);
+ void setUserName(String userName);
- public String getPassword();
+ String getPassword();
- public void setDecreaseNetworkConsumerPriority(boolean decreaseNetworkConsumerPriority);
+ void setDecreaseNetworkConsumerPriority(boolean decreaseNetworkConsumerPriority);
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java Thu Aug 9 09:37:49 2007
@@ -48,7 +48,7 @@
Map getFields(Object o) throws OpenDataException;
}
- private static final HashMap openTypeFactories = new HashMap();
+ private static final HashMap OPEN_TYPE_FACTORIES = new HashMap();
abstract static class AbstractOpenTypeFactory implements OpenTypeFactory {
@@ -75,7 +75,7 @@
return new CompositeType(getTypeName(), getDescription(), itemNames, itemDescriptions, itemTypes);
}
- abstract protected String getTypeName();
+ protected abstract String getTypeName();
protected void addItem(String name, String description, OpenType type) {
itemNamesList.add(name);
@@ -257,16 +257,16 @@
}
static {
- openTypeFactories.put(ActiveMQMessage.class, new MessageOpenTypeFactory());
- openTypeFactories.put(ActiveMQBytesMessage.class, new ByteMessageOpenTypeFactory());
- openTypeFactories.put(ActiveMQMapMessage.class, new MapMessageOpenTypeFactory());
- openTypeFactories.put(ActiveMQObjectMessage.class, new ObjectMessageOpenTypeFactory());
- openTypeFactories.put(ActiveMQStreamMessage.class, new StreamMessageOpenTypeFactory());
- openTypeFactories.put(ActiveMQTextMessage.class, new TextMessageOpenTypeFactory());
+ OPEN_TYPE_FACTORIES.put(ActiveMQMessage.class, new MessageOpenTypeFactory());
+ OPEN_TYPE_FACTORIES.put(ActiveMQBytesMessage.class, new ByteMessageOpenTypeFactory());
+ OPEN_TYPE_FACTORIES.put(ActiveMQMapMessage.class, new MapMessageOpenTypeFactory());
+ OPEN_TYPE_FACTORIES.put(ActiveMQObjectMessage.class, new ObjectMessageOpenTypeFactory());
+ OPEN_TYPE_FACTORIES.put(ActiveMQStreamMessage.class, new StreamMessageOpenTypeFactory());
+ OPEN_TYPE_FACTORIES.put(ActiveMQTextMessage.class, new TextMessageOpenTypeFactory());
}
public static OpenTypeFactory getFactory(Class clazz) throws OpenDataException {
- return (OpenTypeFactory)openTypeFactories.get(clazz);
+ return (OpenTypeFactory)OPEN_TYPE_FACTORIES.get(clazz);
}
public static CompositeData convert(Message message) throws OpenDataException {
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java Thu Aug 9 09:37:49 2007
@@ -19,19 +19,17 @@
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.OpenDataException;
-
public interface QueueViewMBean extends DestinationViewMBean {
-
- /**
+
+ /**
* Retrieve a message from the destination's queue.
*
- * @param messageId
- * the message id of the message to retrieve
+ * @param messageId the message id of the message to retrieve
* @return A CompositeData object which is a JMX version of the messages
* @throws OpenDataException
*/
- public CompositeData getMessage(String messageId) throws OpenDataException;
-
+ CompositeData getMessage(String messageId) throws OpenDataException;
+
/**
* Removes a message from the queue. If the message has already been
* dispatched to another consumer, the message cannot be deleted and this
@@ -39,31 +37,32 @@
*
* @param messageId
* @return true if the message was found and could be successfully deleted.
- * @throws Exception
+ * @throws Exception
*/
- public boolean removeMessage(String messageId) throws Exception;
+ boolean removeMessage(String messageId) throws Exception;
/**
* Removes the messages matching the given selector
*
* @return the number of messages removed
*/
- public int removeMatchingMessages(String selector) throws Exception;
+ int removeMatchingMessages(String selector) throws Exception;
/**
- * Removes the messages matching the given selector up to the maximum number of matched messages
+ * Removes the messages matching the given selector up to the maximum number
+ * of matched messages
*
* @return the number of messages removed
*/
- public int removeMatchingMessages(String selector, int maximumMessages) throws Exception;
-
+ int removeMatchingMessages(String selector, int maximumMessages) throws Exception;
/**
* Removes all of the messages in the queue.
- * @throws Exception
+ *
+ * @throws Exception
*/
- public void purge() throws Exception;
-
+ void purge() throws Exception;
+
/**
* Copies a given message to another destination.
*
@@ -73,21 +72,22 @@
* other destination.
* @throws Exception
*/
- public boolean copyMessageTo(String messageId, String destinationName) throws Exception;
+ boolean copyMessageTo(String messageId, String destinationName) throws Exception;
/**
* Copies the messages matching the given selector
*
* @return the number of messages copied
*/
- public int copyMatchingMessagesTo(String selector, String destinationName) throws Exception;
+ int copyMatchingMessagesTo(String selector, String destinationName) throws Exception;
/**
- * Copies the messages matching the given selector up to the maximum number of matched messages
+ * Copies the messages matching the given selector up to the maximum number
+ * of matched messages
*
* @return the number of messages copied
*/
- public int copyMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception;
+ int copyMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception;
/**
* Moves the message to another destination.
@@ -98,18 +98,19 @@
* other destination.
* @throws Exception
*/
- public boolean moveMessageTo(String messageId, String destinationName) throws Exception;
+ boolean moveMessageTo(String messageId, String destinationName) throws Exception;
/**
* Moves the messages matching the given selector
*
* @return the number of messages removed
*/
- public int moveMatchingMessagesTo(String selector, String destinationName) throws Exception;
-
+ int moveMatchingMessagesTo(String selector, String destinationName) throws Exception;
+
/**
- * Moves the messages matching the given selector up to the maximum number of matched messages
+ * Moves the messages matching the given selector up to the maximum number
+ * of matched messages
*/
- public int moveMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception;
+ int moveMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java Thu Aug 9 09:37:49 2007
@@ -26,68 +26,68 @@
/**
* @return the clientId of the Connection the Subscription is on
*/
- public String getClientId();
+ String getClientId();
/**
* @return the id of the Connection the Subscription is on
*/
- public String getConnectionId();
+ String getConnectionId();
/**
* @return the id of the Session the subscription is on
*/
- public long getSessionId();
+ long getSessionId();
/**
* @return the id of the Subscription
*/
- public long getSubcriptionId();
+ long getSubcriptionId();
/**
* @return the destination name
*/
- public String getDestinationName();
+ String getDestinationName();
/**
* @return the JMS selector on the current subscription
*/
- public String getSelector();
+ String getSelector();
/**
* Attempts to change the current active selector on the subscription. This
* operation is not supported for persistent topics.
*/
- public void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException;
+ void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException;
/**
* @return true if the destination is a Queue
*/
- public boolean isDestinationQueue();
+ boolean isDestinationQueue();
/**
* @return true of the destination is a Topic
*/
- public boolean isDestinationTopic();
+ boolean isDestinationTopic();
/**
* @return true if the destination is temporary
*/
- public boolean isDestinationTemporary();
+ boolean isDestinationTemporary();
/**
* @return true if the subscriber is active
*/
- public boolean isActive();
+ boolean isActive();
/**
* @return number of messages pending delivery
*/
- public int getPendingQueueSize();
+ int getPendingQueueSize();
/**
* @return number of messages dispatched
*/
- public int getDispatchedQueueSize();
+ int getDispatchedQueueSize();
/**
* @return number of messages that matched the subscription
@@ -107,27 +107,27 @@
/**
* @return the prefetch that has been configured for this subscriber
*/
- public int getPrefetchSize();
+ int getPrefetchSize();
/**
* @return whether or not the subscriber is retroactive or not
*/
- public boolean isRetroactive();
+ boolean isRetroactive();
/**
* @return whether or not the subscriber is an exclusive consumer
*/
- public boolean isExclusive();
+ boolean isExclusive();
/**
* @return whether or not the subscriber is durable (persistent)
*/
- public boolean isDurable();
+ boolean isDurable();
/**
* @return whether or not the subscriber ignores local messages
*/
- public boolean isNoLocal();
+ boolean isNoLocal();
/**
* @return the maximum number of pending messages allowed in addition to the
@@ -135,16 +135,16 @@
* perform eviction of messages for slow consumers on non-durable
* topics.
*/
- public int getMaximumPendingMessageLimit();
+ int getMaximumPendingMessageLimit();
/**
* @return the consumer priority
*/
- public byte getPriority();
+ byte getPriority();
/**
* @return the name of the consumer which is only used for durable
* consumers.
*/
- public String getSubcriptionName();
+ String getSubcriptionName();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java Thu Aug 9 09:37:49 2007
@@ -25,12 +25,12 @@
/**
* @return the number of messages discarded due to being a slow consumer
*/
- public int getDiscardedCount();
+ int getDiscardedCount();
/**
* @return the maximun number of messages that can be pending.
*/
- public int getMaximumPendingQueueSize();
- public void setMaximumPendingQueueSize(int max);
+ int getMaximumPendingQueueSize();
+ void setMaximumPendingQueueSize(int max);
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java Thu Aug 9 09:37:49 2007
@@ -48,7 +48,7 @@
/**
* @version $Revision: 1.14 $
*/
-abstract public class AbstractRegion implements Region {
+public abstract class AbstractRegion implements Region {
private static final Log LOG = LogFactory.getLog(AbstractRegion.class);
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java Thu Aug 9 09:37:49 2007
@@ -37,18 +37,18 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-abstract public class AbstractSubscription implements Subscription {
+public abstract class AbstractSubscription implements Subscription {
- static private final Log log = LogFactory.getLog(AbstractSubscription.class);
+ private static final Log LOG = LogFactory.getLog(AbstractSubscription.class);
protected Broker broker;
protected ConnectionContext context;
protected ConsumerInfo info;
- final protected DestinationFilter destinationFilter;
+ protected final DestinationFilter destinationFilter;
+ protected final CopyOnWriteArrayList destinations = new CopyOnWriteArrayList();
private BooleanExpression selectorExpression;
private ObjectName objectName;
- final protected CopyOnWriteArrayList destinations = new CopyOnWriteArrayList();
public AbstractSubscription(Broker broker, ConnectionContext context, ConsumerInfo info) throws InvalidSelectorException {
this.broker = broker;
@@ -58,7 +58,7 @@
this.selectorExpression = parseSelector(info);
}
- static private BooleanExpression parseSelector(ConsumerInfo info) throws InvalidSelectorException {
+ private static BooleanExpression parseSelector(ConsumerInfo info) throws InvalidSelectorException {
BooleanExpression rc = null;
if (info.getSelector() != null) {
rc = new SelectorParser().parse(info.getSelector());
@@ -89,7 +89,7 @@
try {
return (selectorExpression == null || selectorExpression.matches(context)) && this.context.isAllowedToConsume(node);
} catch (JMSException e) {
- log.info("Selector failed to evaluate: " + e.getMessage(), e);
+ LOG.info("Selector failed to evaluate: " + e.getMessage(), e);
return false;
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java Thu Aug 9 09:37:49 2007
@@ -55,9 +55,9 @@
DeadLetterStrategy getDeadLetterStrategy();
- public Message[] browse();
+ Message[] browse();
- public String getName();
+ String getName();
- public MessageStore getMessageStore();
+ MessageStore getMessageStore();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFactory.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFactory.java Thu Aug 9 09:37:49 2007
@@ -35,21 +35,21 @@
/**
* Create destination implementation.
*/
- abstract public Destination createDestination(ConnectionContext context, ActiveMQDestination destination, DestinationStatistics destinationStatistics) throws Exception;
+ public abstract Destination createDestination(ConnectionContext context, ActiveMQDestination destination, DestinationStatistics destinationStatistics) throws Exception;
/**
* Returns a set of all the {@link org.apache.activemq.command.ActiveMQDestination}
* objects that the persistence store is aware exist.
*/
- abstract public Set getDestinations();
+ public abstract Set getDestinations();
/**
* Lists all the durable subscirptions for a given destination.
*/
- abstract public SubscriptionInfo[] getAllDurableSubscriptions(ActiveMQTopic topic) throws IOException;
+ public abstract SubscriptionInfo[] getAllDurableSubscriptions(ActiveMQTopic topic) throws IOException;
- abstract public long getLastMessageBrokerSequenceId() throws IOException;
+ public abstract long getLastMessageBrokerSequenceId() throws IOException;
- abstract public void setRegionBroker(RegionBroker regionBroker);
+ public abstract void setRegionBroker(RegionBroker regionBroker);
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * 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.
+ * 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.region;
import java.io.IOException;
@@ -49,7 +51,7 @@
subscriptionKey = new SubscriptionKey(context.getClientId(), info.getSubscriptionName());
}
- synchronized public boolean isActive() {
+ public synchronized boolean isActive() {
return active;
}
@@ -57,7 +59,7 @@
return !active || super.isFull();
}
- synchronized public void gc() {
+ public synchronized void gc() {
}
public synchronized void add(ConnectionContext context, Destination destination) throws Exception {
@@ -101,7 +103,7 @@
}
}
- synchronized public void deactivate(boolean keepDurableSubsActive) throws Exception {
+ public synchronized void deactivate(boolean keepDurableSubsActive) throws Exception {
active = false;
this.usageManager.removeUsageListener(this);
synchronized (pending) {
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/IndirectMessageReference.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/IndirectMessageReference.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/IndirectMessageReference.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/IndirectMessageReference.java Thu Aug 9 09:37:49 2007
@@ -78,15 +78,15 @@
this.cachedSize = message.getSize();
}
- synchronized public Message getMessageHardRef() {
+ public synchronized Message getMessageHardRef() {
return message;
}
- synchronized public int getReferenceCount() {
+ public synchronized int getReferenceCount() {
return referenceCount;
}
- synchronized public int incrementReferenceCount() {
+ public synchronized int incrementReferenceCount() {
int rc = ++referenceCount;
if (persistent && rc == 1 && message == null) {
@@ -105,7 +105,7 @@
return rc;
}
- synchronized public int decrementReferenceCount() {
+ public synchronized int decrementReferenceCount() {
int rc = --referenceCount;
if (persistent && rc == 0 && message != null) {
message.decrementReferenceCount();
@@ -114,7 +114,7 @@
return rc;
}
- synchronized public Message getMessage() {
+ public synchronized Message getMessage() {
return message;
}
@@ -122,15 +122,15 @@
return "Message " + messageId + " dropped=" + dropped + " locked=" + (lockOwner != null);
}
- synchronized public void incrementRedeliveryCounter() {
+ public synchronized void incrementRedeliveryCounter() {
this.redeliveryCounter++;
}
- synchronized public boolean isDropped() {
+ public synchronized boolean isDropped() {
return dropped;
}
- synchronized public void drop() {
+ public synchronized void drop() {
dropped = true;
lockOwner = null;
if (!persistent && message != null) {
@@ -150,15 +150,15 @@
}
}
- synchronized public void unlock() {
+ public synchronized void unlock() {
lockOwner = null;
}
- synchronized public LockOwner getLockOwner() {
+ public synchronized LockOwner getLockOwner() {
return lockOwner;
}
- synchronized public int getRedeliveryCounter() {
+ public synchronized int getRedeliveryCounter() {
return redeliveryCounter;
}
@@ -174,15 +174,15 @@
return persistent;
}
- synchronized public boolean isLocked() {
+ public synchronized boolean isLocked() {
return lockOwner != null;
}
- synchronized public boolean isAcked() {
+ public synchronized boolean isAcked() {
return acked;
}
- synchronized public void setAcked(boolean b) {
+ public synchronized void setAcked(boolean b) {
acked = b;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/LockOwner.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/LockOwner.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/LockOwner.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/LockOwner.java Thu Aug 9 09:37:49 2007
@@ -18,7 +18,7 @@
public interface LockOwner {
- public static final LockOwner HIGH_PRIORITY_LOCK_OWNER = new LockOwner() {
+ LockOwner HIGH_PRIORITY_LOCK_OWNER = new LockOwner() {
public int getLockPriority() {
return Integer.MAX_VALUE;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/MessageReference.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/MessageReference.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/MessageReference.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/MessageReference.java Thu Aug 9 09:37:49 2007
@@ -31,29 +31,29 @@
*/
public interface MessageReference {
- public MessageId getMessageId();
- public Message getMessageHardRef();
- public Message getMessage() throws IOException;
- public boolean isPersistent();
+ MessageId getMessageId();
+ Message getMessageHardRef();
+ Message getMessage() throws IOException;
+ boolean isPersistent();
- public Destination getRegionDestination();
+ Destination getRegionDestination();
- public int getRedeliveryCounter();
- public void incrementRedeliveryCounter();
+ int getRedeliveryCounter();
+ void incrementRedeliveryCounter();
- public int getReferenceCount();
+ int getReferenceCount();
- public int incrementReferenceCount();
- public int decrementReferenceCount();
- public ConsumerId getTargetConsumerId();
- public int getSize();
- public long getExpiration();
- public String getGroupID();
- public int getGroupSequence();
+ int incrementReferenceCount();
+ int decrementReferenceCount();
+ ConsumerId getTargetConsumerId();
+ int getSize();
+ long getExpiration();
+ String getGroupID();
+ int getGroupSequence();
/**
* Returns true if this message is expired
*/
- public boolean isExpired();
+ boolean isExpired();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/MessageReferenceFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/MessageReferenceFilter.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/MessageReferenceFilter.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/MessageReferenceFilter.java Thu Aug 9 09:37:49 2007
@@ -1,4 +1,4 @@
-/*
+/**
* 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.
@@ -27,5 +27,5 @@
*/
public interface MessageReferenceFilter {
- public boolean evaluate(ConnectionContext context, MessageReference messageReference) throws JMSException;
+ boolean evaluate(ConnectionContext context, MessageReference messageReference) throws JMSException;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * 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.
+ * 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.region;
import java.io.IOException;
@@ -44,11 +46,11 @@
*
* @version $Revision: 1.15 $
*/
-abstract public class PrefetchSubscription extends AbstractSubscription {
+public abstract class PrefetchSubscription extends AbstractSubscription {
- static private final Log LOG = LogFactory.getLog(PrefetchSubscription.class);
+ private static final Log LOG = LogFactory.getLog(PrefetchSubscription.class);
protected PendingMessageCursor pending;
- final protected LinkedList dispatched = new LinkedList();
+ protected final LinkedList dispatched = new LinkedList();
protected int prefetchExtension;
protected long enqueueCounter;
protected long dispatchCounter;
@@ -317,15 +319,15 @@
return dispatched.size();
}
- synchronized public long getDequeueCounter() {
+ public synchronized long getDequeueCounter() {
return dequeueCounter;
}
- synchronized public long getDispatchedCounter() {
+ public synchronized long getDispatchedCounter() {
return dispatchCounter;
}
- synchronized public long getEnqueueCounter() {
+ public synchronized long getEnqueueCounter() {
return enqueueCounter;
}
@@ -499,7 +501,7 @@
* (another sub may have already dispatched it for example).
* @throws IOException
*/
- abstract protected boolean canDispatch(MessageReference node) throws IOException;
+ protected abstract boolean canDispatch(MessageReference node) throws IOException;
/**
* Used during acknowledgment to remove the message.
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueMessageReference.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueMessageReference.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueMessageReference.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueMessageReference.java Thu Aug 9 09:37:49 2007
@@ -24,19 +24,19 @@
*/
public interface QueueMessageReference extends MessageReference {
- public static final QueueMessageReference NULL_MESSAGE = new NullMessageReference();
+ QueueMessageReference NULL_MESSAGE = new NullMessageReference();
- public boolean isAcked();
+ boolean isAcked();
- public void setAcked(boolean b);
+ void setAcked(boolean b);
- public void drop();
+ void drop();
- public boolean isDropped();
+ boolean isDropped();
- public boolean lock(LockOwner subscription);
+ boolean lock(LockOwner subscription);
- public void unlock();
+ void unlock();
- public LockOwner getLockOwner();
+ LockOwner getLockOwner();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java Thu Aug 9 09:37:49 2007
@@ -33,7 +33,7 @@
public class QueueSubscription extends PrefetchSubscription implements LockOwner {
- private static final Log log = LogFactory.getLog(QueueSubscription.class);
+ private static final Log LOG = LogFactory.getLog(QueueSubscription.class);
public QueueSubscription(Broker broker, ConnectionContext context, ConsumerInfo info) throws InvalidSelectorException {
super(broker, context, info);
@@ -132,7 +132,7 @@
try {
activeMessage.setBooleanProperty("JMSXGroupFirstForConsumer", true, false);
} catch (JMSException e) {
- log.warn("Failed to set boolean header: " + e, e);
+ LOG.warn("Failed to set boolean header: " + e, e);
}
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Region.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Region.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Region.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Region.java Thu Aug 9 09:37:49 2007
@@ -50,7 +50,7 @@
* @return TODO
* @throws Exception TODO
*/
- public Destination addDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception;
+ Destination addDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception;
/**
* Used to destroy a destination.
@@ -62,14 +62,14 @@
* @param timeout the max amount of time to wait for the destination to quiesce
* @throws Exception TODO
*/
- public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception;
+ void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception;
/**
* Returns a copy of the current destinations available in the region
*
* @return a copy of the regions currently active at the time of the call with the key the destination and the value the Destination.
*/
- public Map getDestinationMap();
+ Map getDestinationMap();
/**
@@ -78,14 +78,14 @@
* @return TODO
* @throws Exception TODO
*/
- public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception;
+ Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception;
/**
* Removes a consumer.
* @param context the environment the operation is being executed under.
* @throws Exception TODO
*/
- public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception;
+ void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception;
/**
* Deletes a durable subscription.
@@ -93,7 +93,7 @@
* @param info TODO
* @throws Exception TODO
*/
- public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception;
+ void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception;
/**
* Send a message to the broker to using the specified destination. The destination specified
@@ -103,34 +103,34 @@
* @param message
* @throws Exception TODO
*/
- public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception;
+ void send(ProducerBrokerExchange producerExchange, Message message) throws Exception;
/**
* Used to acknowledge the receipt of a message by a client.
* @param consumerExchange the environment the operation is being executed under.
* @throws Exception TODO
*/
- public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception;
+ void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception;
/**
* Allows a consumer to pull a message from a queue
*/
- public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception;
+ Response messagePull(ConnectionContext context, MessagePull pull) throws Exception;
/**
* Process a notification of a dispatch - used by a Slave Broker
* @param messageDispatchNotification
* @throws Exception TODO
*/
- public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception;
+ void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception;
- public void gc();
+ void gc();
/**
* Provide an exact or wildcard lookup of destinations in the region
*
* @return a set of matching destination objects.
*/
- public Set getDestinations(ActiveMQDestination destination);
+ Set getDestinations(ActiveMQDestination destination);
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java Thu Aug 9 09:37:49 2007
@@ -74,7 +74,7 @@
*/
public class RegionBroker implements Broker {
private static final Log LOG = LogFactory.getLog(RegionBroker.class);
- private static final IdGenerator brokerIdGenerator = new IdGenerator();
+ private static final IdGenerator BROKER_ID_GENERATOR = new IdGenerator();
private final Region queueRegion;
private final Region topicRegion;
@@ -486,7 +486,7 @@
// TODO: this should persist the broker id so that subsequent
// startup
// uses the same broker id.
- brokerId = new BrokerId(brokerIdGenerator.generateId());
+ brokerId = new BrokerId(BROKER_ID_GENERATOR.generateId());
}
return brokerId;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Subscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Subscription.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Subscription.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Subscription.java Thu Aug 9 09:37:49 2007
@@ -140,50 +140,50 @@
/**
* @return the JMS selector on the current subscription
*/
- public String getSelector();
+ String getSelector();
/**
* Attempts to change the current active selector on the subscription.
* This operation is not supported for persistent topics.
*/
- public void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException;
+ void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException;
/**
* @return the JMX object name that this subscription was registered as if applicable
*/
- public ObjectName getObjectName();
+ ObjectName getObjectName();
/**
* Set when the subscription is registered in JMX
*/
- public void setObjectName(ObjectName objectName);
+ void setObjectName(ObjectName objectName);
/**
* @return true when 60% or more room is left for dispatching messages
*/
- public boolean isLowWaterMark();
+ boolean isLowWaterMark();
/**
* @return true when 10% or less room is left for dispatching messages
*/
- public boolean isHighWaterMark();
+ boolean isHighWaterMark();
/**
* inform the MessageConsumer on the client to change it's prefetch
* @param newPrefetch
*/
- public void updateConsumerPrefetch(int newPrefetch);
+ void updateConsumerPrefetch(int newPrefetch);
/**
* optimize message consumer prefetch if the consumer supports it
*
*/
- public void optimizePrefetch();
+ void optimizePrefetch();
/**
* Called when the subscription is destroyed.
*/
- public void destroy();
+ void destroy();
/**
* @return the prefetch size that is configured for the subscription
@@ -196,6 +196,6 @@
* @see org.apache.activemq.region.cursors.PendingMessageCursor
* @return true if recovery required
*/
- public boolean isRecoveryRequired();
+ boolean isRecoveryRequired();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TempTopicRegion.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TempTopicRegion.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TempTopicRegion.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TempTopicRegion.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * 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.
+ * 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.region;
import javax.jms.JMSException;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * 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.
+ * 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.region;
import java.io.IOException;
@@ -42,25 +44,28 @@
public class TopicSubscription extends AbstractSubscription {
private static final Log LOG = LogFactory.getLog(TopicSubscription.class);
- private static final AtomicLong cursorNameCounter = new AtomicLong(0);
+ private static final AtomicLong CURSOR_NAME_COUNTER = new AtomicLong(0);
+
protected PendingMessageCursor matched;
- final protected UsageManager usageManager;
+ protected final UsageManager usageManager;
protected AtomicLong dispatchedCounter = new AtomicLong();
protected AtomicLong prefetchExtension = new AtomicLong();
+
+ boolean singleDestination = true;
+ Destination destination;
+
private int maximumPendingMessages = -1;
private MessageEvictionStrategy messageEvictionStrategy = new OldestMessageEvictionStrategy();
private int discarded;
private final Object matchedListMutex = new Object();
private final AtomicLong enqueueCounter = new AtomicLong(0);
private final AtomicLong dequeueCounter = new AtomicLong(0);
- boolean singleDestination = true;
- Destination destination;
private int memoryUsageHighWaterMark = 95;
public TopicSubscription(Broker broker, ConnectionContext context, ConsumerInfo info, UsageManager usageManager) throws Exception {
super(broker, context, info);
this.usageManager = usageManager;
- String matchedName = "TopicSubscription:" + cursorNameCounter.getAndIncrement() + "[" + info.getConsumerId().toString() + "]";
+ String matchedName = "TopicSubscription:" + CURSOR_NAME_COUNTER.getAndIncrement() + "[" + info.getConsumerId().toString() + "]";
this.matched = new FilePendingMessageCursor(matchedName, broker.getTempDataStore());
}
@@ -165,7 +170,7 @@
}
}
- synchronized public void acknowledge(final ConnectionContext context, final MessageAck ack) throws Exception {
+ public synchronized void acknowledge(final ConnectionContext context, final MessageAck ack) throws Exception {
// Handle the standard acknowledgment case.
boolean wasFull = isFull();
if (ack.isStandardAck() || ack.isPoisonAck()) {
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/AbstractPendingMessageCursor.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * 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.
+ * 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.region.cursors;
import java.util.LinkedList;