Class DefaultPooledObjectInfo
java.lang.Object
org.apache.tomcat.dbcp.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
ConstructorsConstructorDescriptionDefaultPooledObjectInfo(PooledObject<?> pooledObject) Create a new instance for the given pooled object. -
Method Summary
Modifier and TypeMethodDescriptionlongGet the number of times this object has been borrowed.longObtain the time (using the same basis asSystem.currentTimeMillis()) that pooled object was created.Obtain the time that pooled object was created.longObtain the time (using the same basis asSystem.currentTimeMillis()) the polled object was last borrowed.Obtain the time that pooled object was last borrowed.Obtain the stack trace recorded when the pooled object was last borrowed.longObtain the time (using the same basis asSystem.currentTimeMillis())the wrapped object was last returned.Obtain the time that pooled object was last returned.Provides a String form of the wrapper for debug purposes.Obtain the name of the class of the pooled object.toString()
-
Constructor Details
-
DefaultPooledObjectInfo
Create a new instance for the given pooled object.- Parameters:
pooledObject- The pooled object that this instance will represent
-
-
Method Details
-
getCreateTime
public long getCreateTime()Description copied from interface:DefaultPooledObjectInfoMBeanObtain the time (using the same basis asSystem.currentTimeMillis()) that pooled object was created.- Specified by:
getCreateTimein interfaceDefaultPooledObjectInfoMBean- Returns:
- The creation time for the pooled object
-
getCreateTimeFormatted
Description copied from interface:DefaultPooledObjectInfoMBeanObtain the time that pooled object was created.- Specified by:
getCreateTimeFormattedin interfaceDefaultPooledObjectInfoMBean- Returns:
- The creation time for the pooled object formatted as
yyyy-MM-dd HH:mm:ss Z
-
getLastBorrowTime
public long getLastBorrowTime()Description copied from interface:DefaultPooledObjectInfoMBeanObtain the time (using the same basis asSystem.currentTimeMillis()) the polled object was last borrowed.- Specified by:
getLastBorrowTimein interfaceDefaultPooledObjectInfoMBean- Returns:
- The time the pooled object was last borrowed
-
getLastBorrowTimeFormatted
Description copied from interface:DefaultPooledObjectInfoMBeanObtain the time that pooled object was last borrowed.- Specified by:
getLastBorrowTimeFormattedin interfaceDefaultPooledObjectInfoMBean- Returns:
- The last borrowed time for the pooled object formatted as
yyyy-MM-dd HH:mm:ss Z
-
getLastBorrowTrace
Description copied from interface:DefaultPooledObjectInfoMBeanObtain the stack trace recorded when the pooled object was last borrowed.- Specified by:
getLastBorrowTracein interfaceDefaultPooledObjectInfoMBean- Returns:
- The stack trace showing which code last borrowed the pooled object
-
getLastReturnTime
public long getLastReturnTime()Description copied from interface:DefaultPooledObjectInfoMBeanObtain the time (using the same basis asSystem.currentTimeMillis())the wrapped object was last returned.- Specified by:
getLastReturnTimein interfaceDefaultPooledObjectInfoMBean- Returns:
- The time the object was last returned
-
getLastReturnTimeFormatted
Description copied from interface:DefaultPooledObjectInfoMBeanObtain the time that pooled object was last returned.- Specified by:
getLastReturnTimeFormattedin interfaceDefaultPooledObjectInfoMBean- Returns:
- The last returned time for the pooled object formatted as
yyyy-MM-dd HH:mm:ss Z
-
getPooledObjectType
Description copied from interface:DefaultPooledObjectInfoMBeanObtain the name of the class of the pooled object.- Specified by:
getPooledObjectTypein interfaceDefaultPooledObjectInfoMBean- Returns:
- The pooled object's class name
- See Also:
-
getPooledObjectToString
Description copied from interface:DefaultPooledObjectInfoMBeanProvides a String form of the wrapper for debug purposes. The format is not fixed and may change at any time.- Specified by:
getPooledObjectToStringin interfaceDefaultPooledObjectInfoMBean- Returns:
- A string representation of the pooled object
- See Also:
-
getBorrowedCount
public long getBorrowedCount()Description copied from interface:DefaultPooledObjectInfoMBeanGet the number of times this object has been borrowed.- Specified by:
getBorrowedCountin interfaceDefaultPooledObjectInfoMBean- Returns:
- The number of times this object has been borrowed.
-
toString
-