ARTEMIS-1253 Refactoring renaming stop(boolean) to fail(boolean)

This method name would clash with ServiceComponent
As the real meaning here on this method is just to failover
So I've renamed the method to avoid the clash with my next commit

(I've done this on a separate commit as you may need to redo this
 commit from scratch again in other branches instead of lots of clashes on cherry-pick)
This commit is contained in:
Clebert Suconic 2017-06-26 12:52:18 -04:00
parent 4bae814908
commit 36110da9c8
20 changed files with 29 additions and 29 deletions

View File

@ -2216,7 +2216,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
clearIO();
server.stop(true);
server.fail(true);
}
@Override
@ -2251,7 +2251,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
liveOnlyPolicy.getScaleDownPolicy().getConnectors().add(0, connector);
}
server.stop(true);
server.fail(true);
}
}

View File

@ -381,7 +381,7 @@ public interface ActiveMQServer extends ServiceComponent {
*/
boolean isAddressBound(String address) throws Exception;
void stop(boolean failoverOnServerShutdown) throws Exception;
void fail(boolean failoverOnServerShutdown) throws Exception;
Queue updateQueue(String name,
RoutingType routingType,

View File

@ -832,7 +832,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
}
@Override
public final void stop(boolean failoverOnServerShutdown) throws Exception {
public final void fail(boolean failoverOnServerShutdown) throws Exception {
stop(failoverOnServerShutdown, false, false, false);
}

View File

@ -180,7 +180,7 @@ public class SharedNothingLiveActivation extends LiveActivation {
clusterConnection.addClusterTopologyListener(listener1);
if (listener1.waitForBackup()) {
//if we have to many backups kept or are not configured to restart just stop, otherwise restart as a backup
activeMQServer.stop(true);
activeMQServer.fail(true);
ActiveMQServerLogger.LOGGER.restartingReplicatedBackupAfterFailback();
// activeMQServer.moveServerData(replicatedPolicy.getReplicaPolicy().getMaxSavedReplicatedJournalsSize());
activeMQServer.setHAPolicy(replicatedPolicy.getReplicaPolicy());

View File

@ -2358,7 +2358,7 @@ public abstract class ActiveMQTestBase extends Assert {
clusterManager.flushExecutor();
clusterManager.clear();
Assert.assertTrue("server should be running!", server.isStarted());
server.stop(true);
server.fail(true);
if (sessions.length > 0) {
// Wait to be informed of failure

View File

@ -71,7 +71,7 @@ public class BMFailoverTest extends FailoverTestBase {
public static void stopAndThrow() throws ActiveMQUnBlockedException {
if (!stopped) {
try {
serverToStop.getServer().stop(true);
serverToStop.getServer().fail(true);
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -233,7 +233,7 @@ public class LargeMessageOverReplicationTest extends ActiveMQTestBase {
try {
if (messageChunkCount == 10) {
liveServer.stop(true);
liveServer.fail(true);
System.err.println("activating");
if (!backupServer.waitForActivation(1, TimeUnit.MINUTES)) {

View File

@ -221,7 +221,7 @@ public class RaceOnSyncLargeMessageOverReplication2Test extends ActiveMQTestBase
waitForRemoteBackup(connection.getSessionFactory(), 30);
liveServer.stop(true);
liveServer.fail(true);
Assert.assertTrue(failedOver.await(10, TimeUnit.SECONDS));

View File

@ -200,7 +200,7 @@ public class RaceOnSyncLargeMessageOverReplicationTest extends ActiveMQTestBase
Assert.assertFalse(t.isAlive());
liveServer.stop(true);
liveServer.fail(true);
Assert.assertTrue(failedOver.await(10, TimeUnit.SECONDS));

View File

@ -92,7 +92,7 @@ public class StartStopDeadlockTest extends ActiveMQTestBase {
align.countDown();
startLatch.await();
System.out.println("Crashing....");
serverLive.stop(true);
serverLive.fail(true);
} catch (Exception e) {
errors.incrementAndGet();
e.printStackTrace();

View File

@ -129,7 +129,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
// ((ServerSessionImpl) srvSession).clearLargeMessage();
// }
server.stop(false);
server.fail(false);
ActiveMQTestBase.forceGC();
@ -307,7 +307,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
session.rollback();
}
server.stop(false);
server.fail(false);
server.start();
server.stop();
@ -385,7 +385,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
sf.close();
}
server.stop(false);
server.fail(false);
server.start();
validateNoFilesOnLargeDir();
@ -443,7 +443,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
session.close();
sf.close();
server.stop(false);
server.fail(false);
server.start();
for (int start = 0; start < 2; start++) {
@ -635,7 +635,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
}
((ActiveMQServerImpl) server).replaceQueueFactory(original);
server.stop(false);
server.fail(false);
server.start();
server.stop();
@ -698,7 +698,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
}
((ActiveMQServerImpl) server).replaceQueueFactory(original);
server.stop(false);
server.fail(false);
server.start();
server.stop();

View File

@ -155,7 +155,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
startServers();
waitForServerStart(server0);
server0.stop(true);
server0.fail(true);
waitForServerStart(server2);
@ -206,7 +206,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
BridgeReconnectTest.log.info("** failing connection");
// Now we will simulate a failure of the bridge connection between server0 and server1
server0.stop(true);
server0.fail(true);
waitForServerStart(server2);
@ -285,7 +285,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
startServers();
// Now we will simulate a failure of the bridge connection between server0 and server1
server0.stop(true);
server0.fail(true);
locator = addServerLocator(ActiveMQClient.createServerLocatorWithHA(server2tc)).setReconnectAttempts(100);
ClientSessionFactory csf0 = addSessionFactory(locator.createSessionFactory(server2tc));

View File

@ -1455,7 +1455,7 @@ public class BridgeTest extends ActiveMQTestBase {
try {
System.out.println("Stopping server");
latch.countDown();
serverToStop.stop(false);
serverToStop.fail(false);
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -93,7 +93,7 @@ public abstract class GroupingFailoverTestBase extends ClusterTestBase {
closeSessionFactory(0);
servers[0].stop(true);
servers[0].fail(true);
waitForServerRestart(2);
@ -194,7 +194,7 @@ public abstract class GroupingFailoverTestBase extends ClusterTestBase {
closeSessionFactory(0);
servers[0].stop(true);
servers[0].fail(true);
waitForServerRestart(2);

View File

@ -92,7 +92,7 @@ public class SameProcessActiveMQServer implements TestableServer {
clusterManager.flushExecutor();
clusterManager.clear();
Assert.assertTrue("server should be running!", server.isStarted());
server.stop(failover);
server.fail(failover);
if (waitFailure) {
// Wait to be informed of failure

View File

@ -220,7 +220,7 @@ public class ReplicationWithDivertTest extends ActiveMQTestBase {
}
Assert.assertFalse(t.isAlive());
liveServer.stop(true);
liveServer.fail(true);
Assert.assertTrue(failedOver.await(10, TimeUnit.SECONDS));
{

View File

@ -257,7 +257,7 @@ public class JMSUtil {
ClusterManager clusterManager = server.getClusterManager();
clusterManager.clear();
server.stop(true);
server.fail(true);
// Wait to be informed of failure
boolean ok = latch.await(10000, TimeUnit.MILLISECONDS);

View File

@ -1886,7 +1886,7 @@ public class MQTTTest extends MQTTTestSupport {
connection1.connect();
connection1.publish(address, payload.getBytes(), QoS.AT_LEAST_ONCE, true);
getServer().stop(false);
getServer().fail(false);
getServer().start();
waitForServerToStart(getServer());

View File

@ -73,7 +73,7 @@ public class PagingWithFailoverAndCountersTest extends ActiveMQTestBase {
if (inProcessBackup != null) {
try {
inProcessBackup.getServer().stop(false);
inProcessBackup.getServer().fail(false);
} catch (Throwable ignored) {
ignored.printStackTrace();
}

View File

@ -47,7 +47,7 @@ public class SimpleStartStopTest extends ActiveMQTestBase {
for (int i = 0; i < 50; i++) {
server = createServer(true, false);
server.start();
server.stop(false);
server.fail(false);
}
// There shouldn't be any error from starting / stopping the server