Search in sources :

Example 16 with ClientServerObserverAdapter

use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.

the class ClientServerForceInvalidateDUnitTest method cleanupObserver.

private static void cleanupObserver() {
    CacheClientProxy.AFTER_MESSAGE_CREATION_FLAG = false;
    ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter());
}
Also used : ClientServerObserverAdapter(org.apache.geode.internal.cache.ClientServerObserverAdapter)

Example 17 with ClientServerObserverAdapter

use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.

the class DurableClientTestCase method setBridgeObeserverForAfterPrimaryRecovered.

public static void setBridgeObeserverForAfterPrimaryRecovered() {
    DurableClientTestCase.isPrimaryRecovered = false;
    PoolImpl.AFTER_PRIMARY_RECOVERED_CALLBACK_FLAG = true;
    ClientServerObserver bo = ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {

        public void afterPrimaryRecovered(ServerLocation location) {
            DurableClientTestCase.isPrimaryRecovered = true;
            PoolImpl.AFTER_PRIMARY_RECOVERED_CALLBACK_FLAG = false;
        }
    });
}
Also used : ClientServerObserver(org.apache.geode.internal.cache.ClientServerObserver) ServerLocation(org.apache.geode.distributed.internal.ServerLocation) ClientServerObserverAdapter(org.apache.geode.internal.cache.ClientServerObserverAdapter)

Example 18 with ClientServerObserverAdapter

use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.

the class HASlowReceiverDUnitTest method setBridgeObeserverForAfterQueueDestroyMessage.

public static void setBridgeObeserverForAfterQueueDestroyMessage() throws Exception {
    PoolImpl.AFTER_QUEUE_DESTROY_MESSAGE_FLAG = true;
    ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {

        @Override
        public void afterQueueDestroyMessage() {
            clientVM.invoke(() -> HASlowReceiverDUnitTest.checkRedundancyLevel(new Integer(0)));
            isUnresponsiveClientRemoved = true;
            PoolImpl.AFTER_QUEUE_DESTROY_MESSAGE_FLAG = false;
        }
    });
}
Also used : ClientServerObserverAdapter(org.apache.geode.internal.cache.ClientServerObserverAdapter)

Example 19 with ClientServerObserverAdapter

use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.

the class HAInterestTestCase method setClientServerObserverForAfterRegistration.

public static void setClientServerObserverForAfterRegistration(final VM vm) {
    PoolImpl.AFTER_REGISTER_CALLBACK_FLAG = true;
    ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {

        public void afterInterestRegistration() {
            synchronized (HAInterestTestCase.class) {
                vm.invoke(() -> HAInterestTestCase.startServer());
                HAInterestTestCase.isAfterRegistrationCallbackCalled = true;
                HAInterestTestCase.class.notify();
                PoolImpl.AFTER_REGISTER_CALLBACK_FLAG = false;
            }
        }
    });
}
Also used : ClientServerObserverAdapter(org.apache.geode.internal.cache.ClientServerObserverAdapter)

Example 20 with ClientServerObserverAdapter

use of org.apache.geode.internal.cache.ClientServerObserverAdapter in project geode by apache.

the class HAStartupAndFailoverDUnitTest method unSetClientServerObserver.

public static void unSetClientServerObserver() {
    synchronized (HAStartupAndFailoverDUnitTest.class) {
        PoolImpl.AFTER_PRIMARY_IDENTIFICATION_FROM_BACKUP_CALLBACK_FLAG = false;
        HAStartupAndFailoverDUnitTest.identifiedPrimary = false;
        ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter());
    }
}
Also used : ClientServerObserverAdapter(org.apache.geode.internal.cache.ClientServerObserverAdapter)

Aggregations

ClientServerObserverAdapter (org.apache.geode.internal.cache.ClientServerObserverAdapter)22 ServerLocation (org.apache.geode.distributed.internal.ServerLocation)5 EventID (org.apache.geode.internal.cache.EventID)4 Region (org.apache.geode.cache.Region)2 ClientServerObserver (org.apache.geode.internal.cache.ClientServerObserver)2 ClientSubscriptionTest (org.apache.geode.test.junit.categories.ClientSubscriptionTest)2 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 Properties (java.util.Properties)1 AttributesFactory (org.apache.geode.cache.AttributesFactory)1 RegionAttributes (org.apache.geode.cache.RegionAttributes)1 PoolImpl (org.apache.geode.cache.client.internal.PoolImpl)1 CacheSerializableRunnable (org.apache.geode.cache30.CacheSerializableRunnable)1 ConfigurationProperties (org.apache.geode.distributed.ConfigurationProperties)1 LocalRegion (org.apache.geode.internal.cache.LocalRegion)1 IgnoredException (org.apache.geode.test.dunit.IgnoredException)1