ARTEMIS-1697 give ActivateCallback default methods

This commit is contained in:
Justin Bertram 2018-02-22 12:42:18 -06:00 committed by Michael Andre Pearce
parent 43f4a758d6
commit 1e57a8e70a
7 changed files with 8 additions and 72 deletions

View File

@ -168,11 +168,6 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
// ActivateCallback implementation -------------------------------------
@Override
public void preActivate() {
}
@Override
public synchronized void activated() {
if (!startCalled) {

View File

@ -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() {
}
}

View File

@ -170,18 +170,6 @@ public class FileLockNodeManager extends NodeManager {
ActiveMQServerLogger.LOGGER.obtainedLiveLock();
return new ActivateCallback() {
@Override
public void preActivate() {
}
@Override
public void activated() {
}
@Override
public void deActivate() {
}
@Override
public void activationComplete() {
try {

View File

@ -108,18 +108,6 @@ public final class InVMNodeManager extends NodeManager {
state = FAILING_BACK;
liveLock.acquire();
return new ActivateCallback() {
@Override
public void preActivate() {
}
@Override
public void activated() {
}
@Override
public void deActivate() {
}
@Override
public void activationComplete() {
try {

View File

@ -350,18 +350,6 @@ public final class JdbcNodeManager extends NodeManager {
ActiveMQServerLogger.LOGGER.obtainedLiveLock();
return new ActivateCallback() {
@Override
public void preActivate() {
}
@Override
public void activated() {
}
@Override
public void deActivate() {
}
@Override
public void activationComplete() {
try {

View File

@ -547,10 +547,6 @@ public class ManagementServiceImpl implements ManagementService {
* bridges won't be able to connect.
*/
messagingServer.registerActivateCallback(new ActivateCallback() {
@Override
public void preActivate() {
}
@Override
public void activated() {
try {
@ -559,14 +555,6 @@ public class ManagementServiceImpl implements ManagementService {
ActiveMQServerLogger.LOGGER.unableToCreateManagementNotificationAddress(managementNotificationAddress, e);
}
}
@Override
public void deActivate() {
}
@Override
public void activationComplete() {
}
});
}

View File

@ -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() {
}
};
}