Repository: activemq-artemis
Updated Branches:
  refs/heads/master 43f4a758d -> 2994ad2e5


ARTEMIS-1697 give ActivateCallback default methods


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/1e57a8e7
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/1e57a8e7
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/1e57a8e7

Branch: refs/heads/master
Commit: 1e57a8e70aab06c38c79c9f1f532f7b0490a564b
Parents: 43f4a75
Author: Justin Bertram <jbert...@apache.org>
Authored: Thu Feb 22 12:42:18 2018 -0600
Committer: Michael Andre Pearce <michael.andre.pea...@me.com>
Committed: Thu Feb 22 21:37:33 2018 +0000

----------------------------------------------------------------------
 .../jms/server/impl/JMSServerManagerImpl.java        |  5 -----
 .../artemis/core/server/ActivateCallback.java        | 12 ++++++++----
 .../core/server/impl/FileLockNodeManager.java        | 12 ------------
 .../artemis/core/server/impl/InVMNodeManager.java    | 12 ------------
 .../core/server/impl/jdbc/JdbcNodeManager.java       | 12 ------------
 .../management/impl/ManagementServiceImpl.java       | 12 ------------
 .../integration/discovery/DiscoveryBaseTest.java     | 15 ---------------
 7 files changed, 8 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1e57a8e7/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
----------------------------------------------------------------------
diff --git 
a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
 
b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
index 69d4b90..0e60880 100644
--- 
a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
+++ 
b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
@@ -169,11 +169,6 @@ public class JMSServerManagerImpl implements 
JMSServerManager, ActivateCallback
    // ActivateCallback implementation -------------------------------------
 
    @Override
-   public void preActivate() {
-
-   }
-
-   @Override
    public synchronized void activated() {
       if (!startCalled) {
          return;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1e57a8e7/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivateCallback.java
----------------------------------------------------------------------
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivateCallback.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivateCallback.java
index 9841d67..f3d3820 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivateCallback.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivateCallback.java
@@ -21,21 +21,25 @@ public interface ActivateCallback {
    /*
     * this is called before any services are started when the server first 
initialised
     */
-   void preActivate();
+   default void preActivate() {
+   }
 
    /*
     * this is called after most of the services have been started but before 
any cluster resources or JMS resources have been
     */
-   void activated();
+   default void activated() {
+   }
 
    /*
     * this is called when the server is stopping, after any network resources 
and clients are closed but before the rest
     * of the resources
     */
-   void deActivate();
+   default void deActivate() {
+   }
 
    /*
     * this is called when all resources have been started including any JMS 
resources
     */
-   void activationComplete();
+   default void activationComplete() {
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1e57a8e7/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
----------------------------------------------------------------------
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
index ad0292c..73156ee 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
@@ -171,18 +171,6 @@ public class FileLockNodeManager extends NodeManager {
 
       return new ActivateCallback() {
          @Override
-         public void preActivate() {
-         }
-
-         @Override
-         public void activated() {
-         }
-
-         @Override
-         public void deActivate() {
-         }
-
-         @Override
          public void activationComplete() {
             try {
                setLive();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1e57a8e7/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
----------------------------------------------------------------------
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
index 63fac28..2719d66 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
@@ -109,18 +109,6 @@ public final class InVMNodeManager extends NodeManager {
       liveLock.acquire();
       return new ActivateCallback() {
          @Override
-         public void preActivate() {
-         }
-
-         @Override
-         public void activated() {
-         }
-
-         @Override
-         public void deActivate() {
-         }
-
-         @Override
          public void activationComplete() {
             try {
                state = LIVE;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1e57a8e7/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcNodeManager.java
----------------------------------------------------------------------
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcNodeManager.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcNodeManager.java
index 2360df6..4ed45a6 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcNodeManager.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcNodeManager.java
@@ -351,18 +351,6 @@ public final class JdbcNodeManager extends NodeManager {
 
       return new ActivateCallback() {
          @Override
-         public void preActivate() {
-         }
-
-         @Override
-         public void activated() {
-         }
-
-         @Override
-         public void deActivate() {
-         }
-
-         @Override
          public void activationComplete() {
             try {
                //state can be written only if the live renew task is running

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1e57a8e7/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
index 24a30bf..48b96c8 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
@@ -548,10 +548,6 @@ public class ManagementServiceImpl implements 
ManagementService {
        */
       messagingServer.registerActivateCallback(new ActivateCallback() {
          @Override
-         public void preActivate() {
-         }
-
-         @Override
          public void activated() {
             try {
                messagingServer.addAddressInfo(new 
AddressInfo(managementNotificationAddress, RoutingType.MULTICAST));
@@ -559,14 +555,6 @@ public class ManagementServiceImpl implements 
ManagementService {
                
ActiveMQServerLogger.LOGGER.unableToCreateManagementNotificationAddress(managementNotificationAddress,
 e);
             }
          }
-
-         @Override
-         public void deActivate() {
-         }
-
-         @Override
-         public void activationComplete() {
-         }
       });
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1e57a8e7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
----------------------------------------------------------------------
diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
index bfef53c..17128c7 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java
@@ -195,21 +195,6 @@ public class DiscoveryBaseTest extends ActiveMQTestBase {
       @Override
       public ActivateCallback startLiveNode() throws Exception {
          return new ActivateCallback() {
-            @Override
-            public void preActivate() {
-            }
-
-            @Override
-            public void activated() {
-            }
-
-            @Override
-            public void deActivate() {
-            }
-
-            @Override
-            public void activationComplete() {
-            }
          };
       }
 

Reply via email to