public class MonitorItem extends Object implements Invoke
Note: monitoring an object can be expensive in runtime efficiency. It is best used for debug and performance analysis, during development, or in production, for objects that would not be called very frequently.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
CLASSOFF
This flag can be used to selectively enable and disable monitoring
on a class-wide level.
|
Object |
item
The object being monitored.
|
boolean |
LOCALOFF
This flag can be used to selectively enable and disable monitoring
on a instance-wide level.
|
| Constructor and Description |
|---|
MonitorItem(Object item)
This creates the monitor object, to instrument the target object's use.
|
MonitorItem(Object item,
ObjectOutputStream os)
This creates the monitor object, to instrument the target object's use.
|
MonitorItem(Object item,
OutputStream os)
This creates the monitor object, to instrument the target object's use.
|
public static boolean CLASSOFF
public boolean LOCALOFF
public final Object item
public MonitorItem(Object item)
item - The object to receive the client invocation.public MonitorItem(Object item, OutputStream os)
item - The object to receive the client invocation.os - The OutputStream to send the formatted log information.public MonitorItem(Object item, ObjectOutputStream os)
item - The object to receive the client invocation.os - The ObjectOutputStream to send input and result objects.public Object invoke(String method, Object args) throws Exception
Note: Logging may be activated and deactivated administratively as needed on both an instance-wide basis via the field LOCALOFF, and on a class-wide basis via the static field CLASSOFF.
invoke in interface Invokemethod - The internal object's public method being called.args - The arguments to pass to the internal object's method.RemoteException - For a network related failure.NoSuchMethodException - If the method/agruments signature cannot
be matched to the internal object's public method interface.Exception - If the internal object's method rejects the invocation.Copyright © 2016. All Rights Reserved.