Search in sources :

Example 21 with ClientServerObserverAdapter

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

the class TestObject20 method setClientServerObserver1.

public static void setClientServerObserver1() {
    PoolImpl.IS_INSTANTIATOR_CALLBACK = true;
    ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {

        public void beforeSendingToServer(EventID eventID) {
            eventId = eventID;
            System.out.println("client2= " + client2 + " eventid= " + eventID);
            client2.invoke(() -> InstantiatorPropagationDUnitTest.setEventId(eventId));
        }
    });
}
Also used : EventID(org.apache.geode.internal.cache.EventID) ClientServerObserverAdapter(org.apache.geode.internal.cache.ClientServerObserverAdapter)

Example 22 with ClientServerObserverAdapter

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

the class TestObject20 method setClientServerObserver2.

public static void setClientServerObserver2() {
    PoolImpl.IS_INSTANTIATOR_CALLBACK = true;
    ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {

        public void afterReceivingFromServer(EventID eventID) {
            System.out.println("Observer2 received " + eventID + "; my eventID is " + eventId);
            testEventIDResult = eventID.equals(eventId);
        }
    });
}
Also used : EventID(org.apache.geode.internal.cache.EventID) 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