|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.icegem.expiration.ExpirationController
public class ExpirationController
The class which can expire region entries using custom policy (strategy).
Example:
RegiondataRegion = ...; Region errorsRegion = ...; ExpirationController expirationController = new ExpirationController(); long destroyedEntriesNumberForData = expirationController.process(dataRegion, new ExpirationPolicy() { public boolean isExpired(Entry<Object, Object> entry) { // TODO: Add some logic return false; } }); long destroyedEntriesNumberForErrors = expirationController.process(errorsRegion, new ExpirationPolicy() { public boolean isExpired(Entry<Object, Object> entry) { // TODO: Add some logic return false; } });
You can get access to the other regions inside of
isExpired(Entry<Object, Object>) method in the following
way:
new ExpirationPolicy() {
public boolean isExpired(Entry<Object, Object> entry) {
RegionService regionService = entry.getRegion().getRegionService();
Region errorsRegion = regionService.getRegion("errors");
// TODO: Add some logic
return false;
}
});
| Constructor Summary | |
|---|---|
ExpirationController()
|
|
| Method Summary | |
|---|---|
long |
getPacketDelay()
Gets the delay in processing after the packetSize entries, milliseconds |
long |
getPacketSize()
Gets the size of the consistently expired entries packet |
long |
process(com.gemstone.gemfire.cache.Region<?,?> region,
ExpirationPolicy policy)
Applies the specified policy on the specified region and returns number of destroyed entries. |
void |
setPacketDelay(long packetDelay)
Sets the delay in processing after the packetSize entries, milliseconds |
void |
setPacketSize(long packetSize)
Gets the size of the consistently expired entries packet |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExpirationController()
| Method Detail |
|---|
public long getPacketSize()
public void setPacketSize(long packetSize)
packetSize - - the packet sizepublic long getPacketDelay()
public void setPacketDelay(long packetDelay)
packetDelay - - the packet delay
public long process(com.gemstone.gemfire.cache.Region<?,?> region,
ExpirationPolicy policy)
region - - the regionpolicy - - the expiration policy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||