Package org.eclipse.emf.cdo.spi.server
Class StoreAccessorPool
java.lang.Object
org.eclipse.emf.cdo.spi.server.StoreAccessorPool
Reuses passivated store accessors managed by an
IStore. A pool may be shared or scoped to a session or view;
checkout restores the accessor's active context, while excess or unusable accessors are deactivated.- Since:
- 2.0
- Author:
- Eike Stepper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStoreAccessor(StoreAccessorBase accessor) Passivates the givenstore accessorand adds it to this pool if the pool size is smaller than thecapacity, or disposes of the store accessor otherwise.voiddispose()Deactivates all containedstore accessorsand clears this pool.protected voiddisposeStoreAccessor(StoreAccessorBase accessor) intgetStore()removeStoreAccessor(Object context) Returns astore accessorfrom this pool if one is available, ornullotherwise.protected voidretainStoreAccessors(int targetSize) voidsetCapacity(int capacity)
-
Field Details
-
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITY- Since:
- 4.2
- See Also:
-
-
Constructor Details
-
StoreAccessorPool
-
-
Method Details
-
getStore
-
getContext
-
getCapacity
public int getCapacity()- Since:
- 4.2
-
setCapacity
public void setCapacity(int capacity) - Since:
- 4.2
-
addStoreAccessor
Passivates the givenstore accessorand adds it to this pool if the pool size is smaller than thecapacity, or disposes of the store accessor otherwise.- Since:
- 4.0
-
removeStoreAccessor
Returns astore accessorfrom this pool if one is available, ornullotherwise. If a store accessor is available it is removed from this pool and its unpassivate method is called.- Since:
- 4.0
-
dispose
public void dispose()Deactivates all containedstore accessorsand clears this pool. -
retainStoreAccessors
protected void retainStoreAccessors(int targetSize) - Since:
- 4.2
-
disposeStoreAccessor
- Since:
- 4.2
-