public class StoreAccessorPool extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CAPACITY |
Constructor and Description |
---|
StoreAccessorPool(IStore store,
Object context) |
Modifier and Type | Method and Description |
---|---|
void |
addStoreAccessor(StoreAccessorBase storeAccessor)
Passivates the given
store accessor and adds it to this pool if the pool size is smaller than the capacity ,
or disposes of the store accessor otherwise. |
void |
dispose()
Deactivates all contained
store accessors and clears this pool. |
protected void |
disposeStoreAccessor(StoreAccessorBase accessor) |
int |
getCapacity() |
Object |
getContext() |
IStore |
getStore() |
StoreAccessorBase |
removeStoreAccessor(Object context)
Returns a
store accessor from this pool if one is available, or null otherwise. |
protected void |
retainStoreAccessors(int targetSize) |
void |
setCapacity(int capacity) |
public static final int DEFAULT_CAPACITY
public IStore getStore()
public Object getContext()
public int getCapacity()
public void setCapacity(int capacity)
public void addStoreAccessor(StoreAccessorBase storeAccessor)
store accessor
and adds it to this pool if the pool size is smaller than the capacity
,
or disposes of the store accessor otherwise.public StoreAccessorBase removeStoreAccessor(Object context)
store accessor
from this pool if one is available, or null
otherwise.
If a store accessor is available it is removed from this pool and its unpassivate method is called.public void dispose()
store accessors
and clears this pool.protected void retainStoreAccessors(int targetSize)
protected void disposeStoreAccessor(StoreAccessorBase accessor)
Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.