Top Description Methods
net.sf.ehcache.pool

public Interface Pool

Known Direct Implementers
net.sf.ehcache.pool.impl.AbstractPool, net.sf.ehcache.pool.impl.UnboundedPool
Imports
java.util.Collection

Pools are used to track shared resource consumption. Each store participating in a pool creates an accessor which it uses to tell the pool about its consumption. A SizeOf engine is used to calculate the size of the objects added to the pool.
Authors
Ludovic Orban, Alex Snaps

Method Summary

Modifier and TypeMethod and Description
public PoolAccessor<T extends PoolParticipant>

Returns:

a PoolAccessor whose consumption is tracked by this pool.
createPoolAccessor
(PoolParticipant
the participant which will use the created accessor.
participant
,
int
maximum depth of the object graph to traverse
maxDepth
,
boolean
true if the object traversal should be aborted when the max depth is exceeded
abortWhenMaxDepthExceeded
)

Return a PoolAccessor whose consumption is tracked by this pool, using a default SizeOf engine.

public PoolAccessor<T extends PoolParticipant>

Returns:

a PoolAccessor whose consumption is tracked by this pool.
createPoolAccessor
(PoolParticipant
the participant which will use the created accessor.
participant
,
SizeOfEngine
the SizeOf engine used to measure the size of objects added through the created accessor.
sizeOfEngine
)

Return a PoolAccessor whose consumption is tracked by this pool, using a specific SizeOf engine.

public PoolEvictor<T extends PoolParticipant>

Returns:

the pool evictor
getEvictor
()

Return the pool evictor used by this pool.

public long

Returns:

the maximum size of the pool.
getMaxSize
()

Return the maximum size of the pool.

public Collection<PoolAccessor<T extends PoolParticipant>>

Returns:

participants using this pool
getPoolAccessors
()

Return the participants accessing this pool.

public long

Returns:

used size of the pool.
getSize
()

Return the used size of the pool.

public void
registerPoolAccessor(PoolAccessor<T extends PoolParticipant>
accessor to be registered
accessor
)

Register an accessor implementation with this pool.

public void
removePoolAccessor(PoolAccessor<T extends PoolParticipant>
accessor to be removed
accessor
)

Remove the supplied accessor from this pool.

public void
setMaxSize(long
the new pool size.
newSize
)

Change the maximum size of the pool.

Method Detail

createPoolAccessorback to summary
public PoolAccessor<T extends PoolParticipant> createPoolAccessor(PoolParticipant participant, int maxDepth, boolean abortWhenMaxDepthExceeded)

Return a PoolAccessor whose consumption is tracked by this pool, using a default SizeOf engine.

Parameters
participant:PoolParticipant

the participant which will use the created accessor.

maxDepth:int

maximum depth of the object graph to traverse

abortWhenMaxDepthExceeded:boolean

true if the object traversal should be aborted when the max depth is exceeded

Returns:PoolAccessor<T extends PoolParticipant>

a PoolAccessor whose consumption is tracked by this pool.

createPoolAccessorback to summary
public PoolAccessor<T extends PoolParticipant> createPoolAccessor(PoolParticipant participant, SizeOfEngine sizeOfEngine)

Return a PoolAccessor whose consumption is tracked by this pool, using a specific SizeOf engine.

Parameters
participant:PoolParticipant

the participant which will use the created accessor.

sizeOfEngine:SizeOfEngine

the SizeOf engine used to measure the size of objects added through the created accessor.

Returns:PoolAccessor<T extends PoolParticipant>

a PoolAccessor whose consumption is tracked by this pool.

getEvictorback to summary
public PoolEvictor<T extends PoolParticipant> getEvictor()

Return the pool evictor used by this pool.

Returns:PoolEvictor<T extends PoolParticipant>

the pool evictor

getMaxSizeback to summary
public long getMaxSize()

Return the maximum size of the pool.

Returns:long

the maximum size of the pool.

getPoolAccessorsback to summary
public Collection<PoolAccessor<T extends PoolParticipant>> getPoolAccessors()

Return the participants accessing this pool.

Returns:Collection<PoolAccessor<T extends PoolParticipant>>

participants using this pool

getSizeback to summary
public long getSize()

Return the used size of the pool.

Returns:long

used size of the pool.

registerPoolAccessorback to summary
public void registerPoolAccessor(PoolAccessor<T extends PoolParticipant> accessor)

Register an accessor implementation with this pool.

Parameters
accessor:PoolAccessor<T extends PoolParticipant>

accessor to be registered

removePoolAccessorback to summary
public void removePoolAccessor(PoolAccessor<T extends PoolParticipant> accessor)

Remove the supplied accessor from this pool.

Parameters
accessor:PoolAccessor<T extends PoolParticipant>

accessor to be removed

setMaxSizeback to summary
public void setMaxSize(long newSize)

Change the maximum size of the pool.

Parameters
newSize:long

the new pool size.