qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1783833 - in /qpid/java/trunk: broker-core/src/main/java/org/apache/qpid/server/transport/ broker-core/src/main/java/org/apache/qpid/server/transport/util/ broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/
Date Tue, 21 Feb 2017 06:36:21 GMT
Author: kwall
Date: Tue Feb 21 06:36:21 2017
New Revision: 1783833

URL: http://svn.apache.org/viewvc?rev=1783833&view=rev
Log:
QPID-7622: [Java Broker] [0-10] Remove dead waiter code from ServerConnection

Added:
    qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ProtocolEventSender.java
      - copied, changed from r1783832, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/ProtocolEventSender.java
    qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Waiter.java
      - copied, changed from r1783832, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/util/Waiter.java
Removed:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/ProtocolEventReceiver.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/ProtocolEventSender.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/util/Waiter.java
Modified:
    qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
    qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java
    qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerDisassembler.java
    qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java

Copied: qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ProtocolEventSender.java
(from r1783832, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/ProtocolEventSender.java)
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ProtocolEventSender.java?p2=qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ProtocolEventSender.java&p1=qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/ProtocolEventSender.java&r1=1783832&r2=1783833&rev=1783833&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/ProtocolEventSender.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ProtocolEventSender.java
Tue Feb 21 06:36:21 2017
@@ -1,5 +1,4 @@
 /*
- *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -18,7 +17,9 @@
  * under the License.
  *
  */
-package org.apache.qpid.server.transport;
+package org.apache.qpid.server.protocol.v0_10;
+
+import org.apache.qpid.server.transport.ProtocolEvent;
 
 public interface ProtocolEventSender
 {

Modified: qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java?rev=1783833&r1=1783832&r2=1783833&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
Tue Feb 21 06:36:21 2017
@@ -60,11 +60,10 @@ import org.apache.qpid.server.protocol.E
 import org.apache.qpid.server.session.AMQPSession;
 import org.apache.qpid.server.transport.*;
 import org.apache.qpid.server.transport.network.NetworkConnection;
-import org.apache.qpid.server.transport.util.Waiter;
 import org.apache.qpid.server.util.Action;
 import org.apache.qpid.server.util.ServerScopedRuntimeException;
 
-public class ServerConnection extends ConnectionInvoker implements ProtocolEventReceiver,
ProtocolEventSender
+public class ServerConnection extends ConnectionInvoker
 {
     private static final Logger LOGGER = LoggerFactory.getLogger(ServerConnection.class);
     private final Broker<?> _broker;
@@ -91,8 +90,6 @@ public class ServerConnection extends Co
     private ServerConnectionDelegate delegate;
     private ProtocolEventSender sender;
     private State state = NEW;
-    private long timeout = 60000;  // TODO server side close does not require this
-    private ConnectionException error = null;
     private int channelMax = 1;
     private String locale;
     private SocketAddress _remoteAddress;
@@ -251,7 +248,6 @@ public class ServerConnection extends Co
 
     }
 
-    @Override
     public void exception(final Throwable t)
     {
         try
@@ -277,7 +273,6 @@ public class ServerConnection extends Co
     }
 
 
-    @Override
     public void received(final ProtocolEvent event)
     {
         _lastIoTime.set(System.currentTimeMillis());
@@ -418,7 +413,6 @@ public class ServerConnection extends Co
         return _connectionId;
     }
 
-    @Override
     public void closed()
     {
         try
@@ -485,7 +479,6 @@ public class ServerConnection extends Co
         }
     }
 
-    @Override
     public void send(ProtocolEvent event)
     {
         _lastIoTime.set(System.currentTimeMillis());
@@ -581,7 +574,6 @@ public class ServerConnection extends Co
         }
     }
 
-    @Override
     public void flush()
     {
         if(LOGGER.isDebugEnabled())
@@ -693,7 +685,6 @@ public class ServerConnection extends Co
             {
             case OPENING:
             case CLOSING:
-                error = e;
                 lock.notifyAll();
                 return;
             }
@@ -712,76 +703,11 @@ public class ServerConnection extends Co
         }
     }
 
-    @Override
-    public void close()
-    {
-        close(ConnectionCloseCode.NORMAL, null);
-    }
-
     protected void sendConnectionClose(ConnectionCloseCode replyCode, String replyText, Option...
_options)
     {
         connectionClose(replyCode, replyText, _options);
     }
 
-    public void close(ConnectionCloseCode replyCode, String replyText, Option ... _options)
-    {
-        synchronized (lock)
-        {
-            switch (state)
-            {
-            case OPEN:
-                state = CLOSING;
-                connectionClose(replyCode, replyText, _options);
-                Waiter w = new Waiter(lock, timeout);
-                while (w.hasTime() && state == CLOSING && error == null)
-                {
-                    w.await();
-                }
-
-                if (error != null)
-                {
-                    close(replyCode, replyText, _options);
-                    throw new ConnectionException(error);
-                }
-
-                switch (state)
-                {
-                case CLOSING:
-                    close(replyCode, replyText, _options);
-                    throw new ConnectionException("close() timed out");
-                case CLOSED:
-                    break;
-                default:
-                    throw new IllegalStateException(String.valueOf(state));
-                }
-                break;
-            case CLOSED:
-                break;
-            default:
-                if (sender != null)
-                {
-                    sender.close();
-                    w = new Waiter(lock, timeout);
-                    while (w.hasTime() && sender != null && error == null)
-                    {
-                        w.await();
-                    }
-
-                    if (error != null)
-                    {
-                        throw new ConnectionException(error);
-                    }
-
-                    if (sender != null)
-                    {
-                        throw new ConnectionException("close() timed out");
-                    }
-                }
-                break;
-            }
-        }
-    }
-
     @Override
     public String toString()
     {

Modified: qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java?rev=1783833&r1=1783832&r2=1783833&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java
Tue Feb 21 06:36:21 2017
@@ -50,13 +50,6 @@ import org.apache.qpid.server.transport.
 import org.apache.qpid.server.util.ConnectionScopedRuntimeException;
 import org.apache.qpid.server.virtualhost.VirtualHostUnavailableException;
 
-/*
-
-Method ConnectionDelegate.connectionClose(ServerConnection, ConnectionClose) is already overridden
in class org.apache.qpid.server.protocol.v0_10.ServerConnectionDelegate. Method will not be
pushed down to that class.
-
-
-
- */
 public class ServerConnectionDelegate extends MethodDelegate<ServerConnection> implements
ProtocolDelegate<ServerConnection>
 {
     private static final Logger LOGGER = LoggerFactory.getLogger(ServerConnectionDelegate.class);

Modified: qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerDisassembler.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerDisassembler.java?rev=1783833&r1=1783832&r2=1783833&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerDisassembler.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerDisassembler.java
Tue Feb 21 06:36:21 2017
@@ -42,7 +42,6 @@ import org.apache.qpid.server.transport.
 import org.apache.qpid.server.transport.ProtocolDelegate;
 import org.apache.qpid.server.transport.ProtocolError;
 import org.apache.qpid.server.transport.ProtocolEvent;
-import org.apache.qpid.server.transport.ProtocolEventSender;
 import org.apache.qpid.server.transport.ProtocolHeader;
 import org.apache.qpid.server.transport.SegmentType;
 import org.apache.qpid.server.transport.Struct;

Modified: qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java?rev=1783833&r1=1783832&r2=1783833&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java
Tue Feb 21 06:36:21 2017
@@ -89,7 +89,6 @@ import org.apache.qpid.server.store.Stor
 import org.apache.qpid.server.store.TransactionLogResource;
 import org.apache.qpid.server.transport.AMQPConnection;
 import org.apache.qpid.server.transport.network.Frame;
-import org.apache.qpid.server.transport.util.Waiter;
 import org.apache.qpid.server.txn.AlreadyKnownDtxException;
 import org.apache.qpid.server.txn.AsyncAutoCommitTransaction;
 import org.apache.qpid.server.txn.DistributedTransaction;

Copied: qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Waiter.java
(from r1783832, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/util/Waiter.java)
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Waiter.java?p2=qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Waiter.java&p1=qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/util/Waiter.java&r1=1783832&r2=1783833&rev=1783833&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/util/Waiter.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/Waiter.java
Tue Feb 21 06:36:21 2017
@@ -1,5 +1,4 @@
 /*
- *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -18,7 +17,7 @@
  * under the License.
  *
  */
-package org.apache.qpid.server.transport.util;
+package org.apache.qpid.server.protocol.v0_10;
 
 
 /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message