use of org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation in project activemq-artemis by apache.
the class ReplicaPolicy method createActivation.
@Override
public Activation createActivation(ActiveMQServerImpl server, boolean wasLive, Map<String, Object> activationParams, ActiveMQServerImpl.ShutdownOnCriticalErrorListener shutdownOnCriticalIO) throws Exception {
SharedNothingBackupActivation backupActivation = new SharedNothingBackupActivation(server, wasLive, activationParams, shutdownOnCriticalIO, this, networkHealthCheck);
backupActivation.init();
return backupActivation;
}
use of org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation in project activemq-artemis by apache.
the class HAPolicyConfigurationTest method ReplicaTest2.
@Test
public void ReplicaTest2() throws Exception {
Configuration configuration = createConfiguration("replica-hapolicy-config2.xml");
ActiveMQServerImpl server = new ActiveMQServerImpl(configuration);
try {
server.start();
Activation activation = server.getActivation();
assertTrue(activation instanceof SharedNothingBackupActivation);
HAPolicy haPolicy = server.getHAPolicy();
assertTrue(haPolicy instanceof ReplicaPolicy);
ReplicaPolicy replicaPolicy = (ReplicaPolicy) haPolicy;
assertEquals(replicaPolicy.getGroupName(), "tiddles");
assertEquals(replicaPolicy.getMaxSavedReplicatedJournalsSize(), 22);
assertEquals(replicaPolicy.getClusterName(), "33rrrrr");
assertFalse(replicaPolicy.isRestartBackup());
ScaleDownPolicy scaleDownPolicy = replicaPolicy.getScaleDownPolicy();
assertNotNull(scaleDownPolicy);
assertEquals(scaleDownPolicy.getGroupName(), "boo!");
assertEquals(scaleDownPolicy.getDiscoveryGroup(), null);
List<String> connectors = scaleDownPolicy.getConnectors();
assertNotNull(connectors);
assertEquals(connectors.size(), 2);
assertTrue(connectors.contains("sd-connector1"));
assertTrue(connectors.contains("sd-connector2"));
} finally {
server.stop();
}
}
Aggregations