public class SlowQueryReportJmx extends SlowQueryReport implements NotificationEmitter, SlowQueryReportJmxMBean
SlowQueryReport.QueryStats
AbstractQueryReport.StatementProxy
Modifier and Type | Field and Description |
---|---|
static String |
FAILED_QUERY_NOTIFICATION |
protected static ConcurrentHashMap<String,SlowQueryReportJmxMBean> |
mbeans |
protected NotificationBroadcasterSupport |
notifier |
protected boolean |
notifyPool |
protected static AtomicLong |
notifySequence |
static String |
objectNameAttribute |
protected ConnectionPool |
pool |
protected String |
poolName |
static String |
SLOW_QUERY_NOTIFICATION |
protected static CompositeType |
SLOW_QUERY_TYPE |
logFailed, logSlow, maxQueries, perPoolStats, queries, queryStatsComparator
constructors, threshold
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(NotificationListener listener,
NotificationFilter filter,
Object handback) |
protected void |
deregisterJmx() |
protected static CompositeType |
getCompositeType() |
MBeanNotificationInfo[] |
getNotificationInfo() |
ObjectName |
getObjectName(Class<?> clazz,
String poolName) |
String |
getPoolName()
JMX operation - return the name of the pool
|
String[] |
getPoolNames()
JMX operation - return the names of all the pools
|
CompositeData[] |
getSlowQueriesCD()
JMX operation - returns all the queries we have collected.
|
boolean |
isNotifyPool() |
protected void |
notifyJmx(String query,
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(NotificationListener listener) |
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback) |
protected String |
reportFailedQuery(String query,
Object[] args,
String name,
long start,
Throwable t)
Invoked when a query execution, a call to execute/executeQuery or executeBatch failed.
|
protected String |
reportSlowQuery(String query,
Object[] args,
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(Map<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, getConstructor, getThreshold, setThreshold
invoke, isExecute, isStatement, process
compare, compare, disconnected, getNext, getProperties, isUseEquals, setNext, setUseEquals
public static final String SLOW_QUERY_NOTIFICATION
public static final String FAILED_QUERY_NOTIFICATION
public static final String objectNameAttribute
protected static volatile CompositeType SLOW_QUERY_TYPE
protected static final ConcurrentHashMap<String,SlowQueryReportJmxMBean> mbeans
protected volatile NotificationBroadcasterSupport notifier
protected String poolName
protected static final AtomicLong notifySequence
protected boolean notifyPool
protected ConnectionPool pool
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
addNotificationListener
in interface NotificationBroadcaster
IllegalArgumentException
public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface NotificationBroadcaster
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationBroadcaster
ListenerNotFoundException
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationEmitter
ListenerNotFoundException
protected static 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 String reportFailedQuery(String query, Object[] args, String name, long start, 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 String reportSlowQuery(String query, Object[] args, 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 String[] getPoolNames()
public String getPoolName()
public boolean isNotifyPool()
public void setNotifyPool(boolean notifyPool)
public void resetStats()
public CompositeData[] getSlowQueriesCD() throws OpenDataException
getSlowQueriesCD
in interface SlowQueryReportJmxMBean
OpenDataException
protected void deregisterJmx()
public ObjectName getObjectName(Class<?> clazz, String poolName) throws MalformedObjectNameException
MalformedObjectNameException
protected void registerJmx()
public void setProperties(Map<String,PoolProperties.InterceptorProperty> properties)
JdbcInterceptor
setProperties
in class SlowQueryReport
properties
- The propertiesCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.