use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.
the class RedundancyLevelTestBase method createClientCache.
public static void createClientCache(String host, int port1, int port2, int port3, int port4, int redundancy, int socketReadTimeout, int retryInterval) throws Exception {
if (!FailOverDetectionByCCU) {
oldBo = ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
public void beforeFailoverByCacheClientUpdater(ServerLocation epFailed) {
try {
Thread.sleep(300000);
} catch (InterruptedException ie) {
// expected - test will shut down the cache which will interrupt
// the CacheClientUpdater thread that invoked this method
Thread.currentThread().interrupt();
}
}
});
}
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
new RedundancyLevelTestBase().createCache(props);
PoolImpl p = (PoolImpl) PoolManager.createFactory().addServer(host, PORT1).addServer(host, PORT2).addServer(host, PORT3).addServer(host, PORT4).setSubscriptionEnabled(true).setReadTimeout(socketReadTimeout).setSocketBufferSize(32768).setMinConnections(8).setSubscriptionRedundancy(redundancy).setRetryAttempts(5).setPingInterval(retryInterval).create("DurableClientReconnectDUnitTestPool");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setPoolName(p.getName());
RegionAttributes attrs = factory.createRegionAttributes();
cache.createRegion(REGION_NAME, attrs);
pool = p;
createEntriesK1andK2();
registerK1AndK2();
}
use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.
the class Bug36457DUnitTest method setClientServerObserver.
public static void setClientServerObserver() {
PoolImpl.AFTER_PRIMARY_IDENTIFICATION_FROM_BACKUP_CALLBACK_FLAG = true;
ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
public void afterPrimaryIdentificationFromBackup(ServerLocation primaryEndpoint) {
LogWriterUtils.getLogWriter().fine("TEST FAILED HERE YOGI ");
isFaileoverHappened = true;
}
});
}
use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.
the class ClientConflationDUnitTest method setClientServerObserverForBeforeInterestRecovery.
/**
* reset all counters to zero before interest recovery
*
*/
public static void setClientServerObserverForBeforeInterestRecovery() {
PoolImpl.BEFORE_RECOVER_INTEREST_CALLBACK_FLAG = true;
ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
public void beforeInterestRecovery() {
setAllCountersZero();
}
});
}
use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.
the class DSObjectLocalOnly method setClientServerObserver1.
public static void setClientServerObserver1() {
PoolImpl.IS_INSTANTIATOR_CALLBACK = true;
ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
@Override
public void beforeSendingToServer(EventID eventID) {
eventId = eventID;
client2.invoke(() -> DataSerializerPropogationDUnitTest.setEventId(eventID));
}
});
}
use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.
the class DSObjectLocalOnly method setClientServerObserver2.
public static void setClientServerObserver2() {
PoolImpl.IS_INSTANTIATOR_CALLBACK = true;
ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
@Override
public void afterReceivingFromServer(EventID eventID) {
testEventIDResult = eventID.equals(eventId);
}
});
}
Aggregations