Top Description Methods
reactor.pool

public Interface PooledRefMetadata

Known Direct Implementers
reactor.pool.AbstractPool.AbstractPooledRef
Imports
java.util.function.Function

Metadata about a PooledRef, which includes monotonic metrics like its age (lifeTime()), number of times it was reused (acquireCount()), as well as contextually changing metrics like the duration for which it has been idle in a pool (idleTime()).
Author
Simon Baslé

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of times this object has been used by consumers of the pool
acquireCount
()

Return the number of times the underlying pooled object has been used by consumers of the Pool, via either of Pool#acquire() or Pool#withPoolable(Function).

public long

Returns:

the creation timestamp
allocationTimestamp
()

Return a timestamp that denotes the order in which the PooledRef was created/allocated, or an equivalently totally-ordered positive number that can be used to compare in which order two references have been created (unless created within the same millisecond).

public long

Returns:

the wall-clock number of milliseconds since the reference was last released (or allocated, if it was never released)
idleTime
()

Returns the wall-clock number of milliseconds since the reference was last released (or allocated, if it was never released).

public long

Returns:

the wall-clock age (time since allocation) of the underlying object in milliseconds
lifeTime
()

Returns the age of the PooledRef: the wall-clock time (in milliseconds) since which the underlying object has been allocated.

public long

Returns:

the last release timestamp, or zero if currently acquired
releaseTimestamp
()

Return a timestamp that denotes the order in which the PooledRef was last released, or an equivalently totally-ordered positive number that can be used to compare in which order two references have been released (unless released within the same millisecond).

Method Detail

acquireCountback to summary
public int acquireCount()

Return the number of times the underlying pooled object has been used by consumers of the Pool, via either of Pool#acquire() or Pool#withPoolable(Function). The first time an object is allocated, this method returns 1, so the number of times it has been "recycled" can be deduced as acquireCount() - 1.

Returns:int

the number of times this object has been used by consumers of the pool

allocationTimestampback to summary
public long allocationTimestamp()

Return a timestamp that denotes the order in which the PooledRef was created/allocated, or an equivalently totally-ordered positive number that can be used to compare in which order two references have been created (unless created within the same millisecond).

Returns:long

the creation timestamp

idleTimeback to summary
public long idleTime()

Returns the wall-clock number of milliseconds since the reference was last released (or allocated, if it was never released). Can be used on resources that are not currently acquired to detect idle resources. A PooledRef that is currently acquired is required to return 0L.

Returns:long

the wall-clock number of milliseconds since the reference was last released (or allocated, if it was never released)

lifeTimeback to summary
public long lifeTime()

Returns the age of the PooledRef: the wall-clock time (in milliseconds) since which the underlying object has been allocated.

Returns:long

the wall-clock age (time since allocation) of the underlying object in milliseconds

releaseTimestampback to summary
public long releaseTimestamp()

Return a timestamp that denotes the order in which the PooledRef was last released, or an equivalently totally-ordered positive number that can be used to compare in which order two references have been released (unless released within the same millisecond). If the PooledRef is currently acquired and held outside the pool, returns zero instead.

Returns:long

the last release timestamp, or zero if currently acquired