org.apache.activemq.artemis.core.server.cluster.ha.ReplicatedPolicy

Here are the examples of the java api class org.apache.activemq.artemis.core.server.cluster.ha.ReplicatedPolicy taken from open source projects.

1. FailoverTestBase#adaptLiveConfigForReplicatedFailBack()

View license
protected final void adaptLiveConfigForReplicatedFailBack(TestableServer server) {
    Configuration configuration = server.getServer().getConfiguration();
    final TransportConfiguration backupConnector = getConnectorTransportConfiguration(false);
    if (server.getServer().getHAPolicy().isSharedStore()) {
        ClusterConnectionConfiguration cc = configuration.getClusterConfigurations().get(0);
        Assert.assertNotNull("cluster connection configuration", cc);
        Assert.assertNotNull("static connectors", cc.getStaticConnectors());
        cc.getStaticConnectors().add(backupConnector.getName());
        // backupConnector is only necessary for fail-back tests
        configuration.getConnectorConfigurations().put(backupConnector.getName(), backupConnector);
        return;
    }
    ReplicatedPolicy haPolicy = (ReplicatedPolicy) server.getServer().getHAPolicy();
    haPolicy.setCheckForLiveServer(true);
}