PartitionListenerAdapter (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.cache.partition, class: PartitionListenerAdapter

Package org.apache.geode.cache.partition

# Class PartitionListenerAdapter

java.lang.Object
org.apache.geode.cache.partition.PartitionListenerAdapter

All Implemented Interfaces:
  `PartitionListener`

public class PartitionListenerAdapter extends Object implements PartitionListener

Utility class that implements all methods in `PartitionListener` with empty implementations. Applications can subclass this class and only override the methods of interest.

Subclasses declared in a Cache XML file, it must also implement `Declarable`

Note : Please request help on the Geode developer mailing list (dev@geode.apache.org) before using these APIs.

Since:
  GemFire 6.6.2

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PartitionListenerAdapter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterBucketCreated(int bucketId, Iterable<?> keys)`
  Callback invoked after a bucket has been created in a member (e.g.
  `void`
  `afterBucketRemoved(int bucketId, Iterable<?> keys)`
  Callback invoked after a bucket has been removed from a member (e.g.
  `void`
  `afterPrimary(int bucketId)`
  Callback invoked when any bucket in a partitioned region becomes primary
  `void`
  `afterRegionCreate(Region<?,?> region)`
  Callback invoked when a partition region is created

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.geode.cache.partition.PartitionListener

  `afterSecondary`

- ## Constructor Details

  - ### PartitionListenerAdapter

    public PartitionListenerAdapter()

- ## Method Details

  - ### afterPrimary

    public void afterPrimary(int bucketId)
    Description copied from interface: `PartitionListener`
    Callback invoked when any bucket in a partitioned region becomes primary
    Specified by:
      `afterPrimary` in interface `PartitionListener`
    Parameters:
      `bucketId` - id of the bucket which became primary

  - ### afterRegionCreate

    public void afterRegionCreate(Region<?,?> region)
    Description copied from interface: `PartitionListener`
    Callback invoked when a partition region is created
    Specified by:
      `afterRegionCreate` in interface `PartitionListener`
    Parameters:
      `region` - handle of the region which is created

  - ### afterBucketRemoved

    public void afterBucketRemoved(int bucketId, Iterable<?> keys)
    Description copied from interface: `PartitionListener`
    Callback invoked after a bucket has been removed from a member (e.g. during rebalancing). This API is useful for maintaining external data structures by bucket id or key.
    Specified by:
      `afterBucketRemoved` in interface `PartitionListener`
    Parameters:
      `bucketId` - id of the bucket removed
      `keys` - keys in the bucket removed

  - ### afterBucketCreated

    public void afterBucketCreated(int bucketId, Iterable<?> keys)
    Description copied from interface: `PartitionListener`
    Callback invoked after a bucket has been created in a member (e.g. during rebalancing). This API is useful for maintaining external data structures by bucket id or key. Note that this API is invoked after the initial image has been completed so creates and destroys may occur in the keys. It is best to use this API during periods of no cache activity.
    Specified by:
      `afterBucketCreated` in interface `PartitionListener`
    Parameters:
      `bucketId` - id of the bucket created
      `keys` - keys in the bucket created