GemFire 7.0

com.gemstone.gemfire.cache
Interface InterestRegistrationListener

All Superinterfaces:
CacheCallback

public interface InterestRegistrationListener
extends CacheCallback

Interface InterestRegisterationListener provides the ability for applications to be notified of interest registration and unregistration events. Instances must be implemented by applications and registered in CacheServer VMs using the registerInterestRegistrationListener API. The methods on an InterestRegisterationListener are invoked synchronously with the interest event in any CacheServer VM hosting the requesting client's subscriptions.

Shown below is an example implementation.

import com.gemstone.gemfire.cache.InterestRegistrationEvent;
import com.gemstone.gemfire.cache.InterestRegistrationListener;

public class TestInterestRegistrationListener implements InterestRegistrationListener {

  public void afterRegisterInterest(InterestRegistrationEvent event) {
    System.out.println("afterRegisterInterest: " + event.getRegionName() + " -> " + event.getKeysOfInterest());
  }

  public void afterUnregisterInterest(InterestRegistrationEvent event) {
    System.out.println("afterUnregisterInterest: " + event.getRegionName() + " -> " + event.getKeysOfInterest());
  }

  public void close() {}
}
 
Shown below is an example registration.
private void registerInterestRegistrationListener() {
  Cache cache = ...;
  CacheServer cs = cache.getCacheServers().iterator().next();
  InterestRegistrationListener listener = new TestInterestRegistrationListener();
  cs.registerInterestRegistrationListener(listener);
}
 

Since:
6.0
See Also:
registerInterestRegistrationListener, unregisterInterestRegistrationListener
Note: Early Access. Please consult GemStone technical support for assistance with this functionality.

Method Summary
 void afterRegisterInterest(InterestRegistrationEvent event)
          Handles an after register interest event.
 void afterUnregisterInterest(InterestRegistrationEvent event)
          Handles an after unregister interest event.
 
Methods inherited from interface com.gemstone.gemfire.cache.CacheCallback
close
 

Method Detail

afterRegisterInterest

void afterRegisterInterest(InterestRegistrationEvent event)
Handles an after register interest event.

Parameters:
event - the InterestRegistrationEvent

afterUnregisterInterest

void afterUnregisterInterest(InterestRegistrationEvent event)
Handles an after unregister interest event.

Parameters:
event - the InterestRegistrationEvent

GemFire 7.0

Copyright © 1997-2012 VMware, Inc. All rights reserved.