public class SlowQueryReportJmx extends SlowQueryReport implements javax.management.NotificationEmitter, SlowQueryReportJmxMBean
SlowQueryReport.QueryStats, SlowQueryReport.QueryStatsComparatorAbstractQueryReport.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, queryStatsComparatorthresholdconstructors, 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_TYPESCLOSE_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, setMaxQueriescreateStatement, getThreshold, setThresholdgetConstructor, invoke, isExecute, isStatement, processcompare, compare, disconnected, getNext, getProperties, isUseEquals, setNext, setUseEqualspublic 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 final java.util.concurrent.ConcurrentHashMap<java.lang.String,SlowQueryReportJmxMBean> mbeans
protected volatile javax.management.NotificationBroadcasterSupport notifier
protected java.lang.String poolName
protected static final 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.NotificationBroadcasterjava.lang.IllegalArgumentExceptionpublic javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface javax.management.NotificationBroadcasterpublic void removeNotificationListener(javax.management.NotificationListener listener)
throws javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.NotificationBroadcasterjavax.management.ListenerNotFoundExceptionpublic void removeNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
throws javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.NotificationEmitterjavax.management.ListenerNotFoundExceptionprotected static javax.management.openmbean.CompositeType getCompositeType()
public void reset(ConnectionPool parent, PooledConnection con)
AbstractCreateStatementInterceptorreset in class SlowQueryReportparent - - the connection pool owning the connectioncon - - the pooled connectionpublic void poolClosed(ConnectionPool pool)
SlowQueryReportpoolClosed in class SlowQueryReportpool - - the pool that is being closed.public void poolStarted(ConnectionPool pool)
SlowQueryReportpoolStarted in class SlowQueryReportpool - - 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)
AbstractQueryReportreportFailedQuery in class SlowQueryReportquery - 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)
AbstractQueryReportreportSlowQuery in class SlowQueryReportquery - 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 SlowQueryReportJmxMBeanjavax.management.openmbean.OpenDataExceptionprotected void deregisterJmx()
public javax.management.ObjectName getObjectName(java.lang.Class<?> clazz,
java.lang.String poolName)
throws javax.management.MalformedObjectNameException
javax.management.MalformedObjectNameExceptionprotected void registerJmx()
public void setProperties(java.util.Map<java.lang.String,PoolProperties.InterceptorProperty> properties)
JdbcInterceptorsetProperties in class SlowQueryReportproperties - The propertiesCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.