|
Apache Tomcat 7.0.23 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tomcat.jdbc.pool.JdbcInterceptor
org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor
org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport
org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport
org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx
public class SlowQueryReportJmx
Publishes data to JMX and provides notifications when failures happen.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport |
---|
SlowQueryReport.QueryStats |
Nested classes/interfaces inherited from class org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport |
---|
AbstractQueryReport.StatementProxy |
Field Summary | |
---|---|
static java.lang.String |
FAILED_QUERY_NOTIFICATION
|
protected static java.util.concurrent.ConcurrentHashMap<java.lang.String,SlowQueryReportJmxMBean> |
mbeans
|
protected javax.management.NotificationBroadcasterSupport |
notifier
|
protected boolean |
notifyPool
|
protected static java.util.concurrent.atomic.AtomicLong |
notifySequence
|
protected ConnectionPool |
pool
|
protected java.lang.String |
poolName
|
static java.lang.String |
SLOW_QUERY_NOTIFICATION
|
protected static javax.management.openmbean.CompositeType |
SLOW_QUERY_TYPE
|
Fields inherited from class org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport |
---|
maxQueries, perPoolStats, queries |
Fields inherited from class org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport |
---|
constructors, threshold |
Fields inherited from class org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor |
---|
CREATE_STATEMENT, CREATE_STATEMENT_IDX, EXECUTE, EXECUTE_BATCH, EXECUTE_QUERY, EXECUTE_TYPES, EXECUTE_UPDATE, PREPARE_CALL, PREPARE_CALL_IDX, PREPARE_STATEMENT, PREPARE_STATEMENT_IDX, STATEMENT_TYPE_COUNT, STATEMENT_TYPES |
Fields inherited from class org.apache.tomcat.jdbc.pool.JdbcInterceptor |
---|
CLOSE_VAL, GETCONNECTION_VAL, ISCLOSED_VAL, ISWRAPPERFOR_VAL, properties, TOSTRING_VAL, UNWRAP_VAL |
Constructor Summary | |
---|---|
SlowQueryReportJmx()
|
Method Summary | |
---|---|
void |
addNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
|
protected void |
deregisterJmx()
|
protected static javax.management.openmbean.CompositeType |
getCompositeType()
|
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
|
static javax.management.ObjectName |
getObjectName(java.lang.Class<?> clazz,
java.lang.String poolName)
|
java.lang.String |
getPoolName()
JMX operation - return the name of the pool |
java.lang.String[] |
getPoolNames()
JMX operation - return the names of all the pools |
javax.management.openmbean.CompositeData[] |
getSlowQueriesCD()
JMX operation - returns all the queries we have collected. |
boolean |
isNotifyPool()
|
protected void |
notifyJmx(java.lang.String query,
java.lang.String type)
|
void |
poolClosed(ConnectionPool pool)
This method is invoked by a connection pool when the pool is closed. |
void |
poolStarted(ConnectionPool pool)
This method is invoked by a connection pool when the pool is first started up, usually when the first connection is requested. |
protected void |
registerJmx()
|
void |
removeNotificationListener(javax.management.NotificationListener listener)
|
void |
removeNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
|
protected java.lang.String |
reportFailedQuery(java.lang.String query,
java.lang.Object[] args,
java.lang.String name,
long start,
java.lang.Throwable t)
Invoked when a query execution, a call to execute/executeQuery or executeBatch failed. |
protected java.lang.String |
reportSlowQuery(java.lang.String query,
java.lang.Object[] args,
java.lang.String name,
long start,
long delta)
Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was exceeded the timing threshold |
void |
reset(ConnectionPool parent,
PooledConnection con)
no-op for this interceptor. no state is stored. |
void |
resetStats()
JMX operation - remove all stats for this connection pool |
void |
setNotifyPool(boolean notifyPool)
|
void |
setProperties(java.util.Map<java.lang.String,PoolProperties.InterceptorProperty> properties)
Called during the creation of an interceptor The properties can be set during the configuration of an interceptor Override this method to perform type casts between string values and object properties |
Methods inherited from class org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport |
---|
closeInvoked, getPoolStats, getQueryStats, prepareCall, prepareStatement, removeOldest, setMaxQueries |
Methods inherited from class org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport |
---|
createStatement, getConstructor, getThreshold, reportQuery, setThreshold |
Methods inherited from class org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor |
---|
invoke, isExecute, isStatement, process |
Methods inherited from class org.apache.tomcat.jdbc.pool.JdbcInterceptor |
---|
compare, compare, disconnected, getNext, getProperties, isUseEquals, setNext, setUseEquals |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SLOW_QUERY_NOTIFICATION
public static final java.lang.String FAILED_QUERY_NOTIFICATION
protected static javax.management.openmbean.CompositeType SLOW_QUERY_TYPE
protected static java.util.concurrent.ConcurrentHashMap<java.lang.String,SlowQueryReportJmxMBean> mbeans
protected volatile javax.management.NotificationBroadcasterSupport notifier
protected java.lang.String poolName
protected static java.util.concurrent.atomic.AtomicLong notifySequence
protected boolean notifyPool
protected ConnectionPool pool
Constructor Detail |
---|
public SlowQueryReportJmx()
Method Detail |
---|
public void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback) throws java.lang.IllegalArgumentException
addNotificationListener
in interface javax.management.NotificationBroadcaster
java.lang.IllegalArgumentException
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface javax.management.NotificationBroadcaster
public void removeNotificationListener(javax.management.NotificationListener listener) throws javax.management.ListenerNotFoundException
removeNotificationListener
in interface javax.management.NotificationBroadcaster
javax.management.ListenerNotFoundException
public void removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback) throws javax.management.ListenerNotFoundException
removeNotificationListener
in interface javax.management.NotificationEmitter
javax.management.ListenerNotFoundException
protected static javax.management.openmbean.CompositeType getCompositeType()
public void reset(ConnectionPool parent, PooledConnection con)
AbstractCreateStatementInterceptor
reset
in class SlowQueryReport
parent
- - the connection pool owning the connectioncon
- - the pooled connectionpublic void poolClosed(ConnectionPool pool)
SlowQueryReport
poolClosed
in class SlowQueryReport
pool
- - the pool that is being closed.public void poolStarted(ConnectionPool pool)
SlowQueryReport
poolStarted
in class SlowQueryReport
pool
- - the pool that is being closed.protected java.lang.String reportFailedQuery(java.lang.String query, java.lang.Object[] args, java.lang.String name, long start, java.lang.Throwable t)
AbstractQueryReport
reportFailedQuery
in class SlowQueryReport
query
- the query that was executed and failedargs
- the arguments to the executionname
- the name of the method used to execute AbstractCreateStatementInterceptor.isExecute(Method, boolean)
start
- the time the query execution startedt
- the exception that happened
protected void notifyJmx(java.lang.String query, java.lang.String type)
protected java.lang.String reportSlowQuery(java.lang.String query, java.lang.Object[] args, java.lang.String name, long start, long delta)
AbstractQueryReport
reportSlowQuery
in class SlowQueryReport
query
- the query that was executed and failedargs
- the arguments to the executionname
- the name of the method used to execute AbstractCreateStatementInterceptor.isExecute(Method, boolean)
start
- the time the query execution starteddelta
- the time the execution took
public java.lang.String[] getPoolNames()
public java.lang.String getPoolName()
public boolean isNotifyPool()
public void setNotifyPool(boolean notifyPool)
public void resetStats()
public javax.management.openmbean.CompositeData[] getSlowQueriesCD() throws javax.management.openmbean.OpenDataException
getSlowQueriesCD
in interface SlowQueryReportJmxMBean
javax.management.openmbean.OpenDataException
protected void deregisterJmx()
public static javax.management.ObjectName getObjectName(java.lang.Class<?> clazz, java.lang.String poolName) throws javax.management.MalformedObjectNameException
javax.management.MalformedObjectNameException
protected void registerJmx()
public void setProperties(java.util.Map<java.lang.String,PoolProperties.InterceptorProperty> properties)
JdbcInterceptor
setProperties
in class SlowQueryReport
|
Apache Tomcat 7.0.23 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |