public class SlowQueryReportJmx extends SlowQueryReport implements javax.management.NotificationEmitter, SlowQueryReportJmxMBean
SlowQueryReport.QueryStats
AbstractQueryReport.StatementProxy
Modifier and Type | Field and Description |
---|---|
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 |
static java.lang.String |
objectNameAttribute |
protected ConnectionPool |
pool |
protected java.lang.String |
poolName |
static java.lang.String |
SLOW_QUERY_NOTIFICATION |
protected static javax.management.openmbean.CompositeType |
SLOW_QUERY_TYPE |
logFailed, logSlow, maxQueries, perPoolStats, queries, queryStatsComparator
threshold
constructors, 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
CLOSE_VAL, EQUALS_VAL, GETCONNECTION_VAL, HASHCODE_VAL, ISCLOSED_VAL, ISVALID_VAL, ISWRAPPERFOR_VAL, properties, TOSTRING_VAL, UNWRAP_VAL
Constructor and Description |
---|
SlowQueryReportJmx() |
Modifier and Type | Method and Description |
---|---|
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() |
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
|
closeInvoked, getPoolStats, getQueryStats, isLogFailed, isLogSlow, prepareCall, prepareStatement, removeOldest, reportQuery, setLogFailed, setLogSlow, setMaxQueries
createStatement, getThreshold, setThreshold
getConstructor, invoke, isExecute, isStatement, process
compare, compare, disconnected, getNext, getProperties, isUseEquals, setNext, setUseEquals
public static final java.lang.String SLOW_QUERY_NOTIFICATION
public static final java.lang.String FAILED_QUERY_NOTIFICATION
public static final java.lang.String objectNameAttribute
protected static volatile 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
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 happenedprotected 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 tookpublic 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 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
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.