Package org.apache.commons.pool2.impl
Class DefaultPooledObjectInfo
java.lang.Object
org.apache.commons.pool2.impl.DefaultPooledObjectInfo
- All Implemented Interfaces:
DefaultPooledObjectInfoMBean
Implementation of object that is used to provide information on pooled
objects via JMX.
- Since:
- 2.0
-
Constructor Summary
ConstructorDescriptionDefaultPooledObjectInfo
(PooledObject<?> pooledObject) Constructs a new instance for the given pooled object. -
Method Summary
Modifier and TypeMethodDescriptionlong
Gets the number of times this object has been borrowed.long
Gets the time (using the same basis asClock.instant()
) that pooled object was created.Gets the time that pooled object was created.long
Gets the time (using the same basis asClock.instant()
) the polled object was last borrowed.Gets the time that pooled object was last borrowed.Gets the stack trace recorded when the pooled object was last borrowed.long
Gets the time (using the same basis asClock.instant()
)the wrapped object was last returned.Gets the time that pooled object was last returned.Gets a String form of the wrapper for debug purposes.Gets the name of the class of the pooled object.toString()
-
Constructor Details
-
DefaultPooledObjectInfo
Constructs a new instance for the given pooled object.- Parameters:
pooledObject
- The pooled object that this instance will represent- Throws:
NullPointerException
- ifobj
isnull
-
-
Method Details
-
getBorrowedCount
Description copied from interface:DefaultPooledObjectInfoMBean
Gets the number of times this object has been borrowed.- Specified by:
getBorrowedCount
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- The number of times this object has been borrowed.
-
getCreateTime
Description copied from interface:DefaultPooledObjectInfoMBean
Gets the time (using the same basis asClock.instant()
) that pooled object was created.- Specified by:
getCreateTime
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- The creation time for the pooled object.
-
getCreateTimeFormatted
Description copied from interface:DefaultPooledObjectInfoMBean
Gets the time that pooled object was created.- Specified by:
getCreateTimeFormatted
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- The creation time for the pooled object formatted as
yyyy-MM-dd HH:mm:ss Z
.
-
getLastBorrowTime
Description copied from interface:DefaultPooledObjectInfoMBean
Gets the time (using the same basis asClock.instant()
) the polled object was last borrowed.- Specified by:
getLastBorrowTime
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- The time the pooled object was last borrowed.
-
getLastBorrowTimeFormatted
Description copied from interface:DefaultPooledObjectInfoMBean
Gets the time that pooled object was last borrowed.- Specified by:
getLastBorrowTimeFormatted
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- The last borrowed time for the pooled object formatted as
yyyy-MM-dd HH:mm:ss Z
.
-
getLastBorrowTrace
Description copied from interface:DefaultPooledObjectInfoMBean
Gets the stack trace recorded when the pooled object was last borrowed.- Specified by:
getLastBorrowTrace
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- The stack trace showing which code last borrowed the pooled object.
-
getLastReturnTime
Description copied from interface:DefaultPooledObjectInfoMBean
Gets the time (using the same basis asClock.instant()
)the wrapped object was last returned.- Specified by:
getLastReturnTime
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- The time the object was last returned.
-
getLastReturnTimeFormatted
Description copied from interface:DefaultPooledObjectInfoMBean
Gets the time that pooled object was last returned.- Specified by:
getLastReturnTimeFormatted
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- The last returned time for the pooled object formatted as
yyyy-MM-dd HH:mm:ss Z
.
-
getPooledObjectToString
Description copied from interface:DefaultPooledObjectInfoMBean
Gets a String form of the wrapper for debug purposes. The format is not fixed and may change at any time.- Specified by:
getPooledObjectToString
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- A string representation of the pooled object.
- See Also:
-
getPooledObjectType
Description copied from interface:DefaultPooledObjectInfoMBean
Gets the name of the class of the pooled object.- Specified by:
getPooledObjectType
in interfaceDefaultPooledObjectInfoMBean
- Returns:
- The pooled object's class name.
- See Also:
-
toString
-