qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1788899 - in /qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10: ServerConnection.java ServerConnectionDelegate.java ServerSession.java ServerSessionDelegate.java
Date Mon, 27 Mar 2017 11:32:29 GMT
Author: orudyy
Date: Mon Mar 27 11:32:29 2017
New Revision: 1788899

URL: http://svn.apache.org/viewvc?rev=1788899&view=rev
Log:
QPID-7622: Remove .*Super.* methods introduced by 0-10 separation work

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/ServerSession.java
    qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java

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=1788899&r1=1788898&r2=1788899&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
Mon Mar 27 11:32:29 2017
@@ -131,21 +131,16 @@ public class ServerConnection extends Co
     @Override
     protected void invoke(Method method)
     {
-        invokeSuper(method);
-        if (method instanceof ConnectionClose)
-        {
-            _ignoreAllButConnectionCloseOk = true;
-        }
-    }
-
-    private void invokeSuper(Method method)
-    {
         method.setChannel(0);
         send(method);
         if (!method.isBatch())
         {
             flush();
         }
+        if (method instanceof ConnectionClose)
+        {
+            _ignoreAllButConnectionCloseOk = true;
+        }
     }
 
 
@@ -156,7 +151,11 @@ public class ServerConnection extends Co
 
     protected void setState(State state)
     {
-        setStateSuper(state);
+        synchronized (lock)
+        {
+            this.state = state;
+            lock.notifyAll();
+        }
 
         if(state == State.CLOSING)
         {
@@ -169,23 +168,9 @@ public class ServerConnection extends Co
         }
     }
 
-    private void setStateSuper(State state)
-    {
-        synchronized (lock)
-        {
-            this.state = state;
-            lock.notifyAll();
-        }
-    }
-
 
     public ServerConnectionDelegate getConnectionDelegate()
     {
-        return (ServerConnectionDelegate) getConnectionDelegateSuper();
-    }
-
-    private ServerConnectionDelegate getConnectionDelegateSuper()
-    {
         return delegate;
     }
 
@@ -261,7 +246,7 @@ public class ServerConnection extends Co
     {
         try
         {
-            exceptionSuper(t);
+            exception(new ConnectionException(t));
         }
         finally
         {
@@ -276,11 +261,6 @@ public class ServerConnection extends Co
         }
     }
 
-    private void exceptionSuper(Throwable t)
-    {
-        exception(new ConnectionException(t));
-    }
-
 
     public void received(final ProtocolEvent event)
     {
@@ -346,18 +326,13 @@ public class ServerConnection extends Co
 
     public synchronized void registerSession(final ServerSession ssn)
     {
-        registerSessionSuper(ssn);
-        if(_blocking)
+        synchronized (lock)
         {
-            ((ServerSession)ssn).block();
+            sessions.put(ssn.getName(), ssn);
         }
-    }
-
-    private void registerSessionSuper(ServerSession ssn)
-    {
-        synchronized (lock)
+        if(_blocking)
         {
-            sessions.put(ssn.getName(),ssn);
+            ssn.block();
         }
     }
 
@@ -368,11 +343,6 @@ public class ServerConnection extends Co
 
     protected Collection<ServerSession> getChannels()
     {
-        return  (Collection<ServerSession>) getChannelsSuper();
-    }
-
-    private Collection<ServerSession> getChannelsSuper()
-    {
         return new ArrayList<>(channels.values());
     }
 
@@ -397,47 +367,42 @@ public class ServerConnection extends Co
         try
         {
             performDeleteTasks();
-            closedSuper();
-        }
-        finally
-        {
-            NamedAddressSpace addressSpace = getAddressSpace();
-            if(addressSpace != null)
+            if (state == OPEN)
             {
-                addressSpace.deregisterConnection(_amqpConnection);
+                exception(new ConnectionException("connection aborted"));
             }
-        }
 
-    }
+            LOGGER.debug("connection closed: {}", this);
 
-    private void closedSuper()
-    {
-        if (state == OPEN)
-        {
-            exception(new ConnectionException("connection aborted"));
-        }
-
-        LOGGER.debug("connection closed: {}", this);
-
-        synchronized (lock)
-        {
-            List<ServerSession> values = new ArrayList<ServerSession>(channels.values());
-            for (ServerSession ssn : values)
+            synchronized (lock)
             {
-                ssn.closed();
-            }
+                List<ServerSession> values = new ArrayList<ServerSession>(channels.values());
+                for (ServerSession ssn : values)
+                {
+                    ssn.closed();
+                }
 
-            try
-            {
-                sender.close();
+                try
+                {
+                    sender.close();
+                }
+                catch(Exception e)
+                {
+                    // ignore.
+                }
+                sender = null;
+                setState(CLOSED);
             }
-            catch(Exception e)
+        }
+        finally
+        {
+            NamedAddressSpace addressSpace = getAddressSpace();
+            if(addressSpace != null)
             {
-                // ignore.
+                addressSpace.deregisterConnection(_amqpConnection);
             }
-            sender = null;
-            setState(CLOSED);
         }
+
     }
 
     private void markAllSessionsClosed()
@@ -461,11 +426,6 @@ public class ServerConnection extends Co
     public void send(ProtocolEvent event)
     {
         _lastIoTime.set(System.currentTimeMillis());
-        sendSuper(event);
-    }
-
-    private void sendSuper(ProtocolEvent event)
-    {
         if(LOGGER.isDebugEnabled())
         {
             LOGGER.debug("SEND: [{}] {}", this, String.valueOf(event));

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=1788899&r1=1788898&r2=1788899&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
Mon Mar 27 11:32:29 2017
@@ -411,18 +411,9 @@ public class ServerConnectionDelegate ex
     @Override
     public void sessionDetach(ServerConnection conn, SessionDetach dtc)
     {
-        // To ensure a clean detach, we stop any remaining subscriptions. Stop ensures
-        // that any in-progress delivery (QueueRunner) is completed before the stop
-        // completes.
         stopAllSubscriptions(conn, dtc);
         ServerSession ssn = conn.getSession(dtc.getChannel());
-        ((ServerSession)ssn).setClose(true);
-        sessionDetachSuper(conn, dtc);
-    }
-
-    private void sessionDetachSuper(ServerConnection conn, SessionDetach dtc)
-    {
-        ServerSession ssn = conn.getSession(dtc.getChannel());
+        ssn.setClose(true);
         ssn.sessionDetached(dtc.getName(), ssn.getDetachCode() == null? SessionDetachCode.NORMAL:
ssn.getDetachCode());
         conn.unmap(ssn);
         ssn.closed();

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=1788899&r1=1788898&r2=1788899&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
Mon Mar 27 11:32:29 2017
@@ -909,7 +909,11 @@ public class ServerSession extends Sessi
     {
         if(runningAsSubject())
         {
-            setStateSuper(state);
+            synchronized (commandsLock)
+            {
+                this.state = state;
+                commandsLock.notifyAll();
+            }
 
             if (state == State.OPEN)
             {
@@ -931,15 +935,6 @@ public class ServerSession extends Sessi
         }
     }
 
-    private void setStateSuper(State state)
-    {
-        synchronized (commandsLock)
-        {
-            this.state = state;
-            commandsLock.notifyAll();
-        }
-    }
-
 
     private <T> T runAsSubject(final PrivilegedAction<T> privilegedAction)
     {
@@ -1500,11 +1495,6 @@ public class ServerSession extends Sessi
 
     public ServerConnection getConnection()
     {
-        return (ServerConnection) getConnectionSuper();
-    }
-
-    private ServerConnection getConnectionSuper()
-    {
         return connection;
     }
 
@@ -1634,11 +1624,6 @@ public class ServerSession extends Sessi
         {
             _modelObject.delete();
         }
-        closeSuper();
-    }
-
-    private void closeSuper()
-    {
         if (LOGGER.isDebugEnabled())
         {
             LOGGER.debug("Closing [{}] in state [{}]", this, state);

Modified: qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.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/ServerSessionDelegate.java?rev=1788899&r1=1788898&r2=1788899&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
Mon Mar 27 11:32:29 2017
@@ -839,12 +839,7 @@ public class ServerSessionDelegate exten
     @Override
     public void executionSync(final ServerSession ssn, final ExecutionSync sync)
     {
-        ((ServerSession)ssn).awaitCommandCompletion();
-        executionSyncSuper(ssn, sync);
-    }
-
-    private void executionSyncSuper(ServerSession ssn, ExecutionSync sync)
-    {
+        ssn.awaitCommandCompletion();
         ssn.syncPoint();
     }
 



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


Mime
View raw message