public class MonProxyFactoryImp extends Object
This is a nonstatic version and is the primary implementation. The static version MonProxyFactory simply calls this version
Sample code:
ResultSet rs= MonProxyFactory.monitor(resultSet);
Connection conn=MonProxyFactory.monitor(connection);
MyInterface my=(MyInterface) MonProxyFactory.monitor(myObject);//myObject implements MyInterface
YourInterface your=(YourInterface) MonProxyFactory.monitor(yourObject);//myObject implements MyInterface
Constructor and Description |
---|
MonProxyFactoryImp() |
Modifier and Type | Method and Description |
---|---|
void |
enable(boolean enable)
Enables all monitors except ResultSet monitoring.
|
void |
enableAll(boolean enable)
Enables all monitors.
|
void |
enableExceptionDetail(boolean enable)
Deprecated.
|
void |
enableExceptionSummary(boolean enable)
Deprecated.
|
void |
enableInterface(boolean enable)
Enables/disables whether methods of the interface are monitored or not
|
void |
enableResultSet(boolean enable)
Enables/disables whether ResultSet methods are monitored.
|
void |
enableSQLDetail(boolean enable)
Enables/disables whether sql command details (time, sql, stack trace, ...) are kept in a rolling buffer
|
void |
enableSQLSummary(boolean enable)
Enables/Disables jamon summary stats for SQL
|
int |
getExceptionBufferSize()
Get the number of Exceptions that can be stored in the buffer before the oldest entries must
be removed.
|
Object[][] |
getExceptionDetail()
Get the exception buffer as an array, so it can be displayed
|
String[] |
getExceptionDetailHeader()
Get the header that can be used to display the Exceptions buffer
|
Class[] |
getInterfaces(Class cls)
For every class in the Object/Interface heirarchy find its implemented interfaces.
|
MonProxyLabelerInt |
getLabelFactory() |
List |
getMatchStrings()
Get a list of the strings to match in the parsed query.
|
MonProxy |
getMonProxy(Proxy proxy)
Returns the MonProxy invocation handler should you need access to its methods like setLabeler(...) etc.
|
int |
getSQLBufferSize()
Get the number of SQL statements that can be stored in the buffer before the
oldest entries must be removed.
|
Object[][] |
getSQLDetail()
Get the sql buffer as an array, so it can be displayed
|
String[] |
getSQLDetailHeader()
Get the header that can be used to display the SQL buffer
|
boolean |
isAllEnabled() |
boolean |
isEnabled()
Returns true if MonProxyFactory is enabled.
|
boolean |
isExceptionDetailEnabled()
Deprecated.
|
boolean |
isExceptionSummaryEnabled()
Deprecated.
|
boolean |
isInterfaceEnabled()
Inidicates whether methods of the interface are monitored or not
|
boolean |
isResultSetEnabled()
Indicates whether ResultSet methods are monitored.
|
boolean |
isSQLDetailEnabled()
Indicates whether sql command details (time, sql, stack trace, ...) are kept in a rolling buffer
|
boolean |
isSQLSummaryEnabled()
Indicates whether jamon summary stats are kept for SQL
|
CallableStatement |
monitor(CallableStatement statement)
Monitor a CallableStatements methods, as well as any ResultSets it returns (assuming the proper monitoring options are enabled)
|
Connection |
monitor(Connection conn)
Note if a connection object is monitored any Statements, PreparedStatements, CallableStatements, and
optionally ResultSets that it creates will automatically be monitored.
|
Object |
monitor(Object object)
By passing any interface to the monitor method, all public method calls and exceptions
will be monitored.
|
Object |
monitor(Object object,
Class iface)
By passing any interface to the monitor method, and an interface to implement then all public method calls and exceptions
will be monitored.
|
Object |
monitor(Object object,
Class[] interfaces)
By passing any interface to the monitor method, and an array of interfaces to implement then all public method calls and exceptions
will be monitored.
|
PreparedStatement |
monitor(PreparedStatement statement)
Monitor a PreparedStatements methods, as well as any ResultSets it returns (assuming the proper monitoring options are enabled)
|
ResultSet |
monitor(ResultSet rs)
Monitor a resultSets methods.
|
Statement |
monitor(Statement statement)
Monitor a Statements methods, as well as any ResultSets it returns (assuming the proper monitoring options are enabled)
|
void |
resetExceptionDetail()
Remove all Exceptions from the buffer.
|
void |
resetSQLDetail()
Remove all SQL from the buffer.
|
void |
setExceptionBufferSize(int exceptionBufferSize)
Set the number of Exceptions that can be stored in the buffer before the oldest entries must
be removed.
|
void |
setLabelFactory(MonProxyLabelerInt factory)
This class will be called when creating the jamon labels for both standard summary as well as
exceptions.
|
void |
setMatchStrings(List ms)
Set the strings to match
|
void |
setSQLBufferSize(int sqlBufferSize)
Set the number of SQL Statements that can be stored in the buffer before the oldest entries must
be removed.
|
public void setLabelFactory(MonProxyLabelerInt factory)
factory
- public MonProxyLabelerInt getLabelFactory()
public MonProxy getMonProxy(Proxy proxy)
ResultSet rsc=MonProxyFactory.monitor(resultSet);
MonProxy monProxy=MonProxyFactory.getMonProxy((Proxy)rsc);
proxy
- public Object monitor(Object object)
Sample call:
MyInterface myProxyObject=(MyInterface) MonProxyFactory.monitor(myObject);public Object monitor(Object object, Class[] interfaces)
Sample call:
MyInterface myProxyObject=(MyInterface) MonProxyFactory.monitor(myObject, ineterfaces);public Object monitor(Object object, Class iface)
Sample call:
MyInterface myProxyObject=(MyInterface) MonProxyFactory.monitor(myObject, com.mypackage.MyInterface.class);public Connection monitor(Connection conn)
public ResultSet monitor(ResultSet rs)
public Statement monitor(Statement statement)
public PreparedStatement monitor(PreparedStatement statement)
public CallableStatement monitor(CallableStatement statement)
public Class[] getInterfaces(Class cls)
public int getExceptionBufferSize()
public void setExceptionBufferSize(int exceptionBufferSize)
public void resetExceptionDetail()
public boolean isInterfaceEnabled()
public void enableInterface(boolean enable)
@Deprecated public boolean isExceptionSummaryEnabled()
@Deprecated public void enableExceptionSummary(boolean enable)
@Deprecated public boolean isExceptionDetailEnabled()
@Deprecated public void enableExceptionDetail(boolean enable)
public boolean isSQLSummaryEnabled()
public void enableSQLSummary(boolean enable)
public boolean isSQLDetailEnabled()
public void enableSQLDetail(boolean enable)
public boolean isResultSetEnabled()
public void enableResultSet(boolean enable)
public boolean isEnabled()
public void enableAll(boolean enable)
public boolean isAllEnabled()
public void enable(boolean enable)
public String[] getExceptionDetailHeader()
public Object[][] getExceptionDetail()
public int getSQLBufferSize()
public void setSQLBufferSize(int sqlBufferSize)
public void resetSQLDetail()
public String[] getSQLDetailHeader()
public Object[][] getSQLDetail()
public List getMatchStrings()
public void setMatchStrings(List ms)
Copyright © 2015. All rights reserved.