| java.lang.Object de.mcs.jmeasurement.proxy.ProxyMonitor
ProxyMonitor | public class ProxyMonitor implements InvocationHandler(Code) | | This is my monitor class for monitoring interface methodes automatically. The
name of the measurepoints will be automatically generated as
[fullclassname]#[methodename]
since: 0.64 author: W.Klaas |
Constructor Summary | |
public | ProxyMonitor(Object aTestObject, boolean aStoreExceptions, boolean aFullExceptions, String[] aMethodNames) constructor for this proxy.
Parameters: aTestObject - object under test. Parameters: aStoreExceptions - if exceptions should be stored. Parameters: aFullExceptions - full exceptions with stacktraces Parameters: aMethodNames - list with all methodnames that should be monitored. | public | ProxyMonitor(Object aTestObject, String[] aMethodNames) constructor for this proxy. |
Method Summary | |
final public Object | invoke(Object proxy, Method method, Object[] args) This is the methode that will alway be inveked on every methode
invocation of the object under test. |
ProxyMonitor | public ProxyMonitor(Object aTestObject, boolean aStoreExceptions, boolean aFullExceptions, String[] aMethodNames)(Code) | | constructor for this proxy.
Parameters: aTestObject - object under test. Parameters: aStoreExceptions - if exceptions should be stored. Parameters: aFullExceptions - full exceptions with stacktraces Parameters: aMethodNames - list with all methodnames that should be monitored. If thisparameter is null all methods will be monitored. |
ProxyMonitor | public ProxyMonitor(Object aTestObject, String[] aMethodNames)(Code) | | constructor for this proxy. Using default exception handling.
Parameters: aTestObject - object under test. Parameters: aMethodNames - list with all methodnames that should be monitored. If thisparameter is null all methods will be monitored. |
invoke | final public Object invoke(Object proxy, Method method, Object[] args) throws Throwable(Code) | | This is the methode that will alway be inveked on every methode
invocation of the object under test. Processes a method invocation on a
proxy instance and returns the result. This method will be invoked on an
invocation handler when a method is invoked on a proxy instance that it
is associated with.
Parameters: proxy - the proxy instance that the method was invoked on Parameters: method - the Method instance corresponding to theinterface method invoked on the proxy instance. The declaringclass of the Method object will be theinterface that the method was declared in, which may be asuperinterface of the proxy interface that the proxy classinherits the method through. Parameters: args - an array of objects containing the values of the argumentspassed in the method invocation on the proxy instance, ornull if interface method takes no arguments.Arguments of primitive types are wrapped in instances of theappropriate primitive wrapper class, such asjava.lang.Integer orjava.lang.Boolean . the value to return from the method invocation on the proxyinstance. If the declared return type of the interface method isa primitive type, then the value returned by this method must bean instance of the corresponding primitive wrapper class;otherwise, it must be a type assignable to the declared returntype. If the value returned by this method is null and the interface method's return type is primitive, then aNullPointerException will be thrown by the methodinvocation on the proxy instance. If the value returned by thismethod is otherwise not compatible with the interface method'sdeclared return type as described above, aClassCastException will be thrown by the methodinvocation on the proxy instance. throws: Throwable - the exception to throw from the method invocation on theproxy instance. The exception's type must be assignableeither to any of the exception types declared in thethrows clause of the interface method or tothe unchecked exception typesjava.lang.RuntimeException orjava.lang.Error . If a checked exception isthrown by this method that is not assignable to any of theexception types declared in the throws clauseof the interface method, then anUndeclaredThrowableException containing the exceptionthat was thrown by this method will be thrown by the methodinvocation on the proxy instance. See Also: java.lang.refelct.InvocationHandler.invoke(java.lang.Objectjava.lang.reflect.Methodjava.lang.Object[]) |
|
|