|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.cajo.utils.extra.AuditorItem
public class AuditorItem
This class is used to transparently pre and post-pend audit functionality to any given object reference. It is typically used to check the integrity of the invocation arguments, or the authenticity of the invoking object. Likewise, it can review the invocation results, to augment, or delete certain components. The wrapped object is unaware, and need not be changed, to assist in this functionality. It can be used on local objects, for which the code is available, as easily as on remote object references, for which no code is available. It is ideal for use in debug, and development activities, as well as for security, in production environments. The technique is essentially an implementation of the Decorator design pattern.
Field Summary | |
---|---|
java.lang.Object |
auditor
The auditor object. |
java.lang.Object |
item
This is the object to be audited. |
Constructor Summary | |
---|---|
AuditorItem(java.lang.Object item,
java.lang.Object auditor)
This creates the object, to audit the target object's use. |
Method Summary | |
---|---|
java.lang.Object |
invoke(java.lang.String method,
java.lang.Object args)
This method audits the incoming calls. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.Object auditor
public final java.lang.Object item
Constructor Detail |
---|
public AuditorItem(java.lang.Object item, java.lang.Object auditor)
item
- The object to receive the client invocation. It can be
local, remote, or even a proxy.auditor
- The object to receive the calls prior to, and following
the audited item's operation. It can be local, remote, or even a proxy.Method Detail |
---|
public java.lang.Object invoke(java.lang.String method, java.lang.Object args) throws java.lang.Exception
invoke
in interface Invoke
method
- 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.
java.lang.NoSuchMethodException
- If the method/agruments signature cannot
be matched to the internal object's public method interface.
java.lang.Exception
- If the internal object's method rejects the
invocation, or if it has been rejected by the auditor object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |