activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r564814 [2/8] - 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/broker/ activemq-core/src/main/java/org/apache/ac...
Date Sat, 11 Aug 2007 00:49:31 GMT
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java Fri Aug 10 17:49:19 2007
@@ -83,6 +83,7 @@
 import org.apache.activemq.thread.Task;
 import org.apache.activemq.thread.TaskRunner;
 import org.apache.activemq.thread.TaskRunnerFactory;
+import org.apache.activemq.transaction.Transaction;
 import org.apache.activemq.transport.DefaultTransportListener;
 import org.apache.activemq.transport.ResponseCorrelator;
 import org.apache.activemq.transport.Transport;
@@ -100,27 +101,31 @@
 public class TransportConnection implements Service, Connection, Task, CommandVisitor {
 
     private static final Log LOG = LogFactory.getLog(TransportConnection.class);
-    private static final Log TRANSPORTLOG = LogFactory.getLog(TransportConnection.class.getName() + ".Transport");
+    private static final Log TRANSPORTLOG = LogFactory.getLog(TransportConnection.class.getName()
+                                                              + ".Transport");
     private static final Log SERVICELOG = LogFactory.getLog(TransportConnection.class.getName() + ".Service");
+
     // Keeps track of the broker and connector that created this connection.
     protected final Broker broker;
-    private MasterBroker masterBroker;
     protected final TransportConnector connector;
-    private final Transport transport;
-    private MessageAuthorizationPolicy messageAuthorizationPolicy;
     // Keeps track of the state of the connections.
     // protected final ConcurrentHashMap localConnectionStates=new
     // ConcurrentHashMap();
     protected final Map<ConnectionId, ConnectionState> brokerConnectionStates;
     // The broker and wireformat info that was exchanged.
     protected BrokerInfo brokerInfo;
+    protected final List<Command> dispatchQueue = Collections.synchronizedList(new LinkedList<Command>());
+    protected TaskRunner taskRunner;
+    protected final AtomicReference<IOException> transportException = new AtomicReference<IOException>();
+    protected AtomicBoolean dispatchStopped = new AtomicBoolean(false);
+
+    private MasterBroker masterBroker;
+    private final Transport transport;
+    private MessageAuthorizationPolicy messageAuthorizationPolicy;
     private WireFormatInfo wireFormatInfo;
     // Used to do async dispatch.. this should perhaps be pushed down into the
     // transport layer..
-    protected final List<Command> dispatchQueue = Collections.synchronizedList(new LinkedList<Command>());
-    protected TaskRunner taskRunner;
-    protected final AtomicReference transportException = new AtomicReference();
-    private boolean inServiceException = false;
+    private boolean inServiceException;
     private ConnectionStatistics statistics = new ConnectionStatistics();
     private boolean manageable;
     private boolean slow;
@@ -140,7 +145,6 @@
     private final Map<ProducerId, ProducerBrokerExchange> producerExchanges = new HashMap<ProducerId, ProducerBrokerExchange>();
     private final Map<ConsumerId, ConsumerBrokerExchange> consumerExchanges = new HashMap<ConsumerId, ConsumerBrokerExchange>();
     private CountDownLatch dispatchStoppedLatch = new CountDownLatch(1);
-    protected AtomicBoolean dispatchStopped = new AtomicBoolean(false);
     private ConnectionContext context;
     private boolean networkConnection;
     private AtomicInteger protocolVersion = new AtomicInteger(CommandTypes.PROTOCOL_VERSION);
@@ -193,7 +197,8 @@
      * @param taskRunnerFactory - can be null if you want direct dispatch to the
      *                transport else commands are sent async.
      */
-    public TransportConnection(TransportConnector connector, final Transport transport, Broker broker, TaskRunnerFactory taskRunnerFactory) {
+    public TransportConnection(TransportConnector connector, final Transport transport, Broker broker,
+                               TaskRunnerFactory taskRunnerFactory) {
         this.connector = connector;
         this.broker = broker;
         RegionBroker rb = (RegionBroker)broker.getAdaptor(RegionBroker.class);
@@ -264,7 +269,7 @@
      * error transmitted to the client before stopping it's transport.
      */
     public void serviceException(Throwable e) {
-        
+
         // are we a transport exception such as not being able to dispatch
         // synchronously to a transport
         if (e instanceof IOException) {
@@ -275,7 +280,8 @@
 
             if (!disposed.get()) {
                 if (SERVICELOG.isDebugEnabled()) {
-                    SERVICELOG.debug("Broker has been stopped.  Notifying client and closing his connection.");
+                    SERVICELOG
+                        .debug("Broker has been stopped.  Notifying client and closing his connection.");
                 }
 
                 ConnectionError ce = new ConnectionError();
@@ -408,7 +414,8 @@
         }
         TransactionState transactionState = cs.getTransactionState(info.getTransactionId());
         if (transactionState == null) {
-            throw new IllegalStateException("Cannot prepare a transaction that had not been started: " + info.getTransactionId());
+            throw new IllegalStateException("Cannot prepare a transaction that had not been started: "
+                                            + info.getTransactionId());
         }
         // Avoid dups.
         if (!transactionState.isPrepared()) {
@@ -478,7 +485,8 @@
         return broker.messagePull(lookupConnectionState(pull.getConsumerId()).getContext(), pull);
     }
 
-    public Response processMessageDispatchNotification(MessageDispatchNotification notification) throws Exception {
+    public Response processMessageDispatchNotification(MessageDispatchNotification notification)
+        throws Exception {
         broker.processDispatchNotification(notification);
         return null;
     }
@@ -507,7 +515,9 @@
         TransportConnectionState cs = lookupConnectionState(connectionId);
         SessionState ss = cs.getSessionState(sessionId);
         if (ss == null) {
-            throw new IllegalStateException("Cannot add a producer to a session that had not been registered: " + sessionId);
+            throw new IllegalStateException(
+                                            "Cannot add a producer to a session that had not been registered: "
+                                                + sessionId);
         }
         // Avoid replaying dup commands
         if (!ss.getProducerIds().contains(info.getProducerId())) {
@@ -527,7 +537,9 @@
         TransportConnectionState cs = lookupConnectionState(connectionId);
         SessionState ss = cs.getSessionState(sessionId);
         if (ss == null) {
-            throw new IllegalStateException("Cannot remove a producer from a session that had not been registered: " + sessionId);
+            throw new IllegalStateException(
+                                            "Cannot remove a producer from a session that had not been registered: "
+                                                + sessionId);
         }
         ProducerState ps = ss.removeProducer(id);
         if (ps == null) {
@@ -544,7 +556,9 @@
         TransportConnectionState cs = lookupConnectionState(connectionId);
         SessionState ss = cs.getSessionState(sessionId);
         if (ss == null) {
-            throw new IllegalStateException("Cannot add a consumer to a session that had not been registered: " + sessionId);
+            throw new IllegalStateException(
+                                            "Cannot add a consumer to a session that had not been registered: "
+                                                + sessionId);
         }
         // Avoid replaying dup commands
         if (!ss.getConsumerIds().contains(info.getConsumerId())) {
@@ -564,7 +578,9 @@
         TransportConnectionState cs = lookupConnectionState(connectionId);
         SessionState ss = cs.getSessionState(sessionId);
         if (ss == null) {
-            throw new IllegalStateException("Cannot remove a consumer from a session that had not been registered: " + sessionId);
+            throw new IllegalStateException(
+                                            "Cannot remove a consumer from a session that had not been registered: "
+                                                + sessionId);
         }
         ConsumerState consumerState = ss.removeConsumer(id);
         if (consumerState == null) {
@@ -644,7 +660,8 @@
             if (state.getConnection() != this) {
                 LOG.debug("Killing previous stale connection: " + state.getConnection().getRemoteAddress());
                 state.getConnection().stop();
-                LOG.debug("Connection " + getRemoteAddress() + " taking over previous connection: " + state.getConnection().getRemoteAddress());
+                LOG.debug("Connection " + getRemoteAddress() + " taking over previous connection: "
+                          + state.getConnection().getRemoteAddress());
                 state.setConnection(this);
                 state.reset(info);
             }
@@ -659,7 +676,7 @@
         context.setConnection(this);
         context.setBroker(broker);
         context.setConnector(connector);
-        context.setTransactions(new ConcurrentHashMap());
+        context.setTransactions(new ConcurrentHashMap<TransactionId, Transaction>());
         context.setClientId(clientId);
         context.setUserName(info.getUserName());
         context.setConnectionId(info.getConnectionId());
@@ -767,7 +784,8 @@
     }
 
     protected void processDispatch(Command command) throws IOException {
-        final MessageDispatch messageDispatch = (MessageDispatch)(command.isMessageDispatch() ? command : null);
+        final MessageDispatch messageDispatch = (MessageDispatch)(command.isMessageDispatch()
+            ? command : null);
         try {
             if (!disposed.get()) {
                 if (messageDispatch != null) {
@@ -847,7 +865,8 @@
             transport.start();
 
             if (taskRunnerFactory != null) {
-                taskRunner = taskRunnerFactory.createTaskRunner(this, "ActiveMQ Connection Dispatcher: " + getRemoteAddress());
+                taskRunner = taskRunnerFactory.createTaskRunner(this, "ActiveMQ Connection Dispatcher: "
+                                                                      + getRemoteAddress());
             } else {
                 taskRunner = null;
             }
@@ -931,8 +950,8 @@
 
             // Run the MessageDispatch callbacks so that message references get
             // cleaned up.
-            for (Iterator iter = dispatchQueue.iterator(); iter.hasNext();) {
-                Command command = (Command)iter.next();
+            for (Iterator<Command> iter = dispatchQueue.iterator(); iter.hasNext();) {
+                Command command = iter.next();
                 if (command.isMessageDispatch()) {
                     MessageDispatch md = (MessageDispatch)command;
                     Runnable sub = md.getTransmitCallback();
@@ -1105,18 +1124,19 @@
             // We have been requested to create a two way pipe ...
             try {
                 Properties properties = MarshallingSupport.stringToProperties(info.getNetworkProperties());
-                Map<String, String> props = new HashMap(properties);
+                Map<String, String> props = createMap(properties);
                 NetworkBridgeConfiguration config = new NetworkBridgeConfiguration();
                 IntrospectionSupport.setProperties(config, props, "");
                 config.setBrokerName(broker.getBrokerName());
                 URI uri = broker.getVmConnectorURI();
-                HashMap<String,String> map = new HashMap<String,String>(URISupport.parseParamters(uri));
+                HashMap<String, String> map = new HashMap<String, String>(URISupport.parseParamters(uri));
                 map.put("network", "true");
                 map.put("async", "false");
                 uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map));
                 Transport localTransport = TransportFactory.connect(uri);
                 Transport remoteBridgeTransport = new ResponseCorrelator(transport);
-                duplexBridge = NetworkBridgeFactory.createBridge(config, localTransport, remoteBridgeTransport);
+                duplexBridge = NetworkBridgeFactory.createBridge(config, localTransport,
+                                                                 remoteBridgeTransport);
                 // now turn duplex off this side
                 info.setDuplexConnection(false);
                 duplexBridge.setCreatedByDuplex(true);
@@ -1144,6 +1164,11 @@
         return null;
     }
 
+    @SuppressWarnings("unchecked")
+    private HashMap<String, String> createMap(Properties properties) {
+        return new HashMap(properties);
+    }
+
     protected void dispatch(Command command) throws IOException {
         try {
             setMarkedCandidate(true);
@@ -1182,7 +1207,8 @@
                     ProducerState producerState = ss.getProducerState(id);
                     if (producerState != null && producerState.getInfo() != null) {
                         ProducerInfo info = producerState.getInfo();
-                        result.setMutable(info.getDestination() == null || info.getDestination().isComposite());
+                        result.setMutable(info.getDestination() == null
+                                          || info.getDestination().isComposite());
                     }
                 }
                 producerExchanges.put(id, result);
@@ -1213,7 +1239,7 @@
                     if (cs != null) {
                         ConsumerInfo info = cs.getInfo();
                         if (info != null) {
-                            if (info.getDestination() != null && info.getDestination().isPattern()) { 
+                            if (info.getDestination() != null && info.getDestination().isPattern()) {
                                 result.setWildcard(true);
                             }
                         }
@@ -1287,7 +1313,8 @@
     //
     // /////////////////////////////////////////////////////////////////
 
-    protected TransportConnectionState registerConnectionState(ConnectionId connectionId, TransportConnectionState state) {
+    protected TransportConnectionState registerConnectionState(ConnectionId connectionId,
+                                                               TransportConnectionState state) {
         TransportConnectionState rc = connectionState;
         connectionState = state;
         return rc;
@@ -1310,7 +1337,9 @@
     protected TransportConnectionState lookupConnectionState(String connectionId) {
         TransportConnectionState cs = connectionState;
         if (cs == null) {
-            throw new IllegalStateException("Cannot lookup a connectionId for a connection that had not been registered: " + connectionId);
+            throw new IllegalStateException(
+                                            "Cannot lookup a connectionId for a connection that had not been registered: "
+                                                + connectionId);
         }
         return cs;
     }
@@ -1318,7 +1347,9 @@
     protected TransportConnectionState lookupConnectionState(ConsumerId id) {
         TransportConnectionState cs = connectionState;
         if (cs == null) {
-            throw new IllegalStateException("Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId());
+            throw new IllegalStateException(
+                                            "Cannot lookup a consumer from a connection that had not been registered: "
+                                                + id.getParentId().getParentId());
         }
         return cs;
     }
@@ -1326,7 +1357,9 @@
     protected TransportConnectionState lookupConnectionState(ProducerId id) {
         TransportConnectionState cs = connectionState;
         if (cs == null) {
-            throw new IllegalStateException("Cannot lookup a producer from a connection that had not been registered: " + id.getParentId().getParentId());
+            throw new IllegalStateException(
+                                            "Cannot lookup a producer from a connection that had not been registered: "
+                                                + id.getParentId().getParentId());
         }
         return cs;
     }
@@ -1334,7 +1367,9 @@
     protected TransportConnectionState lookupConnectionState(SessionId id) {
         TransportConnectionState cs = connectionState;
         if (cs == null) {
-            throw new IllegalStateException("Cannot lookup a session from a connection that had not been registered: " + id.getParentId());
+            throw new IllegalStateException(
+                                            "Cannot lookup a session from a connection that had not been registered: "
+                                                + id.getParentId());
         }
         return cs;
     }
@@ -1342,7 +1377,8 @@
     protected TransportConnectionState lookupConnectionState(ConnectionId connectionId) {
         TransportConnectionState cs = connectionState;
         if (cs == null) {
-            throw new IllegalStateException("Cannot lookup a connection that had not been registered: " + connectionId);
+            throw new IllegalStateException("Cannot lookup a connection that had not been registered: "
+                                            + connectionId);
         }
         return cs;
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportStatusDetector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportStatusDetector.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportStatusDetector.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportStatusDetector.java Fri Aug 10 17:49:19 2007
@@ -34,7 +34,7 @@
 public class TransportStatusDetector implements Service, Runnable {
     private static final Log LOG = LogFactory.getLog(TransportStatusDetector.class);
     private TransportConnector connector;
-    private Set collectionCandidates = new CopyOnWriteArraySet();
+    private Set<TransportConnection> collectionCandidates = new CopyOnWriteArraySet<TransportConnection>();
     private AtomicBoolean started = new AtomicBoolean(false);
     private Thread runner;
     private int sweepInterval = 5000;
@@ -60,8 +60,8 @@
     }
 
     protected void doCollection() {
-        for (Iterator i = collectionCandidates.iterator(); i.hasNext();) {
-            TransportConnection tc = (TransportConnection)i.next();
+        for (Iterator<TransportConnection> i = collectionCandidates.iterator(); i.hasNext();) {
+            TransportConnection tc = i.next();
             if (tc.isMarkedCandidate()) {
                 if (tc.isBlockedCandidate()) {
                     collectionCandidates.remove(tc);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ft/MasterConnector.java Fri Aug 10 17:49:19 2007
@@ -69,7 +69,7 @@
     private ConnectionInfo connectionInfo;
     private SessionInfo sessionInfo;
     private ProducerInfo producerInfo;
-    final AtomicBoolean masterActive = new AtomicBoolean();
+    private final AtomicBoolean masterActive = new AtomicBoolean();
 
     public MasterConnector() {
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java Fri Aug 10 17:49:19 2007
@@ -196,7 +196,7 @@
     public void destroyDurableSubscriber(String clientId, String subscriberName) throws Exception {
         RemoveSubscriptionInfo info = new RemoveSubscriptionInfo();
         info.setClientId(clientId);
-        info.setSubcriptionName(subscriberName);
+        info.setSubscriptionName(subscriberName);
         ConnectionContext context = new ConnectionContext();
         context.setBroker(broker);
         context.setClientId(clientId);

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=564814&r1=564813&r2=564814
==============================================================================
--- 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 Fri Aug 10 17:49:19 2007
@@ -128,7 +128,7 @@
 
     public CompositeData[] browse(String selector) throws OpenDataException, InvalidSelectorException {
         Message[] messages = destination.browse();
-        ArrayList c = new ArrayList();
+        ArrayList<CompositeData> c = new ArrayList<CompositeData>();
 
         MessageEvaluationContext ctx = new MessageEvaluationContext();
         ctx.setDestination(destination.getActiveMQDestination());
@@ -159,7 +159,7 @@
     /**
      * Browses the current destination returning a list of messages
      */
-    public List browseMessages() throws InvalidSelectorException {
+    public List<Object> browseMessages() throws InvalidSelectorException {
         return browseMessages(null);
     }
 
@@ -167,9 +167,9 @@
      * Browses the current destination with the given selector returning a list
      * of messages
      */
-    public List browseMessages(String selector) throws InvalidSelectorException {
+    public List<Object> browseMessages(String selector) throws InvalidSelectorException {
         Message[] messages = destination.browse();
-        ArrayList answer = new ArrayList();
+        ArrayList<Object> answer = new ArrayList<Object>();
 
         MessageEvaluationContext ctx = new MessageEvaluationContext();
         ctx.setDestination(destination.getActiveMQDestination());

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DurableSubscriptionView.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DurableSubscriptionView.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DurableSubscriptionView.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DurableSubscriptionView.java Fri Aug 10 17:49:19 2007
@@ -78,7 +78,7 @@
     public void destroy() throws Exception {
         RemoveSubscriptionInfo info = new RemoveSubscriptionInfo();
         info.setClientId(clientId);
-        info.setSubcriptionName(subscriptionName);
+        info.setSubscriptionName(subscriptionName);
         ConnectionContext context = new ConnectionContext();
         context.setBroker(broker);
         context.setClientId(clientId);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/InactiveDurableSubscriptionView.java Fri Aug 10 17:49:19 2007
@@ -123,7 +123,7 @@
     public void destroy() throws Exception {
         RemoveSubscriptionInfo info = new RemoveSubscriptionInfo();
         info.setClientId(clientId);
-        info.setSubcriptionName(subscriptionInfo.getSubscriptionName());
+        info.setSubscriptionName(subscriptionInfo.getSubscriptionName());
         ConnectionContext context = new ConnectionContext();
         context.setBroker(broker);
         context.setClientId(clientId);

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=564814&r1=564813&r2=564814
==============================================================================
--- 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 Fri Aug 10 17:49:19 2007
@@ -320,7 +320,7 @@
             SubscriptionKey subscriptionKey = new SubscriptionKey(view.getClientId(), view.getSubscriptionName());
             SubscriptionInfo info = new SubscriptionInfo();
             info.setClientId(subscriptionKey.getClientId());
-            info.setSubcriptionName(subscriptionKey.getSubscriptionName());
+            info.setSubscriptionName(subscriptionKey.getSubscriptionName());
             info.setDestination(new ActiveMQTopic(view.getDestinationName()));
             addInactiveSubscription(subscriptionKey, info);
         }
@@ -418,9 +418,6 @@
 
                 public boolean recoverMessageReference(MessageId messageReference) throws Exception {
                     throw new RuntimeException("Should not be called.");
-                }
-
-                public void finished() {
                 }
 
                 public boolean hasSpace() {

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=564814&r1=564813&r2=564814
==============================================================================
--- 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 Fri Aug 10 17:49:19 2007
@@ -243,7 +243,7 @@
             // inactive state for the
             // destination which has reduced memory usage.
             //
-            DestinationFilter destinationFilter = DestinationFilter.parseFilter(info.getDestination());
+            DestinationFilter.parseFilter(info.getDestination());
 
             Subscription sub = createSubscription(context, info);
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFactoryImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFactoryImpl.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFactoryImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFactoryImpl.java Fri Aug 10 17:49:19 2007
@@ -65,7 +65,7 @@
         this.broker = broker;
     }
 
-    public Set getDestinations() {
+    public Set<ActiveMQDestination> getDestinations() {
         return persistenceAdapter.getDestinations();
     }
 

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=564814&r1=564813&r2=564814
==============================================================================
--- 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 Fri Aug 10 17:49:19 2007
@@ -23,10 +23,12 @@
 import org.apache.activemq.broker.Broker;
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.region.cursors.StoreDurableSubscriberCursor;
+import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ConsumerInfo;
 import org.apache.activemq.command.Message;
 import org.apache.activemq.command.MessageAck;
 import org.apache.activemq.command.MessageDispatch;
+import org.apache.activemq.command.MessageId;
 import org.apache.activemq.memory.UsageListener;
 import org.apache.activemq.memory.UsageManager;
 import org.apache.activemq.util.SubscriptionKey;
@@ -36,8 +38,8 @@
 public class DurableTopicSubscription extends PrefetchSubscription implements UsageListener {
 
     private static final Log LOG = LogFactory.getLog(PrefetchSubscription.class);
-    private final ConcurrentHashMap redeliveredMessages = new ConcurrentHashMap();
-    private final ConcurrentHashMap destinations = new ConcurrentHashMap();
+    private final ConcurrentHashMap<MessageId, Integer> redeliveredMessages = new ConcurrentHashMap<MessageId, Integer>();
+    private final ConcurrentHashMap<ActiveMQDestination, Destination> destinations = new ConcurrentHashMap<ActiveMQDestination, Destination>();
     private final SubscriptionKey subscriptionKey;
     private final boolean keepDurableSubsActive;
     private final UsageManager usageManager;
@@ -82,7 +84,7 @@
             this.context = context;
             this.info = info;
             if (!keepDurableSubsActive) {
-                for (Iterator iter = destinations.values().iterator(); iter.hasNext();) {
+                for (Iterator<Destination> iter = destinations.values().iterator(); iter.hasNext();) {
                     Topic topic = (Topic)iter.next();
                     topic.activate(context, this);
                 }
@@ -93,7 +95,7 @@
             // If nothing was in the persistent store, then try to use the
             // recovery policy.
             if (pending.isEmpty()) {
-                for (Iterator iter = destinations.values().iterator(); iter.hasNext();) {
+                for (Iterator<Destination> iter = destinations.values().iterator(); iter.hasNext();) {
                     Topic topic = (Topic)iter.next();
                     topic.recoverRetroactiveMessages(context, this);
                 }
@@ -110,7 +112,7 @@
             pending.stop();
         }
         if (!keepDurableSubsActive) {
-            for (Iterator iter = destinations.values().iterator(); iter.hasNext();) {
+            for (Iterator<Destination> iter = destinations.values().iterator(); iter.hasNext();) {
                 Topic topic = (Topic)iter.next();
                 topic.deactivate(context, this);
             }
@@ -118,7 +120,7 @@
         for (Iterator iter = dispatched.iterator(); iter.hasNext();) {
             // Mark the dispatched messages as redelivered for next time.
             MessageReference node = (MessageReference)iter.next();
-            Integer count = (Integer)redeliveredMessages.get(node.getMessageId());
+            Integer count = redeliveredMessages.get(node.getMessageId());
             if (count != null) {
                 redeliveredMessages.put(node.getMessageId(), Integer.valueOf(count.intValue() + 1));
             } else {
@@ -152,7 +154,7 @@
 
     protected MessageDispatch createMessageDispatch(MessageReference node, Message message) {
         MessageDispatch md = super.createMessageDispatch(node, message);
-        Integer count = (Integer)redeliveredMessages.get(node.getMessageId());
+        Integer count = redeliveredMessages.get(node.getMessageId());
         if (count != null) {
             md.setRedeliveryCounter(count.intValue());
         }

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=564814&r1=564813&r2=564814
==============================================================================
--- 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 Fri Aug 10 17:49:19 2007
@@ -114,8 +114,8 @@
         tempTopicRegion = createTempTopicRegion(memoryManager, taskRunnerFactory, destinationFactory);
     }
 
-    public Map getDestinationMap() {
-        Map answer = getQueueRegion().getDestinationMap();
+    public Map<ActiveMQDestination, Destination> getDestinationMap() {
+        Map<ActiveMQDestination, Destination> answer = getQueueRegion().getDestinationMap();
         answer.putAll(getTopicRegion().getDestinationMap());
         return answer;
     }
@@ -174,10 +174,6 @@
         return new QueueRegion(this, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory);
     }
 
-    private static PersistenceAdapter createDefaultPersistenceAdapter(UsageManager memoryManager) throws IOException {
-        return new MemoryPersistenceAdapter();
-    }
-
     public void start() throws Exception {
         ((TopicRegion)topicRegion).setKeepDurableSubsActive(keepDurableSubsActive);
         started = true;
@@ -575,7 +571,7 @@
         return !started;
     }
 
-    public Set getDurableDestinations() {
+    public Set<ActiveMQDestination> getDurableDestinations() {
         return destinationFactory.getDestinations();
     }
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicRegion.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicRegion.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicRegion.java Fri Aug 10 17:49:19 2007
@@ -276,10 +276,10 @@
         return !info1.getDestination().equals(info2.getDestination());
     }
 
-    protected Set getInactiveDestinations() {
-        Set inactiveDestinations = super.getInactiveDestinations();
-        for (Iterator iter = inactiveDestinations.iterator(); iter.hasNext();) {
-            ActiveMQDestination dest = (ActiveMQDestination)iter.next();
+    protected Set<ActiveMQDestination> getInactiveDestinations() {
+        Set<ActiveMQDestination> inactiveDestinations = super.getInactiveDestinations();
+        for (Iterator<ActiveMQDestination> iter = inactiveDestinations.iterator(); iter.hasNext();) {
+            ActiveMQDestination dest = iter.next();
             if (!dest.isTopic()) {
                 iter.remove();
             }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java Fri Aug 10 17:49:19 2007
@@ -46,8 +46,8 @@
     
     private Store store;
     private String name;
-    private LinkedList memoryList = new LinkedList();
-    private ListContainer diskList;
+    private LinkedList<MessageReference> memoryList = new LinkedList<MessageReference>();
+    private ListContainer<MessageReference> diskList;
     private Iterator iter;
     private Destination regionDestination;
     private boolean iterating;
@@ -105,7 +105,7 @@
 
     public synchronized void destroy() {
         stop();
-        for (Iterator i = memoryList.iterator(); i.hasNext();) {
+        for (Iterator<MessageReference> i = memoryList.iterator(); i.hasNext();) {
             Message node = (Message)i.next();
             node.decrementReferenceCount();
         }
@@ -115,15 +115,15 @@
         }
     }
 
-    public synchronized LinkedList pageInList(int maxItems) {
-        LinkedList result = new LinkedList();
+    public synchronized LinkedList<MessageReference> pageInList(int maxItems) {
+        LinkedList<MessageReference> result = new LinkedList<MessageReference>();
         int count = 0;
-        for (Iterator i = memoryList.iterator(); i.hasNext() && count < maxItems;) {
+        for (Iterator<MessageReference> i = memoryList.iterator(); i.hasNext() && count < maxItems;) {
             result.add(i.next());
             count++;
         }
         if (count < maxItems && !isDiskListEmpty()) {
-            for (Iterator i = getDiskList().iterator(); i.hasNext() && count < maxItems;) {
+            for (Iterator<MessageReference> i = getDiskList().iterator(); i.hasNext() && count < maxItems;) {
                 Message message = (Message)i.next();
                 message.setRegionDestination(regionDestination);
                 message.incrementReferenceCount();
@@ -262,7 +262,7 @@
     protected synchronized void flushToDisk() {
         if (!memoryList.isEmpty()) {
             while (!memoryList.isEmpty()) {
-                MessageReference node = (MessageReference)memoryList.removeFirst();
+                MessageReference node = memoryList.removeFirst();
                 node.decrementReferenceCount();
                 getDiskList().addLast(node);
             }
@@ -274,7 +274,7 @@
         return diskList == null || diskList.isEmpty();
     }
 
-    protected ListContainer getDiskList() {
+    protected ListContainer<MessageReference> getDiskList() {
         if (diskList == null) {
             try {
                 diskList = store.getListContainer(name, "TopicSubscription", true);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java Fri Aug 10 17:49:19 2007
@@ -32,7 +32,7 @@
 public class StoreQueueCursor extends AbstractPendingMessageCursor {
 
     private static final Log LOG = LogFactory.getLog(StoreQueueCursor.class);
-    private int pendingCount = 0;
+    private int pendingCount;
     private Queue queue;
     private Store tmpStore;
     private PendingMessageCursor nonPersistent;

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/group/SimpleMessageGroupMap.java Fri Aug 10 17:49:19 2007
@@ -30,25 +30,25 @@
  * @version $Revision$
  */
 public class SimpleMessageGroupMap implements MessageGroupMap {
-    private Map map = new ConcurrentHashMap();
+    private Map<String, ConsumerId> map = new ConcurrentHashMap<String, ConsumerId>();
     
     public void put(String groupId, ConsumerId consumerId) {
         map.put(groupId, consumerId);
     }
 
     public ConsumerId get(String groupId) {
-        return (ConsumerId) map.get(groupId);
+        return map.get(groupId);
     }
 
     public ConsumerId removeGroup(String groupId) {
-        return (ConsumerId) map.remove(groupId);
+        return map.remove(groupId);
     }
 
     public MessageGroupSet removeConsumer(ConsumerId consumerId) {
         SimpleMessageGroupSet ownedGroups = new SimpleMessageGroupSet();
-        for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
-            String group = (String) iter.next();
-            ConsumerId owner = (ConsumerId) map.get(group);
+        for (Iterator<String> iter = map.keySet().iterator(); iter.hasNext();) {
+            String group = iter.next();
+            ConsumerId owner = map.get(group);
             if (owner.equals(consumerId)) {
                 ownedGroups.add(group);
                 iter.remove();

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/group/SimpleMessageGroupSet.java Fri Aug 10 17:49:19 2007
@@ -26,7 +26,7 @@
  */
 public class SimpleMessageGroupSet implements MessageGroupSet {
 
-    private Set set = new HashSet();
+    private Set<String> set = new HashSet<String>();
 
     public boolean contains(String groupID) {
         return set.contains(groupID);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/DispatchPolicy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/DispatchPolicy.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/DispatchPolicy.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/DispatchPolicy.java Fri Aug 10 17:49:19 2007
@@ -19,6 +19,7 @@
 import java.util.List;
 
 import org.apache.activemq.broker.region.MessageReference;
+import org.apache.activemq.broker.region.Subscription;
 import org.apache.activemq.filter.MessageEvaluationContext;
 
 /**
@@ -43,6 +44,6 @@
      * 
      * @return true if at least one consumer was dispatched or false if there are no active subscriptions that could be dispatched
      */
-    boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) throws Exception;
+    boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List<Subscription> consumers) throws Exception;
 
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/LastImageSubscriptionRecoveryPolicy.java Fri Aug 10 17:49:19 2007
@@ -57,12 +57,12 @@
     }
 
     public Message[] browse(ActiveMQDestination destination) throws Exception {
-        List result = new ArrayList();
+        List<Message> result = new ArrayList<Message>();
         DestinationFilter filter = DestinationFilter.parseFilter(destination);
         if (filter.matches(lastImage.getMessage().getDestination())) {
             result.add(lastImage.getMessage());
         }
-        return (Message[])result.toArray(new Message[result.size()]);
+        return result.toArray(new Message[result.size()]);
     }
 
     public SubscriptionRecoveryPolicy copy() {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java Fri Aug 10 17:49:19 2007
@@ -43,7 +43,7 @@
      * @see org.apache.activemq.broker.region.policy.DispatchPolicy#dispatch(org.apache.activemq.broker.region.MessageReference,
      *      org.apache.activemq.filter.MessageEvaluationContext, java.util.List)
      */
-    public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) throws Exception {
+    public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List<Subscription> consumers) throws Exception {
 
         // Big synch here so that only 1 message gets dispatched at a time.
         // Ensures
@@ -54,8 +54,8 @@
             int count = 0;
 
             Subscription firstMatchingConsumer = null;
-            for (Iterator iter = consumers.iterator(); iter.hasNext();) {
-                Subscription sub = (Subscription)iter.next();
+            for (Iterator<Subscription> iter = consumers.iterator(); iter.hasNext();) {
+                Subscription sub = iter.next();
 
                 // Only dispatch to interested subscriptions
                 if (!sub.matches(node, msgContext)) {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/TimedSubscriptionRecoveryPolicy.java Fri Aug 10 17:49:19 2007
@@ -45,7 +45,7 @@
 
     // TODO: need to get a better synchronized linked list that has little
     // contention between enqueuing and dequeuing
-    private final List buffer = Collections.synchronizedList(new LinkedList());
+    private final List<TimestampWrapper> buffer = Collections.synchronizedList(new LinkedList<TimestampWrapper>());
     private volatile long lastGCRun = System.currentTimeMillis();
 
     private long recoverDuration = 60 * 1000; // Buffer for 1 min.
@@ -79,11 +79,10 @@
 
     public void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception {
         // Re-dispatch the messages from the buffer.
-        ArrayList copy = new ArrayList(buffer);
+        ArrayList<TimestampWrapper> copy = new ArrayList<TimestampWrapper>(buffer);
         if (!copy.isEmpty()) {
-            MessageEvaluationContext msgContext = context.getMessageEvaluationContext();
-            for (Iterator iter = copy.iterator(); iter.hasNext();) {
-                TimestampWrapper timestampWrapper = (TimestampWrapper)iter.next();
+            for (Iterator<TimestampWrapper> iter = copy.iterator(); iter.hasNext();) {
+                TimestampWrapper timestampWrapper = iter.next();
                 MessageReference message = timestampWrapper.message;
                 sub.addRecoveredMessage(context, message);
             }
@@ -101,7 +100,7 @@
     public void gc() {
         lastGCRun = System.currentTimeMillis();
         while (buffer.size() > 0) {
-            TimestampWrapper timestampWrapper = (TimestampWrapper)buffer.get(0);
+            TimestampWrapper timestampWrapper = buffer.get(0);
             if (lastGCRun > timestampWrapper.timestamp + recoverDuration) {
                 // GC it.
                 buffer.remove(0);
@@ -120,18 +119,18 @@
     }
 
     public Message[] browse(ActiveMQDestination destination) throws Exception {
-        List result = new ArrayList();
-        ArrayList copy = new ArrayList(buffer);
+        List<Message> result = new ArrayList<Message>();
+        ArrayList<TimestampWrapper> copy = new ArrayList<TimestampWrapper>(buffer);
         DestinationFilter filter = DestinationFilter.parseFilter(destination);
-        for (Iterator iter = copy.iterator(); iter.hasNext();) {
-            TimestampWrapper timestampWrapper = (TimestampWrapper)iter.next();
+        for (Iterator<TimestampWrapper> iter = copy.iterator(); iter.hasNext();) {
+            TimestampWrapper timestampWrapper = iter.next();
             MessageReference ref = timestampWrapper.message;
             Message message = ref.getMessage();
             if (filter.matches(message.getDestination())) {
                 result.add(message);
             }
         }
-        return (Message[])result.toArray(new Message[result.size()]);
+        return result.toArray(new Message[result.size()]);
     }
 
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/view/ConnectionDotFileInterceptor.java Fri Aug 10 17:49:19 2007
@@ -58,7 +58,7 @@
 
     // until we have some MBeans for producers, lets do it all ourselves
     private Map<ProducerId, ProducerInfo> producers = new HashMap<ProducerId, ProducerInfo>();
-    private Map<ProducerId, Set> producerDestinations = new HashMap<ProducerId, Set>();
+    private Map<ProducerId, Set<ActiveMQDestination>> producerDestinations = new HashMap<ProducerId, Set<ActiveMQDestination>>();
     private Object lock = new Object();
 
     public ConnectionDotFileInterceptor(Broker next, String file, boolean redrawOnRemove) throws MalformedObjectNameException {
@@ -267,7 +267,8 @@
      */
     protected String asID(String name) {
         StringBuffer buffer = new StringBuffer();
-        for (int i = 0, size = name.length(); i < size; i++) {
+        int size = name.length();
+        for (int i = 0; i < size; i++) {
             char ch = name.charAt(i);
             if (Character.isLetterOrDigit(ch) || ch == '_') {
                 buffer.append(ch);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQDestination.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQDestination.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQDestination.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQDestination.java Fri Aug 10 17:49:19 2007
@@ -324,9 +324,10 @@
         out.writeObject(options);
     }
 
+    @SuppressWarnings("unchecked")
     public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
         this.setPhysicalName(in.readUTF());
-        this.options = (Map)in.readObject();
+        this.options = (Map<String, String>)in.readObject();
     }
 
     public String getDestinationTypeAsString() {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ControlCommand.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ControlCommand.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ControlCommand.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ControlCommand.java Fri Aug 10 17:49:19 2007
@@ -29,11 +29,11 @@
 
     public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONTROL_COMMAND;
 
+    private String command;
+
     public byte getDataStructureType() {
         return DATA_STRUCTURE_TYPE;
     }
-
-    private String command;
 
     /**
      * @openwire:property version=1

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/DiscoveryEvent.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/DiscoveryEvent.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/DiscoveryEvent.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/DiscoveryEvent.java Fri Aug 10 17:49:19 2007
@@ -26,10 +26,6 @@
 
     public static final byte DATA_STRUCTURE_TYPE = CommandTypes.DISCOVERY_EVENT;
 
-    public byte getDataStructureType() {
-        return DATA_STRUCTURE_TYPE;
-    }
-
     protected String serviceName;
     protected String brokerName;
 
@@ -38,6 +34,10 @@
 
     public DiscoveryEvent(String serviceName) {
         this.serviceName = serviceName;
+    }
+
+    public byte getDataStructureType() {
+        return DATA_STRUCTURE_TYPE;
     }
 
     /**

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/JournalTransaction.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/JournalTransaction.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/JournalTransaction.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/JournalTransaction.java Fri Aug 10 17:49:19 2007
@@ -35,10 +35,6 @@
     public boolean wasPrepared;
     public TransactionId transactionId;
 
-    public byte getDataStructureType() {
-        return DATA_STRUCTURE_TYPE;
-    }
-
     public JournalTransaction(byte type, TransactionId transactionId, boolean wasPrepared) {
         this.type = type;
         this.transactionId = transactionId;
@@ -46,6 +42,10 @@
     }
 
     public JournalTransaction() {
+    }
+
+    public byte getDataStructureType() {
+        return DATA_STRUCTURE_TYPE;
     }
 
     /**

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/RemoveInfo.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/RemoveInfo.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/RemoveInfo.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/RemoveInfo.java Fri Aug 10 17:49:19 2007
@@ -32,15 +32,15 @@
 
     protected DataStructure objectId;
 
-    public byte getDataStructureType() {
-        return DATA_STRUCTURE_TYPE;
-    }
-
     public RemoveInfo() {
     }
 
     public RemoveInfo(DataStructure objectId) {
         this.objectId = objectId;
+    }
+
+    public byte getDataStructureType() {
+        return DATA_STRUCTURE_TYPE;
     }
 
     /**

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/ConstantExpression.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/ConstantExpression.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/ConstantExpression.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/ConstantExpression.java Fri Aug 10 17:49:19 2007
@@ -44,6 +44,10 @@
 
     private Object value;
 
+    public ConstantExpression(Object value) {
+        this.value = value;
+    }
+
     public static ConstantExpression createFromDecimal(String text) {
 
         // Strip off the 'l' or 'L' if needed.
@@ -87,10 +91,6 @@
     public static ConstantExpression createFloat(String text) {
         Number value = new Double(text);
         return new ConstantExpression(value);
-    }
-
-    public ConstantExpression(Object value) {
-        this.value = value;
     }
 
     public Object evaluate(MessageEvaluationContext message) throws JMSException {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapNode.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapNode.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapNode.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/DestinationMapNode.java Fri Aug 10 17:49:19 2007
@@ -164,7 +164,8 @@
 
     public void removeAll(Set answer, String[] paths, int startIndex) {
         DestinationNode node = this;
-        for (int i = startIndex, size = paths.length; i < size && node != null; i++) {
+        int size = paths.length;
+        for (int i = startIndex; i < size && node != null; i++) {
 
             String path = paths[i];
             if (path.equals(ANY_DESCENDENT)) {
@@ -230,7 +231,8 @@
     public void appendMatchingValues(Set answer, String[] paths, int startIndex) {
         DestinationNode node = this;
         boolean couldMatchAny = true;
-        for (int i = startIndex, size = paths.length; i < size && node != null; i++) {
+        int size = paths.length;
+        for (int i = startIndex; i < size && node != null; i++) {
             String path = paths[i];
             if (path.equals(ANY_DESCENDENT)) {
                 answer.addAll(node.getDesendentValues());

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/DestinationPath.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/DestinationPath.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/DestinationPath.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/DestinationPath.java Fri Aug 10 17:49:19 2007
@@ -30,9 +30,12 @@
  * 
  * @version $Revision: 1.3 $
  */
-public class DestinationPath {
+public final class DestinationPath {
     protected static final char SEPARATOR = '.';
 
+    private DestinationPath() {    
+    }
+    
     public static String[] getDestinationPaths(String subject) {
         List<String> list = new ArrayList<String>();
         int previous = 0;

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/PrefixDestinationFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/PrefixDestinationFilter.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/PrefixDestinationFilter.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/PrefixDestinationFilter.java Fri Aug 10 17:49:19 2007
@@ -42,7 +42,8 @@
         String[] path = DestinationPath.getDestinationPaths(destination.getPhysicalName());
         int length = prefixes.length;
         if (path.length >= length) {
-            for (int i = 0, size = length - 1; i < size; i++) {
+            int size = length - 1;
+            for (int i = 0; i < size; i++) {
                 if (!prefixes[i].equals(path[i])) {
                     return false;
                 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/WildcardDestinationFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/WildcardDestinationFilter.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/WildcardDestinationFilter.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/filter/WildcardDestinationFilter.java Fri Aug 10 17:49:19 2007
@@ -48,7 +48,7 @@
         String[] path = DestinationPath.getDestinationPaths(destination);
         int length = prefixes.length;
         if (path.length == length) {
-            for (int i = 0, size = length; i < size; i++) {
+            for (int i = 0; i < length; i++) {
                 String prefix = prefixes[i];
                 if (prefix != null && !prefix.equals(path[i])) {
                     return false;

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java Fri Aug 10 17:49:19 2007
@@ -55,7 +55,7 @@
 
     public Context getInitialContext(Hashtable environment) throws NamingException {
         // lets create a factory
-        Map data = new ConcurrentHashMap();
+        Map<String, Object> data = new ConcurrentHashMap<String, Object>();
         String[] names = getConnectionFactoryNames(environment);
         for (int i = 0; i < names.length; i++) {
             ActiveMQConnectionFactory factory = null;
@@ -120,7 +120,7 @@
     // Implementation methods
     // -------------------------------------------------------------------------
 
-    protected ReadOnlyContext createContext(Hashtable environment, Map data) {
+    protected ReadOnlyContext createContext(Hashtable environment, Map<String, Object> data) {
         return new ReadOnlyContext(environment, data);
     }
 
@@ -143,7 +143,7 @@
     protected String[] getConnectionFactoryNames(Map environment) {
         String factoryNames = (String)environment.get("connectionFactoryNames");
         if (factoryNames != null) {
-            List list = new ArrayList();
+            List<String> list = new ArrayList<String>();
             for (StringTokenizer enumeration = new StringTokenizer(factoryNames, ","); enumeration.hasMoreTokens();) {
                 list.add(enumeration.nextToken().trim());
             }
@@ -157,7 +157,7 @@
         return DEFAULT_CONNECTION_FACTORY_NAMES;
     }
 
-    protected void createQueues(Map data, Hashtable environment) {
+    protected void createQueues(Map<String, Object> data, Hashtable environment) {
         for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) {
             Map.Entry entry = (Map.Entry)iter.next();
             String key = entry.getKey().toString();
@@ -168,7 +168,7 @@
         }
     }
 
-    protected void createTopics(Map data, Hashtable environment) {
+    protected void createTopics(Map<String, Object> data, Hashtable environment) {
         for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) {
             Map.Entry entry = (Map.Entry)iter.next();
             String key = entry.getKey().toString();

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ReadOnlyContext.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ReadOnlyContext.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ReadOnlyContext.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ReadOnlyContext.java Fri Aug 10 17:49:19 2007
@@ -59,6 +59,7 @@
  * 
  * @version $Revision: 1.2 $ $Date: 2005/08/27 03:52:39 $
  */
+@SuppressWarnings("unchecked")
 public class ReadOnlyContext implements Context, Serializable {
 
     public static final String SEPARATOR = "/";

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java Fri Aug 10 17:49:19 2007
@@ -25,7 +25,10 @@
  * 
  * @version $Revision: 1.2 $
  */
-public class StoreFactory {
+public final class StoreFactory {
+
+    private StoreFactory() {
+    }
 
     /**
      * open or create a Store

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java Fri Aug 10 17:49:19 2007
@@ -53,8 +53,12 @@
 public class KahaStore implements Store {
 
     private static final String PROPERTY_PREFIX = "org.apache.activemq.kaha.Store";
-    private static final boolean BROKEN_FILE_LOCK = "true".equals(System.getProperty(PROPERTY_PREFIX + ".FileLockBroken", "false"));
-    private static final boolean DISABLE_LOCKING = "true".equals(System.getProperty(PROPERTY_PREFIX + ".DisableLocking", "false"));
+    private static final boolean BROKEN_FILE_LOCK = "true".equals(System.getProperty(PROPERTY_PREFIX
+                                                                                     + ".FileLockBroken",
+                                                                                     "false"));
+    private static final boolean DISABLE_LOCKING = "true".equals(System.getProperty(PROPERTY_PREFIX
+                                                                                    + ".DisableLocking",
+                                                                                    "false"));
 
     private static final Log LOG = LogFactory.getLog(KahaStore.class);
 
@@ -73,7 +77,7 @@
     private boolean useAsyncDataManager;
     private long maxDataFileLength = 1024 * 1024 * 32;
     private FileLock lock;
-    private boolean persistentIndex=true;
+    private boolean persistentIndex = true;
     private RandomAccessFile lockFile;
 
     public KahaStore(String name, String mode) throws IOException {
@@ -196,7 +200,8 @@
         return getMapContainer(id, containerName, persistentIndex);
     }
 
-    public synchronized MapContainer getMapContainer(Object id, String containerName, boolean persistentIndex) throws IOException {
+    public synchronized MapContainer getMapContainer(Object id, String containerName, boolean persistentIndex)
+        throws IOException {
         initialize();
         ContainerId containerId = new ContainerId();
         containerId.setKey(id);
@@ -264,7 +269,8 @@
         return getListContainer(id, containerName, persistentIndex);
     }
 
-    public synchronized ListContainer getListContainer(Object id, String containerName, boolean persistentIndex) throws IOException {
+    public synchronized ListContainer getListContainer(Object id, String containerName,
+                                                       boolean persistentIndex) throws IOException {
         initialize();
         ContainerId containerId = new ContainerId();
         containerId.setKey(id);
@@ -461,13 +467,15 @@
                 if (!BROKEN_FILE_LOCK) {
                     lock = lockFile.getChannel().tryLock();
                     if (lock == null) {
-                        throw new StoreLockedExcpetion("Kaha Store " + directory.getName() + "  is already opened by another application");
+                        throw new StoreLockedExcpetion("Kaha Store " + directory.getName()
+                                                       + "  is already opened by another application");
                     } else {
                         System.setProperty(key, new Date().toString());
                     }
                 }
             } else { // already locked
-                throw new StoreLockedExcpetion("Kaha Store " + directory.getName() + " is already opened by this application.");
+                throw new StoreLockedExcpetion("Kaha Store " + directory.getName()
+                                               + " is already opened by this application.");
             }
         }
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java Fri Aug 10 17:49:19 2007
@@ -159,7 +159,7 @@
     protected final void doClear() {
         checkClosed();
         loaded = true;
-        List indexList = new ArrayList();
+        List<IndexItem> indexList = new ArrayList<IndexItem>();
         try {
             init();
             long nextItem = root.getNextItem();
@@ -172,7 +172,7 @@
             root.setNextItem(Item.POSITION_NOT_SET);
             storeIndex(root);
             for (int i = 0; i < indexList.size(); i++) {
-                IndexItem item = (IndexItem)indexList.get(i);
+                IndexItem item = indexList.get(i);
                 dataManager.removeInterestInFile(item.getKeyFile());
                 dataManager.removeInterestInFile(item.getValueFile());
                 indexManager.freeIndex(item);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerEntrySet.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerEntrySet.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerEntrySet.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerEntrySet.java Fri Aug 10 17:49:19 2007
@@ -71,7 +71,7 @@
     }
 
     public boolean retainAll(Collection c) {
-        List tmpList = new ArrayList();
+        List<Object> tmpList = new ArrayList<Object>();
         for (Iterator i = c.iterator(); i.hasNext();) {
             Object o = i.next();
             if (!contains(o)) {
@@ -79,7 +79,7 @@
             }
         }
         boolean result = false;
-        for (Iterator i = tmpList.iterator(); i.hasNext();) {
+        for (Iterator<Object> i = tmpList.iterator(); i.hasNext();) {
             result |= remove(i.next());
         }
         return result;
@@ -99,8 +99,8 @@
         container.clear();
     }
 
-    protected Set buildEntrySet() {
-        Set set = new HashSet();
+    protected Set<ContainerMapEntry> buildEntrySet() {
+        Set<ContainerMapEntry> set = new HashSet<ContainerMapEntry>();
         for (Iterator i = container.keySet().iterator(); i.hasNext();) {
             ContainerMapEntry entry = new ContainerMapEntry(container, i.next());
             set.add(entry);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerKeySet.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerKeySet.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerKeySet.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerKeySet.java Fri Aug 10 17:49:19 2007
@@ -44,7 +44,7 @@
     }
 
     public Object[] toArray() {
-        List list = new ArrayList();
+        List<Object> list = new ArrayList<Object>();
         IndexItem item = container.getInternalList().getRoot();
         while ((item = container.getInternalList().getNextEntry(item)) != null) {
             list.add(container.getKey(item));
@@ -53,7 +53,7 @@
     }
 
     public Object[] toArray(Object[] a) {
-        List list = new ArrayList();
+        List<Object> list = new ArrayList<Object>();
         IndexItem item = container.getInternalList().getRoot();
         while ((item = container.getInternalList().getNextEntry(item)) != null) {
             list.add(container.getKey(item));
@@ -83,14 +83,14 @@
     }
 
     public boolean retainAll(Collection c) {
-        List tmpList = new ArrayList();
+        List<Object> tmpList = new ArrayList<Object>();
         for (Iterator i = c.iterator(); i.hasNext();) {
             Object o = i.next();
             if (!contains(o)) {
                 tmpList.add(o);
             }
         }
-        for (Iterator i = tmpList.iterator(); i.hasNext();) {
+        for (Iterator<Object> i = tmpList.iterator(); i.hasNext();) {
             remove(i.next());
         }
         return !tmpList.isEmpty();

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollection.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollection.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollection.java Fri Aug 10 17:49:19 2007
@@ -112,14 +112,14 @@
     }
 
     public boolean retainAll(Collection c) {
-        List tmpList = new ArrayList();
+        List<Object> tmpList = new ArrayList<Object>();
         for (Iterator i = c.iterator(); i.hasNext();) {
             Object o = i.next();
             if (!contains(o)) {
                 tmpList.add(o);
             }
         }
-        for (Iterator i = tmpList.iterator(); i.hasNext();) {
+        for (Iterator<Object> i = tmpList.iterator(); i.hasNext();) {
             remove(i.next());
         }
         return !tmpList.isEmpty();

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java Fri Aug 10 17:49:19 2007
@@ -246,7 +246,7 @@
      */
     public synchronized Object[] toArray() {
         load();
-        List tmp = new ArrayList(indexList.size());
+        List<Object> tmp = new ArrayList<Object>(indexList.size());
         IndexItem next = indexList.getFirst();
         while (next != null) {
             Object value = getValue(next);
@@ -263,7 +263,7 @@
      */
     public synchronized Object[] toArray(Object[] a) {
         load();
-        List tmp = new ArrayList(indexList.size());
+        List<Object> tmp = new ArrayList<Object>(indexList.size());
         IndexItem next = indexList.getFirst();
         while (next != null) {
             Object value = getValue(next);
@@ -384,7 +384,7 @@
      */
     public synchronized boolean retainAll(Collection c) {
         load();
-        List tmpList = new ArrayList();
+        List<Object> tmpList = new ArrayList<Object>();
         IndexItem next = indexList.getFirst();
         while (next != null) {
             Object o = getValue(next);
@@ -393,7 +393,7 @@
             }
             next = indexList.getNextEntry(next);
         }
-        for (Iterator i = tmpList.iterator(); i.hasNext();) {
+        for (Iterator<Object> i = tmpList.iterator(); i.hasNext();) {
             remove(i.next());
         }
         return !tmpList.isEmpty();
@@ -619,9 +619,9 @@
      * 
      * @see java.util.List#subList(int, int)
      */
-    public synchronized List subList(int fromIndex, int toIndex) {
+    public synchronized List<Object> subList(int fromIndex, int toIndex) {
         load();
-        List result = new ArrayList();
+        List<Object> result = new ArrayList<Object>();
         int count = fromIndex;
         IndexItem next = indexList.get(fromIndex);
         while (next != null && count++ < toIndex) {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java Fri Aug 10 17:49:19 2007
@@ -251,15 +251,15 @@
         return result;
     }
 
-    private int getInsertPageNo(int index) {
-        int result = index / maximumEntries;
-        return result;
-    }
-
-    private int getOffset(int index) {
-        int result = index % maximumEntries;
-        return result;
-    }
+//    private int getInsertPageNo(int index) {
+//        int result = index / maximumEntries;
+//        return result;
+//    }
+//
+//    private int getOffset(int index) {
+//        int result = index % maximumEntries;
+//        return result;
+//    }
 
     private void doOverFlow(int index) throws IOException {
         int pageNo = index / maximumEntries;

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java Fri Aug 10 17:49:19 2007
@@ -34,8 +34,9 @@
  * @version $Revision: 1.1.1.1 $
  */
 class TreePage {
-    private static final transient Log LOG = LogFactory.getLog(TreePage.class);
+
     static final int PAGE_HEADER_SIZE = 18;
+    private static final transient Log LOG = LogFactory.getLog(TreePage.class);
 
     static enum Flavour {
         LESS, MORE
@@ -193,7 +194,8 @@
 
     void setParentId(long newId) throws IOException {
         if (newId == this.id) {
-            throw new IllegalStateException("Cannot set page as a child of itself " + this + " trying to set parentId = " + newId);
+            throw new IllegalStateException("Cannot set page as a child of itself " + this
+                                            + " trying to set parentId = " + newId);
         }
         this.parentId = newId;
         tree.writePage(this);
@@ -362,7 +364,7 @@
                 newRoot.setLeaf(false);
                 this.setParentId(newRoot.getId());
                 save(); // we are no longer root - need to save - we maybe
-                        // looked up v. soon!
+                // looked up v. soon!
                 TreePage rightPage = tree.createPage(newRoot.getId());
                 rightPage.setEntries(subList);
                 rightPage.checkLeaf();
@@ -464,8 +466,8 @@
                         page.setLeaf(true);
                     }
                     insertTreeEntry(index, copy);
-                    TreePage landed = null;// if we overflow - the page the
-                                            // replacement ends up on
+                    // if we overflow - the page the replacement ends up on
+                    TreePage landed = null;
                     TreeEntry removed = null;
                     if (isOverflowed()) {
                         TreePage parent = getParent();
@@ -563,7 +565,8 @@
         setLeaf(!result);
     }
 
-    private void checkParentIdForRemovedPageEntry(TreeEntry entry, long oldPageId, long newPageId) throws IOException {
+    private void checkParentIdForRemovedPageEntry(TreeEntry entry, long oldPageId, long newPageId)
+        throws IOException {
         TreePage page = tree.lookupPage(entry.getPrevPageId());
         if (page != null && page.getParentId() == oldPageId) {
             page.setParentId(newPageId);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSConnectionStatsImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSConnectionStatsImpl.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSConnectionStatsImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSConnectionStatsImpl.java Fri Aug 10 17:49:19 2007
@@ -50,7 +50,8 @@
     public void reset() {
         super.reset();
         JMSSessionStatsImpl[] stats = getSessions();
-        for (int i = 0, size = stats.length; i < size; i++) {
+        int size = stats.length;
+        for (int i = 0; i < size; i++) {
             stats[i].reset();
         }
     }
@@ -61,7 +62,8 @@
     public void setEnabled(boolean enabled) {
         super.setEnabled(enabled);
         JMSSessionStatsImpl[] stats = getSessions();
-        for (int i = 0, size = stats.length; i < size; i++) {
+        int size = stats.length;
+        for (int i = 0; i < size; i++) {
             stats[i].setEnabled(enabled);
         }
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSSessionStatsImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSSessionStatsImpl.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSSessionStatsImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSSessionStatsImpl.java Fri Aug 10 17:49:19 2007
@@ -44,10 +44,14 @@
         this.messageCount = new CountStatisticImpl("messageCount", "Number of messages exchanged");
         this.pendingMessageCount = new CountStatisticImpl("pendingMessageCount", "Number of pending messages");
         this.expiredMessageCount = new CountStatisticImpl("expiredMessageCount", "Number of expired messages");
-        this.messageWaitTime = new TimeStatisticImpl("messageWaitTime", "Time spent by a message before being delivered");
-        this.durableSubscriptionCount = new CountStatisticImpl("durableSubscriptionCount", "The number of durable subscriptions");
-        this.messageWaitTime = new TimeStatisticImpl("messageWaitTime", "Time spent by a message before being delivered");
-        this.messageRateTime = new TimeStatisticImpl("messageRateTime", "Time taken to process a message (thoughtput rate)");
+        this.messageWaitTime = new TimeStatisticImpl("messageWaitTime",
+                                                     "Time spent by a message before being delivered");
+        this.durableSubscriptionCount = new CountStatisticImpl("durableSubscriptionCount",
+                                                               "The number of durable subscriptions");
+        this.messageWaitTime = new TimeStatisticImpl("messageWaitTime",
+                                                     "Time spent by a message before being delivered");
+        this.messageRateTime = new TimeStatisticImpl("messageRateTime",
+                                                     "Time taken to process a message (thoughtput rate)");
 
         // lets add named stats
         addStatistic("messageCount", messageCount);
@@ -85,11 +89,13 @@
     public void reset() {
         super.reset();
         JMSConsumerStatsImpl[] cstats = getConsumers();
-        for (int i = 0, size = cstats.length; i < size; i++) {
+        int size = cstats.length;
+        for (int i = 0; i < size; i++) {
             cstats[i].reset();
         }
         JMSProducerStatsImpl[] pstats = getProducers();
-        for (int i = 0, size = pstats.length; i < size; i++) {
+        size = pstats.length;
+        for (int i = 0; i < size; i++) {
             pstats[i].reset();
         }
     }
@@ -100,11 +106,13 @@
     public void setEnabled(boolean enabled) {
         super.setEnabled(enabled);
         JMSConsumerStatsImpl[] cstats = getConsumers();
-        for (int i = 0, size = cstats.length; i < size; i++) {
+        int size = cstats.length;
+        for (int i = 0; i < size; i++) {
             cstats[i].setEnabled(enabled);
         }
         JMSProducerStatsImpl[] pstats = getProducers();
-        for (int i = 0, size = pstats.length; i < size; i++) {
+        size = pstats.length;
+        for (int i = 0; i < size; i++) {
             pstats[i].setEnabled(enabled);
         }
 



Mime
View raw message