qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r812936 [4/6] - in /qpid/branches/java-network-refactor: ./ qpid/buildtools/buildCreator/ qpid/cpp/ qpid/cpp/bindings/qmf/ qpid/cpp/bindings/qmf/python/ qpid/cpp/bindings/qmf/python/qmf/ qpid/cpp/bindings/qmf/ruby/ qpid/cpp/bindings/qmf/tes...
Date Wed, 09 Sep 2009 13:05:52 GMT
Modified: qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/BasicACLPlugin.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/BasicACLPlugin.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/BasicACLPlugin.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/BasicACLPlugin.java Wed Sep  9 13:05:43 2009
@@ -120,10 +120,4 @@
         // no-op
     }
 
-    public boolean supportsTag(String name)
-    {
-        // This plugin doesn't support any tags
-        return false;
-    }
-
 }

Modified: qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java Wed Sep  9 13:05:43 2009
@@ -599,7 +599,6 @@
             if(_state.compareAndSet(State.SUSPENDED, State.ACTIVE))
             {
                 _stateListener.stateChange(this, State.SUSPENDED, State.ACTIVE);
-                CurrentActor.get().message(_logSubject,SubscriptionMessages.SUB_1003(_state.get().toString()));
             }
             else
             {
@@ -612,9 +611,9 @@
             if(_state.compareAndSet(State.ACTIVE, State.SUSPENDED))
             {
                 _stateListener.stateChange(this, State.ACTIVE, State.SUSPENDED);
-                CurrentActor.get().message(_logSubject,SubscriptionMessages.SUB_1003(_state.get().toString()));
             }
         }
+        CurrentActor.get().message(_logSubject,SubscriptionMessages.SUB_1003(_state.get().toString()));
     }
 
     public State getState()

Modified: qpid/branches/java-network-refactor/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ExchangeDenier.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ExchangeDenier.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ExchangeDenier.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ExchangeDenier.java Wed Sep  9 13:05:43 2009
@@ -46,17 +46,4 @@
     {
         return AuthzResult.DENIED;
     }
-
-    @Override
-    public String getPluginName()
-    {
-        return getClass().getSimpleName();
-    }
-
-    @Override
-    public boolean supportsTag(String name)
-    {
-        return name.equals("exchangeDenier");
-    }
-
 }

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java Wed Sep  9 13:05:43 2009
@@ -39,9 +39,4 @@
     {
         super(error, msg, cause);
     }
-    public boolean isHardError()
-    {
-        return true;
-    }
-
 }

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java Wed Sep  9 13:05:43 2009
@@ -65,6 +65,7 @@
 import org.apache.qpid.AMQException;
 import org.apache.qpid.AMQInvalidArgumentException;
 import org.apache.qpid.AMQInvalidRoutingKeyException;
+import org.apache.qpid.AMQChannelClosedException;
 import org.apache.qpid.client.failover.FailoverException;
 import org.apache.qpid.client.failover.FailoverNoopSupport;
 import org.apache.qpid.client.failover.FailoverProtectedOperation;
@@ -205,9 +206,9 @@
      */
     protected static final boolean DEFAULT_MANDATORY = Boolean.parseBoolean(System.getProperty("qpid.default_mandatory", "true"));
 
-    protected static final boolean DECLARE_QUEUES =
+    protected final boolean DECLARE_QUEUES =
         Boolean.parseBoolean(System.getProperty("qpid.declare_queues", "true"));
-    protected static final boolean DECLARE_EXCHANGES =
+    protected final boolean DECLARE_EXCHANGES =
         Boolean.parseBoolean(System.getProperty("qpid.declare_exchanges", "true"));
 
     /** System property to enable strict AMQP compliance. */
@@ -629,6 +630,11 @@
      */
     public void close(long timeout) throws JMSException
     {
+        close(timeout, true);
+    }
+
+    private void close(long timeout, boolean sendClose) throws JMSException
+    {
         if (_logger.isInfoEnabled())
         {
             StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
@@ -654,9 +660,12 @@
                         // If the connection is open or we are in the process
                         // of closing the connection then send a cance
                         // no point otherwise as the connection will be gone
-                        if (!_connection.isClosed() || _connection.isClosing())                        
+                        if (!_connection.isClosed() || _connection.isClosing())
                         {
-                            sendClose(timeout);
+                            if (sendClose)
+                            {
+                                sendClose(timeout);
+                            }
                         }
                     }
                     catch (AMQException e)
@@ -712,25 +721,22 @@
 
         if (!_closed.getAndSet(true))
         {
-            synchronized (getFailoverMutex())
+            synchronized (_messageDeliveryLock)
             {
-                synchronized (_messageDeliveryLock)
+                // An AMQException has an error code and message already and will be passed in when closure occurs as a
+                // result of a channel close request
+                AMQException amqe;
+                if (e instanceof AMQException)
                 {
-                    // An AMQException has an error code and message already and will be passed in when closure occurs as a
-                    // result of a channel close request
-                    AMQException amqe;
-                    if (e instanceof AMQException)
-                    {
-                        amqe = (AMQException) e;
-                    }
-                    else
-                    {
-                        amqe = new AMQException("Closing session forcibly", e);
-                    }
-
-                    _connection.deregisterSession(_channelId);
-                    closeProducersAndConsumers(amqe);
+                    amqe = (AMQException) e;
+                }
+                else
+                {
+                    amqe = new AMQException("Closing session forcibly", e);
                 }
+
+                _connection.deregisterSession(_channelId);
+                closeProducersAndConsumers(amqe);
             }
         }
     }
@@ -1737,6 +1743,11 @@
                         }
                         catch (AMQException e)
                         {
+                            if (e instanceof AMQChannelClosedException)
+                            {
+                                close(-1, false);
+                            }
+
                             JMSException ex = new JMSException("Error registering consumer: " + e);
 
                             ex.setLinkedException(e);

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java Wed Sep  9 13:05:43 2009
@@ -33,6 +33,7 @@
 import org.apache.qpid.client.message.AMQMessageDelegateFactory;
 import org.apache.qpid.client.protocol.AMQProtocolHandler;
 import org.apache.qpid.client.state.listener.SpecificMethodFrameListener;
+import org.apache.qpid.client.state.AMQState;
 import org.apache.qpid.common.AMQPFilterTypes;
 import org.apache.qpid.framing.*;
 import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9;
@@ -116,12 +117,23 @@
 
     public void sendClose(long timeout) throws AMQException, FailoverException
     {
-        getProtocolHandler().closeSession(this);
-        getProtocolHandler().syncWrite(getProtocolHandler().getMethodRegistry().createChannelCloseBody(AMQConstant.REPLY_SUCCESS.getCode(),
-                new AMQShortString("JMS client closing channel"), 0, 0).generateFrame(_channelId), 
-                                       ChannelCloseOkBody.class, timeout);
-        // When control resumes at this point, a reply will have been received that
-        // indicates the broker has closed the channel successfully.
+        // we also need to check the state manager for 08/09 as the
+        // _connection variable may not be updated in time by the error receiving
+        // thread.
+        // We can't close the session if we are alreadying in the process of
+        // closing/closed the connection.
+                
+        if (!(getProtocolHandler().getStateManager().getCurrentState().equals(AMQState.CONNECTION_CLOSED)
+            || getProtocolHandler().getStateManager().getCurrentState().equals(AMQState.CONNECTION_CLOSING)))
+        {
+
+            getProtocolHandler().closeSession(this);
+            getProtocolHandler().syncWrite(getProtocolHandler().getMethodRegistry().createChannelCloseBody(AMQConstant.REPLY_SUCCESS.getCode(),
+                                                                                                           new AMQShortString("JMS client closing channel"), 0, 0).generateFrame(_channelId),
+                                           ChannelCloseOkBody.class, timeout);
+            // When control resumes at this point, a reply will have been received that
+            // indicates the broker has closed the channel successfully.
+        }
     }
 
     public void sendCommit() throws AMQException, FailoverException

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java Wed Sep  9 13:05:43 2009
@@ -32,7 +32,6 @@
 import org.apache.qpid.framing.ChannelCloseBody;
 import org.apache.qpid.framing.ChannelCloseOkBody;
 import org.apache.qpid.protocol.AMQConstant;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -48,7 +47,7 @@
     }
 
     public void methodReceived(AMQProtocolSession session, ChannelCloseBody method, int channelId)
-        throws AMQException
+            throws AMQException
     {
         _logger.debug("ChannelClose method received");
 
@@ -59,52 +58,62 @@
             _logger.debug("Channel close reply code: " + errorCode + ", reason: " + reason);
         }
 
-
-
         ChannelCloseOkBody body = session.getMethodRegistry().createChannelCloseOkBody();
         AMQFrame frame = body.generateFrame(channelId);
         session.writeFrame(frame);
-
-        if (errorCode != AMQConstant.REPLY_SUCCESS)
+        try
         {
-            if (_logger.isDebugEnabled())
-            {
-                _logger.debug("Channel close received with errorCode " + errorCode + ", and reason " + reason);
-            }
-
-            if (errorCode == AMQConstant.NO_CONSUMERS)
-            {
-                throw new AMQNoConsumersException("Error: " + reason, null, null);
-            }
-            else if (errorCode == AMQConstant.NO_ROUTE)
+            if (errorCode != AMQConstant.REPLY_SUCCESS)
             {
-                throw new AMQNoRouteException("Error: " + reason, null, null);
-            }
-            else if (errorCode == AMQConstant.INVALID_ARGUMENT)
-            {
-                _logger.debug("Broker responded with Invalid Argument.");
+                if (_logger.isDebugEnabled())
+                {
+                    _logger.debug("Channel close received with errorCode " + errorCode + ", and reason " + reason);
+                }
+
+                if (errorCode == AMQConstant.NO_CONSUMERS)
+                {
+                    throw new AMQNoConsumersException("Error: " + reason, null, null);
+                }
+                else if (errorCode == AMQConstant.NO_ROUTE)
+                {
+                    throw new AMQNoRouteException("Error: " + reason, null, null);
+                }
+                else if (errorCode == AMQConstant.INVALID_ARGUMENT)
+                {
+                    _logger.debug("Broker responded with Invalid Argument.");
+
+                    throw new org.apache.qpid.AMQInvalidArgumentException(String.valueOf(reason), null);
+                }
+                else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
+                {
+                    _logger.debug("Broker responded with Invalid Routing Key.");
+
+                    throw new AMQInvalidRoutingKeyException(String.valueOf(reason), null);
+                }
+                else
+                {
 
-                throw new org.apache.qpid.AMQInvalidArgumentException(String.valueOf(reason), null);
-            }
-            else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
-            {
-                _logger.debug("Broker responded with Invalid Routing Key.");
+                    throw new AMQChannelClosedException(errorCode, "Error: " + reason, null);
+                }
 
-                throw new AMQInvalidRoutingKeyException(String.valueOf(reason), null);
             }
-            else
-            {
-                throw new AMQChannelClosedException(errorCode, "Error: " + reason, null);
-            }
-
         }
-        // fixme why is this only done when the close is expected...
-        // should the above forced closes not also cause a close?
-        // ----------
-        // Closing the session only when it is expected allows the errors to be processed
-        // Calling this here will prevent failover. So we should do this for all exceptions
-        // that should never cause failover. Such as authentication errors.
+        finally
+        {
+            // fixme why is this only done when the close is expected...
+            // should the above forced closes not also cause a close?
+            // ----------
+            // Closing the session only when it is expected allows the errors to be processed
+            // Calling this here will prevent failover. So we should do this for all exceptions
+            // that should never cause failover. Such as authentication errors.
+            // ----
+            // 2009-09-07 - ritchiem
+            // calling channelClosed will only close this session and will not
+            // prevent failover. If we don't close the session here then we will
+            // have problems during the session close as it will attempt to
+            // close the session that the broker has closed, 
 
-        session.channelClosed(channelId, errorCode, String.valueOf(reason));
+            session.channelClosed(channelId, errorCode, String.valueOf(reason));
+        }
     }
 }

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java Wed Sep  9 13:05:43 2009
@@ -40,7 +40,6 @@
     }
 
     public void methodReceived(AMQProtocolSession session, ConnectionOpenOkBody body, int channelId)
-                throws AMQException            
     {
         session.getStateManager().changeState(AMQState.CONNECTION_OPEN);
     }

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java Wed Sep  9 13:05:43 2009
@@ -45,7 +45,6 @@
     { }
 
     public void methodReceived(AMQProtocolSession session, ConnectionTuneBody frame, int channelId)
-                throws AMQException
     {
         _logger.debug("ConnectionTune frame received");
         final MethodRegistry methodRegistry = session.getMethodRegistry();

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQIoTransportProtocolSession.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQIoTransportProtocolSession.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQIoTransportProtocolSession.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQIoTransportProtocolSession.java Wed Sep  9 13:05:43 2009
@@ -52,7 +52,7 @@
     }
     
     @Override
-    public void closeProtocolSession(boolean waitLast) throws AMQException
+    public void closeProtocolSession(boolean waitLast) 
     {
         _ioSender.close();
         _protocolHandler.getStateManager().changeState(AMQState.CONNECTION_CLOSED);

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java Wed Sep  9 13:05:43 2009
@@ -259,7 +259,7 @@
 
     /**
      * Called when we want to create a new IoTransport session
-     * @param brokerDetail 
+     * @param brokerDetail
      */
     public void createIoTransportSession(BrokerDetails brokerDetail)
     {
@@ -271,7 +271,7 @@
                                 brokerDetail.useSSL());
         _protocolSession.init();
     }
-    
+
     /**
      * Called when the network connection is closed. This can happen, either because the client explicitly requested
      * that the connection be closed, in which case nothing is done, or because the connection died. In the case
@@ -433,12 +433,11 @@
      * @param e the exception to propagate
      *
      * @see #propagateExceptionToFrameListeners
-     * @see #propagateExceptionToStateWaiters
      */
     public void propagateExceptionToAllWaiters(Exception e)
     {
+        getStateManager().error(e);
         propagateExceptionToFrameListeners(e);
-        propagateExceptionToStateWaiters(e);
     }
 
     /**
@@ -469,22 +468,6 @@
         }
     }
 
-    /**
-     * This caters for the case where we only need to propogate an exception to the the state manager to interupt any
-     * thing waiting for a state change.
-     *
-     * Currently (2008-07-15) the state manager is only used during 0-8/0-9 Connection establishement.
-     *
-     * Normally the state manager would not need to be notified without notifiying the frame listeners so in normal
-     * cases {@link #propagateExceptionToAllWaiters} would be the correct choice.
-     *
-     * @param e the exception to propagate
-     */
-    public void propagateExceptionToStateWaiters(Exception e)
-    {
-        getStateManager().error(e);
-    }
-
     public void notifyFailoverStarting()
     {
         // Set the last exception in the sync block to ensure the ordering with add.
@@ -601,7 +584,7 @@
         {
             _protocolLogger.debug(String.format("SEND: [%s] %s", this, message));
         }
-        
+
         final long sentMessages = _messagesOut++;
 
         final boolean debug = _logger.isDebugEnabled();
@@ -667,7 +650,8 @@
                     throw _lastFailoverException;
                 }
 
-                if(_stateManager.getCurrentState() == AMQState.CONNECTION_CLOSED)
+                if(_stateManager.getCurrentState() == AMQState.CONNECTION_CLOSED ||
+                        _stateManager.getCurrentState() == AMQState.CONNECTION_CLOSING)
                 {
                     Exception e = _stateManager.getLastException();
                     if (e != null)
@@ -733,25 +717,31 @@
      */
     public void closeConnection(long timeout) throws AMQException
     {
-        getStateManager().changeState(AMQState.CONNECTION_CLOSING);
-
         ConnectionCloseBody body = _protocolSession.getMethodRegistry().createConnectionCloseBody(AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
                                                                                                   new AMQShortString("JMS client is closing the connection."), 0, 0);
 
         final AMQFrame frame = body.generateFrame(0);
 
-        try
-        {
-            syncWrite(frame, ConnectionCloseOkBody.class, timeout);
-            _protocolSession.closeProtocolSession();
-        }
-        catch (AMQTimeoutException e)
+        //If the connection is already closed then don't do a syncWrite
+        if (getStateManager().getCurrentState().equals(AMQState.CONNECTION_CLOSED))
         {
             _protocolSession.closeProtocolSession(false);
         }
-        catch (FailoverException e)
+        else
         {
-            _logger.debug("FailoverException interrupted connection close, ignoring as connection close anyway.");
+            try
+            {
+                syncWrite(frame, ConnectionCloseOkBody.class, timeout);
+                _protocolSession.closeProtocolSession();
+            }
+            catch (AMQTimeoutException e)
+            {
+                _protocolSession.closeProtocolSession(false);
+            }
+            catch (FailoverException e)
+            {
+                _logger.debug("FailoverException interrupted connection close, ignoring as connection   close anyway.");
+            }
         }
     }
 

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java Wed Sep  9 13:05:43 2009
@@ -410,12 +410,12 @@
         return (AMQConnection) _minaProtocolSession.getAttribute(AMQ_CONNECTION);
     }
 
-    public void closeProtocolSession() throws AMQException
+    public void closeProtocolSession()
     {
         closeProtocolSession(true);
     }
 
-    public void closeProtocolSession(boolean waitLast) throws AMQException
+    public void closeProtocolSession(boolean waitLast)
     {
         _logger.debug("Waiting for last write to join.");
         if (waitLast && (_lastWriteFuture != null))

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java Wed Sep  9 13:05:43 2009
@@ -31,6 +31,7 @@
 import java.util.Set;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.io.IOException;
 
 /**
  * The state manager is responsible for managing the state of the protocol session. <p/>
@@ -86,7 +87,7 @@
         return _currentState;
     }
 
-    public void changeState(AMQState newState) throws AMQException
+    public void changeState(AMQState newState)
     {
         _logger.debug("State changing to " + newState + " from old state " + _currentState);
 
@@ -136,6 +137,22 @@
      */
     public void error(Exception error)
     {
+        if (error instanceof AMQException)
+        {
+            // AMQException should be being notified before closing the
+            // ProtocolSession. Which will change the State to CLOSED.
+            // if we have a hard error.
+            if (((AMQException)error).isHardError())
+            {
+                changeState(AMQState.CONNECTION_CLOSING);
+            }
+        }
+        else
+        {
+            // Be on the safe side here and mark the connection closed
+            changeState(AMQState.CONNECTION_CLOSED);
+        }
+
         if (_waiters.size() == 0)
         {
             _logger.error("No Waiters for error saving as last error:" + error.getMessage());

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java Wed Sep  9 13:05:43 2009
@@ -22,10 +22,11 @@
 
 import java.util.Iterator;
 import java.util.Queue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * A blocking queue that emits events above a user specified threshold allowing the caller to take action (e.g. flow
  * control) to try to prevent the queue growing (much) further. The underlying queue itself is not bounded therefore the
@@ -36,6 +37,8 @@
  */
 public class FlowControllingBlockingQueue
 {
+	private static final Logger _logger = LoggerFactory.getLogger(FlowControllingBlockingQueue.class);
+	
     /** This queue is bounded and is used to store messages before being dispatched to the consumer */
     private final Queue _queue = new ConcurrentLinkedQueue();
 
@@ -46,6 +49,8 @@
 
     /** We require a separate count so we can track whether we have reached the threshold */
     private int _count;
+    
+    private boolean disableFlowControl; 
 
     public boolean isEmpty()
     {
@@ -69,6 +74,10 @@
         _flowControlHighThreshold = highThreshold;
         _flowControlLowThreshold = lowThreshold;
         _listener = listener;
+        if (highThreshold == 0)
+        {
+        	disableFlowControl = true;
+        }
     }
 
     public Object take() throws InterruptedException
@@ -84,7 +93,7 @@
                 }
             }
         }
-        if (_listener != null)
+        if (!disableFlowControl && _listener != null)
         {
             synchronized (_listener)
             {
@@ -93,6 +102,7 @@
                     _listener.underThreshold(_count);
                 }
             }
+            
         }
 
         return o;
@@ -106,7 +116,7 @@
 
             notifyAll();
         }
-        if (_listener != null)
+        if (!disableFlowControl && _listener != null)
         {
             synchronized (_listener)
             {

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/test/java/org/apache/qpid/client/MockAMQConnection.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/test/java/org/apache/qpid/client/MockAMQConnection.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/test/java/org/apache/qpid/client/MockAMQConnection.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/test/java/org/apache/qpid/client/MockAMQConnection.java Wed Sep  9 13:05:43 2009
@@ -85,7 +85,7 @@
     }
 
     @Override
-    public ProtocolVersion makeBrokerConnection(BrokerDetails brokerDetail) throws IOException, AMQException
+    public ProtocolVersion makeBrokerConnection(BrokerDetails brokerDetail) throws IOException
     {
         _connected = true;
         _protocolHandler.getStateManager().changeState(AMQState.CONNECTION_OPEN);

Modified: qpid/branches/java-network-refactor/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java Wed Sep  9 13:05:43 2009
@@ -200,15 +200,8 @@
         _handler.getStateManager().error(trigger);
 
         _logger.info("Setting state to be CONNECTION_CLOSED.");
-        try
-        {
-            _handler.getStateManager().changeState(AMQState.CONNECTION_CLOSED);
-        }
-        catch (AMQException e)
-        {
-            _logger.error("Unable to change the state to closed.", e);
-            fail("Unable to change the state to closed due to :"+e.getMessage());
-        }
+
+        _handler.getStateManager().changeState(AMQState.CONNECTION_CLOSED);
 
         _logger.info("Firing exception");
         _handler.propagateExceptionToFrameListeners(trigger);

Modified: qpid/branches/java-network-refactor/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java Wed Sep  9 13:05:43 2009
@@ -30,7 +30,6 @@
 
 import javax.net.ssl.SSLEngine;
 
-import org.apache.log4j.Logger;
 import org.apache.mina.common.ConnectFuture;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.IoAcceptor;
@@ -59,6 +58,9 @@
 import org.apache.qpid.transport.NetworkDriverConfiguration;
 import org.apache.qpid.transport.OpenException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class MINANetworkDriver extends IoHandlerAdapter implements NetworkDriver
 {
 
@@ -80,7 +82,7 @@
 
     private WriteFuture _lastWriteFuture;
 
-    private static final Logger _logger = Logger.getLogger(MINANetworkDriver.class);
+    private static final Logger _logger = LoggerFactory.getLogger(MINANetworkDriver.class);
     
     public MINANetworkDriver(boolean useNIO, int processors, boolean executorPool, boolean protectIO)
     {

Propchange: qpid/branches/java-network-refactor/qpid/java/lib/org.osgi.core_1.0.0.jar
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -0,0 +1,2 @@
+/incubator/qpid/trunk/qpid/java/lib/org.osgi.core_1.0.0.jar:520691-720930
+/qpid/trunk/qpid/java/lib/org.osgi.core_1.0.0.jar:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/client/src/main/java/org/apache/qpid/management/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -0,0 +1,2 @@
+/incubator/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management:520691-703176
+/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/client/src/test/java/org/apache/qpid/management/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -0,0 +1,2 @@
+/incubator/qpid/trunk/qpid/java/management/client/src/test/java/org/apache/qpid/management:520691-703176
+/qpid/trunk/qpid/java/management/client/src/test/java/org/apache/qpid/management:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1,2 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1 +1,2 @@
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1 +1,2 @@
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1,2 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java:757257
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java:753219-753220,753253,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1 +1,2 @@
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/UserManagement.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1,2 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1,2 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1,2 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1,2 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1,2 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -1 +1,2 @@
 /qpid/branches/jmx_mc_gsoc09/qpid/java/management/eclipse-plugin/src:788755
+/qpid/trunk/qpid/java/management/eclipse-plugin/src:805429-812920

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java Wed Sep  9 13:05:43 2009
@@ -59,7 +59,12 @@
         else if (JMXConnectionNotification.FAILED.equals(type))
         {
             ApplicationRegistry.serverConnectionClosed(server);
-            MBeanUtility.printOutput("Recieved notification from " + server.getName() + ": " + type );
+            MBeanUtility.printOutput("JMX Connection to " + server.getName() + " failed.");
+        }
+        else if (JMXConnectionNotification.CLOSED.equals(type))
+        {
+            ApplicationRegistry.serverConnectionClosed(server);
+            MBeanUtility.printOutput("JMX Connection to " + server.getName() + " was closed.");
         }
     }
 

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java Wed Sep  9 13:05:43 2009
@@ -22,6 +22,7 @@
 
 import static org.apache.qpid.management.ui.Constants.ALL;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
@@ -29,7 +30,6 @@
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
-import javax.management.ListenerNotFoundException;
 import javax.management.MBeanInfo;
 import javax.management.MBeanServerConnection;
 import javax.management.Notification;
@@ -116,25 +116,54 @@
      * removes all listeners from the mbean server. This is required when user
      * disconnects the Qpid server connection
      */
-    public void closeServerConnection() throws Exception
+    public void closeServerConnection() throws IOException
     {
         try
         {
+            //remove the listener from the JMXConnector
             if (_jmxc != null && _clientListener != null)
+            {
                 _jmxc.removeConnectionNotificationListener(_clientListener);
+            }
+        }
+        catch (Exception e)
+        {
+            //ignore
+        }
 
+        try
+        {
+            //remove the listener from the MBeanServerDelegate MBean
             if (_mbsc != null && _clientListener != null)
+            {
                 _mbsc.removeNotificationListener(_serverObjectName, _clientListener);
+            }
+        }
+        catch (Exception e)
+        {
+            //ignore
+        }
 
-            // remove mbean notification listeners
+        if (_mbsc != null && _clientListener != null)
+        {
+            //remove any listeners from the Qpid MBeans
             for (String mbeanName : _subscribedNotificationMap.keySet())
             {
-                _mbsc.removeNotificationListener(new ObjectName(mbeanName), _notificationListener);
+                try
+                {
+                    _mbsc.removeNotificationListener(new ObjectName(mbeanName), _notificationListener);
+                }
+                catch (Exception e)
+                {
+                    //ignore
+                }
             }
         }
-        catch (ListenerNotFoundException ex)
+
+        //close the JMXConnector
+        if (_jmxc != null)
         {
-            MBeanUtility.printOutput(ex.toString());
+            _jmxc.close();
         }
     }
     

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java Wed Sep  9 13:05:43 2009
@@ -882,7 +882,7 @@
         {
             attribute = (AttributeData) element;
             if (attribute.isWritable())
-                return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE);
+                return Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);
             else
                 return Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
         }

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java Wed Sep  9 13:05:43 2009
@@ -790,9 +790,11 @@
             return;
         }
 
-        serverRegistry.closeServerConnection();
         // Add server to the closed server list and the worker thread will remove the server from required places.
         ApplicationRegistry.serverConnectionClosed(managedServer);
+        
+        //close the connection
+        serverRegistry.closeServerConnection();
     }
 
     /**

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/connection/ConnectionOperationsTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/connection/ConnectionOperationsTabControl.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/connection/ConnectionOperationsTabControl.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/connection/ConnectionOperationsTabControl.java Wed Sep  9 13:05:43 2009
@@ -28,10 +28,13 @@
 import javax.management.openmbean.CompositeDataSupport;
 import javax.management.openmbean.TabularDataSupport;
 
+import org.apache.qpid.management.ui.ApplicationRegistry;
 import org.apache.qpid.management.ui.ManagedBean;
+import org.apache.qpid.management.ui.ServerRegistry;
 import org.apache.qpid.management.common.mbeans.ManagedConnection;
 import org.apache.qpid.management.ui.jmx.JMXManagedObject;
 import org.apache.qpid.management.ui.jmx.MBeanUtility;
+import org.apache.qpid.management.ui.views.MBeanView;
 import org.apache.qpid.management.ui.views.TabControl;
 import org.apache.qpid.management.ui.views.ViewUtility;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -43,6 +46,8 @@
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerSorter;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.graphics.Image;
@@ -55,6 +60,8 @@
 import org.eclipse.swt.widgets.TabFolder;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.forms.widgets.Form;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 
@@ -199,6 +206,8 @@
         _tableViewer.setContentProvider(new ContentProviderImpl());
         _tableViewer.setLabelProvider(new LabelProviderImpl());
         _tableViewer.setSorter(tableSorter);
+        _table.setSortColumn(_table.getColumn(0));
+        _table.setSortDirection(SWT.UP);
         
         Composite buttonsComposite = _toolkit.createComposite(viewChannelsGroup);
         gridData = new GridData(SWT.RIGHT, SWT.BOTTOM, false, false);
@@ -278,6 +287,19 @@
             }
         });
         
+        //listener for double clicking to open the selection mbean
+        _table.addMouseListener(new MouseListener()                                              
+        {
+            // MouseListener implementation
+            public void mouseDoubleClick(MouseEvent event)
+            {
+                openMBean(_table);
+            }
+            
+            public void mouseDown(MouseEvent e){}
+            public void mouseUp(MouseEvent e){}
+        });
+        
         _tableViewer.addSelectionChangedListener(new ISelectionChangedListener(){
             public void selectionChanged(SelectionChangedEvent evt)
             {
@@ -465,5 +487,43 @@
             return comparison;
         }
     }
+    
+    private void openMBean(Table table)
+    {
+        int selectionIndex = table.getSelectionIndex();
+
+        if (selectionIndex == -1)
+        {
+            return;
+        }
+        
+        CompositeData channelResult = (CompositeData) table.getItem(selectionIndex).getData();
+        String queueName = (String) channelResult.get(DEFAULT_QUEUE);
+        
+        if(queueName == null)
+        {
+            return;
+        }
+        
+        ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
+        ManagedBean selectedMBean = serverRegistry.getQueue(queueName, _mbean.getVirtualHostName());
+
+        if(selectedMBean == null)
+        {
+            ViewUtility.popupErrorMessage("Error", "Unable to retrieve the selected MBean to open it");
+            return;
+        }
+
+        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); 
+        MBeanView view = (MBeanView) window.getActivePage().findView(MBeanView.ID);
+        try
+        {
+            view.openMBean(selectedMBean);
+        }
+        catch (Exception ex)
+        {
+            MBeanUtility.handleException(selectedMBean, ex);
+        }
+    }
 
 }

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/exchange/ExchangeOperationsTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/exchange/ExchangeOperationsTabControl.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/exchange/ExchangeOperationsTabControl.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/exchange/ExchangeOperationsTabControl.java Wed Sep  9 13:05:43 2009
@@ -237,6 +237,8 @@
         _keysTableViewer.setContentProvider(new ContentProviderImpl(BINDING_KEY));
         _keysTableViewer.setLabelProvider(new LabelProviderImpl(BINDING_KEY));
         _keysTableViewer.setSorter(tableSorter);
+        _keysTable.setSortColumn(_keysTable.getColumn(0));
+        _keysTable.setSortDirection(SWT.UP);
         
         
         _queuesTable = new Table (tablesComposite, SWT.SINGLE | SWT.SCROLL_LINE | SWT.BORDER | SWT.FULL_SELECTION);
@@ -287,6 +289,8 @@
         _queuesTableViewer.setContentProvider(new ContentProviderImpl(QUEUES));
         _queuesTableViewer.setLabelProvider(new LabelProviderImpl(QUEUES));
         _queuesTableViewer.setSorter(queuesTableSorter);
+        _queuesTable.setSortColumn(_queuesTable.getColumn(0));
+        _queuesTable.setSortDirection(SWT.UP);
         _queuesTableViewer.setInput(new String[]{"Select a binding key to view queues"});
         
         //listener for double clicking to open the selection mbean

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/exchange/HeadersExchangeOperationsTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/exchange/HeadersExchangeOperationsTabControl.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/exchange/HeadersExchangeOperationsTabControl.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/exchange/HeadersExchangeOperationsTabControl.java Wed Sep  9 13:05:43 2009
@@ -22,6 +22,7 @@
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 
 import javax.management.MBeanServerConnection;
@@ -48,6 +49,7 @@
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerSorter;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -60,6 +62,7 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.TabFolder;
 import org.eclipse.swt.widgets.Table;
@@ -182,7 +185,7 @@
         final TableSorter tableSorter = new TableSorter(BINDING_NUM);
         
         String[] titles = {"Binding Number", "Queue Name"};
-        int[] bounds = {125, 175};
+        int[] bounds = {135, 175};
         for (int i = 0; i < titles.length; i++) 
         {
             final int index = i;
@@ -220,6 +223,8 @@
         _bindingNumberTableViewer.setContentProvider(new ContentProviderImpl(BINDING_NUM));
         _bindingNumberTableViewer.setLabelProvider(new LabelProviderImpl(BINDING_NUM));
         _bindingNumberTableViewer.setSorter(tableSorter);
+        _bindingNumberTable.setSortColumn(_bindingNumberTable.getColumn(0));
+        _bindingNumberTable.setSortDirection(SWT.UP);
         
         //table of header bindings
         _headersTable = new Table (tablesComposite, SWT.SINGLE | SWT.SCROLL_LINE | SWT.BORDER | SWT.FULL_SELECTION);
@@ -272,6 +277,8 @@
         _headersTableViewer.setContentProvider(new ContentProviderImpl(HEADER_BINDINGS));
         _headersTableViewer.setLabelProvider(new LabelProviderImpl(HEADER_BINDINGS));
         _headersTableViewer.setSorter(queuesTableSorter);
+        _headersTable.setSortColumn(_headersTable.getColumn(0));
+        _headersTable.setSortDirection(SWT.UP);
         _headersTableViewer.setInput(new String[]{"Select a binding to view key-value pairs"});
         
         _bindingNumberTableViewer.addSelectionChangedListener(new ISelectionChangedListener(){
@@ -490,25 +497,38 @@
     private void createNewBinding(Shell parent)
     {
         final Shell shell = ViewUtility.createModalDialogShell(parent, "Create New Binding");
-
-        Composite destinationComposite = _toolkit.createComposite(shell, SWT.NONE);
-        destinationComposite.setBackground(shell.getBackground());
-        destinationComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-        destinationComposite.setLayout(new GridLayout(2,false));
+      
+        Composite queueNameComposite = _toolkit.createComposite(shell, SWT.NONE);
+        queueNameComposite.setBackground(shell.getBackground());
+        GridData layoutData = new GridData(SWT.CENTER, SWT.TOP, true, false);
+        layoutData.minimumWidth = 300;
+        queueNameComposite.setLayoutData(layoutData);
+        queueNameComposite.setLayout(new GridLayout(2,false));
         
-        _toolkit.createLabel(destinationComposite,"Queue:").setBackground(shell.getBackground());
-        final Combo destinationCombo = new Combo(destinationComposite,SWT.NONE | SWT.READ_ONLY);
+        _toolkit.createLabel(queueNameComposite,"Queue:").setBackground(shell.getBackground());
+        final Combo destinationCombo = new Combo(queueNameComposite,SWT.NONE | SWT.READ_ONLY);
         destinationCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
         
-        Composite bindingComposite = _toolkit.createComposite(shell, SWT.NONE);
-        bindingComposite.setBackground(shell.getBackground());
-        bindingComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-        bindingComposite.setLayout(new GridLayout(2,false));
-        
-        _toolkit.createLabel(bindingComposite,"Binding:").setBackground(shell.getBackground());
-        final Text bindingText = new Text(bindingComposite, SWT.BORDER);
-        bindingText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
+        final ScrolledComposite scrolledComposite = new ScrolledComposite(shell, SWT.V_SCROLL);
+        scrolledComposite.setExpandHorizontal(true);
+        scrolledComposite.setLayout(new GridLayout());
+        scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+        scrolledComposite.setBackground(shell.getBackground());
+        
+        final Composite bindingComposite = _toolkit.createComposite(scrolledComposite, SWT.NONE);
+        bindingComposite.setBackground(scrolledComposite.getBackground());
+        bindingComposite.setLayout(new GridLayout(2,true));
+        layoutData = new GridData(SWT.FILL, SWT.TOP, true, false);
+        bindingComposite.setLayoutData(layoutData);
+        scrolledComposite.setContent(bindingComposite);
+        
+        Composite addMoreButtonComp = _toolkit.createComposite(shell);
+        addMoreButtonComp.setBackground(shell.getBackground());
+        addMoreButtonComp.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, true));
+        addMoreButtonComp.setLayout(new GridLayout());
+        
+        final Button addMoreButton = _toolkit.createButton(addMoreButtonComp, "Add additional field", SWT.PUSH);
+        
         Composite okCancelButtonsComp = _toolkit.createComposite(shell);
         okCancelButtonsComp.setBackground(shell.getBackground());
         okCancelButtonsComp.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, true));
@@ -532,26 +552,106 @@
             destinationCombo.setItems(queueList.toArray(new String[0]));
         }
         destinationCombo.select(0);
+
+        final HashMap<Text, Text> headerBindingHashMap = new HashMap<Text, Text>();
+        
+        //add headings
+        Label keyLabel = _toolkit.createLabel(bindingComposite,"Key:");
+        keyLabel.setBackground(bindingComposite.getBackground());
+        keyLabel.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false));
+        
+        Label valueLabel = _toolkit.createLabel(bindingComposite,"Value:");
+        valueLabel.setBackground(bindingComposite.getBackground());
+        valueLabel.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false));
+        
+        //add the x-match key by default and offer a comobo to select its value
+        final Text xmatchKeyText = new Text(bindingComposite, SWT.BORDER);
+        xmatchKeyText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+        xmatchKeyText.setText("x-match");
+        xmatchKeyText.setEditable(false);
+        
+        final Combo xmatchValueCombo = new Combo(bindingComposite,SWT.NONE | SWT.READ_ONLY);
+        xmatchValueCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+        xmatchValueCombo.setItems(new String[]{"any", "all"});
+        xmatchValueCombo.select(0);
+        
+        //make some empty key-value fields
+        for(int i=0; i < 4; i++)
+        {
+            Text keyText = new Text(bindingComposite, SWT.BORDER);
+            Text valueText = new Text(bindingComposite, SWT.BORDER);
+            keyText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+            valueText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+
+            headerBindingHashMap.put(keyText, valueText);
+        }
+        bindingComposite.setSize(bindingComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+        
+        //allow adding more fields for additional key-value pairs
+        addMoreButton.addSelectionListener(new SelectionAdapter()
+        {
+            public void widgetSelected(SelectionEvent e)
+            {
+                Text keyText = new Text(bindingComposite, SWT.BORDER);
+                Text valueText = new Text(bindingComposite, SWT.BORDER);
+                keyText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+                valueText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+
+                headerBindingHashMap.put(keyText, valueText);
+
+                bindingComposite.setSize(bindingComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+                bindingComposite.layout(true);
+                scrolledComposite.layout(true);
+            }
+        });
         
         okButton.addSelectionListener(new SelectionAdapter()
         {
             public void widgetSelected(SelectionEvent e)
             {
-                String binding = bindingText.getText();
+                String xMatchString = xmatchValueCombo.getText();
                 
-                if (binding == null || binding.length() == 0)
+                String destQueue = destinationCombo.getItem(destinationCombo.getSelectionIndex()).toString();
+                
+                StringBuffer bindingValue = new StringBuffer();
+
+                //insert the x-match key-value pair
+                if (xMatchString.equalsIgnoreCase("any"))
                 {                            
-                    ViewUtility.popupErrorMessage("Create New Binding", "Please enter a valid binding");
-                    return;
+                    bindingValue.append("x-match=any");
+                }
+                else
+                {
+                    bindingValue.append("x-match=all");
                 }
                 
-                String destQueue = destinationCombo.getItem(destinationCombo.getSelectionIndex()).toString();
+                //insert the other key-value pairs
+                for (Text keyText : headerBindingHashMap.keySet())
+                {
+                    
+                    String key = keyText.getText();
+                    if(key == null || key.length() == 0)
+                    {
+                        continue;
+                    }
+                    
+                    Text valueText = headerBindingHashMap.get(keyText);
+                    String value = valueText.getText();
+                    
+                    bindingValue.append(",");
+                    bindingValue.append(key + "=");
+                    //empty values are permitted, signalling only key-presence is required
+                    if(value != null && value.length() > 0)
+                    {
+                        bindingValue.append(value);
+                    }
+                }
                 
                 shell.dispose();
 
                 try
                 {
-                    _emb.createNewBinding(destQueue, binding);
+                    _emb.createNewBinding(destQueue, bindingValue.toString());
                     ViewUtility.operationResultFeedback(null, "Created new Binding", null);
                 }
                 catch (Exception e4)

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/logging/ConfigurationFileTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/logging/ConfigurationFileTabControl.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/logging/ConfigurationFileTabControl.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/logging/ConfigurationFileTabControl.java Wed Sep  9 13:05:43 2009
@@ -197,8 +197,8 @@
                 "NOTE: These options modify the configuration file. " +
                 "Changes only take effect automatically if LogWatch is enabled.");
         Label noteLabel2 = _toolkit.createLabel(_headerComposite, 
-                "A Logger set to a non-inherited Level in the Runtime tab " +
-                "will retain that value after the configuration is reloaded.");
+                "A child Logger set to a non-inherited Level in the Runtime tab " +
+                "will retain that value after the file is reloaded.");
         GridData gridData = new GridData(SWT.FILL, SWT.FILL, false, true);
         noteLabel.setLayoutData(gridData);
         gridData = new GridData(SWT.FILL, SWT.FILL, false, true);

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java Wed Sep  9 13:05:43 2009
@@ -299,8 +299,8 @@
         //message table
         Composite tableAndButtonsComposite = _toolkit.createComposite(messagesGroup);
         gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
-        gridData.minimumHeight = 220;
-        gridData.heightHint = 220;
+        gridData.minimumHeight = 180;
+        gridData.heightHint = 180;
         tableAndButtonsComposite.setLayoutData(gridData);
         tableAndButtonsComposite.setLayout(new GridLayout(2,false));
                
@@ -358,6 +358,8 @@
         _tableViewer.setContentProvider(new ContentProviderImpl());
         _tableViewer.setLabelProvider(new LabelProviderImpl());
         _tableViewer.setSorter(tableSorter);
+        _table.setSortColumn(_table.getColumn(0));
+        _table.setSortDirection(SWT.UP);
         
         //Side Buttons
         Composite buttonsComposite = _toolkit.createComposite(tableAndButtonsComposite);
@@ -492,12 +494,12 @@
         headerEtcComposite.setLayoutData(gridData);
         headerEtcComposite.setLayout(new GridLayout());
         
-        final Text headerText = new Text(headerEtcComposite, SWT.WRAP | SWT.BORDER );
+        final Text headerText = new Text(headerEtcComposite, SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
         headerText.setText("Select a message to view its header.");
         headerText.setEditable(false);
         data = new GridData(SWT.LEFT, SWT.TOP, false, false);
-        data.minimumHeight = 230;
-        data.heightHint = 230;
+        data.minimumHeight = 210;
+        data.heightHint = 210;
         data.minimumWidth = 500;
         data.widthHint = 500;
         headerText.setLayoutData(data);
@@ -570,10 +572,16 @@
                     String[] msgHeader = (String[]) selectedMsg.get(MSG_HEADER);
                     headerText.setText("");
                     String lineSeperator = System.getProperty("line.separator");
-                    for(String s: msgHeader)
+                    int size = msgHeader.length;
+                    for(int i=0; i < size; i++)
                     {
-                        headerText.append(s + lineSeperator);
+                        headerText.append(msgHeader[i]);
+                        if(!(i == size - 1))
+                        {
+                            headerText.append(lineSeperator);
+                        }
                     }
+                    headerText.setSelection(0);
                 }
                 
                 if (_table.getSelectionCount() > 1)

Propchange: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -0,0 +1,2 @@
+/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java:520691-726139
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -0,0 +1,2 @@
+/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java:520691-726139
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -0,0 +1,2 @@
+/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java:520691-726139
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java:805429-812920

Propchange: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -0,0 +1,2 @@
+/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java:520691-726139
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java:805429-812920

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/vhost/VHostTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/vhost/VHostTabControl.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/vhost/VHostTabControl.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/vhost/VHostTabControl.java Wed Sep  9 13:05:43 2009
@@ -205,6 +205,8 @@
         _queueTableViewer.setContentProvider(new ContentProviderImpl());
         _queueTableViewer.setLabelProvider(new LabelProviderImpl());
         _queueTableViewer.setSorter(tableSorter);
+        _queueTable.setSortColumn(_queueTable.getColumn(0));
+        _queueTable.setSortDirection(SWT.UP);
         
         Composite queuesRightComposite = _toolkit.createComposite(queuesGroup);
         gridData = new GridData(SWT.FILL, SWT.FILL, false, true);
@@ -314,6 +316,8 @@
         _exchangeTableViewer.setContentProvider(new ContentProviderImpl());
         _exchangeTableViewer.setLabelProvider(new LabelProviderImpl());
         _exchangeTableViewer.setSorter(exchangeTableSorter);
+        _exchangeTable.setSortColumn(_exchangeTable.getColumn(0));
+        _exchangeTable.setSortDirection(SWT.UP);
         
         Composite exchangesRightComposite = _toolkit.createComposite(exchangesGroup);
         gridData = new GridData(SWT.FILL, SWT.FILL, false, true);

Propchange: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -0,0 +1,2 @@
+/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc:520691-726139
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc:805429-812920

Modified: qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/resources/win32-win32-x86/qpidmc.ini
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/resources/win32-win32-x86/qpidmc.ini?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/resources/win32-win32-x86/qpidmc.ini (original)
+++ qpid/branches/java-network-refactor/qpid/java/management/eclipse-plugin/src/main/resources/win32-win32-x86/qpidmc.ini Wed Sep  9 13:05:43 2009
@@ -23,14 +23,14 @@
 -XX:MaxPermSize=256m
 -Dosgi.requiredJavaVersion=1.5
 -Declipse.consoleLog=true
-
-#===============================================
-# SSL trust store configuration options.
-#===============================================
-
-# Uncomment lines below to specify custom truststore for server SSL
-# certificate verification, eg when using self-signed server certs.
-#
-#-Djavax.net.ssl.trustStore=<path.to.truststore>
-#-Djavax.net.ssl.trustStorePassword=<truststore.password>
-
+
+#===============================================
+# SSL trust store configuration options.
+#===============================================
+
+# Uncomment lines below to specify custom truststore for server SSL
+# certificate verification, eg when using self-signed server certs.
+#
+#-Djavax.net.ssl.trustStore=<path.to.truststore>
+#-Djavax.net.ssl.trustStorePassword=<truststore.password>
+

Propchange: qpid/branches/java-network-refactor/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  9 13:05:43 2009
@@ -0,0 +1,2 @@
+/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java:520691-707694
+/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java:805429-812920

Modified: qpid/branches/java-network-refactor/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-network-refactor/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java?rev=812936&r1=812935&r2=812936&view=diff
==============================================================================
--- qpid/branches/java-network-refactor/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java (original)
+++ qpid/branches/java-network-refactor/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/ManagementActorLoggingTest.java Wed Sep  9 13:05:43 2009
@@ -29,6 +29,8 @@
 import org.apache.qpid.server.logging.subjects.AbstractTestLogSubject;
 
 import javax.jms.Connection;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
 import javax.management.JMException;
 import javax.management.MBeanException;
 import javax.management.MBeanServerConnection;
@@ -38,6 +40,8 @@
 import java.io.IOException;
 import java.util.List;
 import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 /**
  * Test class to test if any change in the broker JMX code is affesting the management console
@@ -161,6 +165,23 @@
             //Create a connection to the broker
             Connection connection = getConnection();
 
+            // Monitor the connection for an exception being thrown
+            // this should be a DisconnectionException but it is not this tests
+            // job to valiate that. Only use the exception as a synchronisation
+            // to check the log file for the Close message
+            final CountDownLatch exceptionReceived = new CountDownLatch(1);
+            connection.setExceptionListener(new ExceptionListener()
+            {
+                public void onException(JMSException e)
+                {
+                    //Failover being attempted.
+                    exceptionReceived.countDown();
+                }
+            });
+
+            //Remove the connection close from any 0-10 connections
+            _monitor.reset();
+
             // Get all active AMQP connections
             AllObjects allObject = new AllObjects(_mbsc);
             allObject.querystring = "org.apache.qpid:type=VirtualHost.Connection,*";
@@ -175,16 +196,17 @@
                     newProxyInstance(_mbsc, connectionName,
                                      ManagedConnection.class, false);
 
-            //Remove the connection close from any 0-10 connections 
-           _monitor.reset();
 
             //Close the connection
             mangedConnection.closeConnection();
 
+            //Wait for the connection to close
+            assertTrue("Timed out waiting for conneciton to report close",
+                       exceptionReceived.await(2, TimeUnit.SECONDS));
+
             //Validate results
             List<String> results = _monitor.findMatches("CON-1002");
 
-
             assertEquals("Unexpected Connection Close count", 1, results.size());
         }
     }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message