classUtils.javassist.sample.duplicate
Class DuplicatedObject

java.lang.Object
  extended by classUtils.javassist.reflect.Metaobject
      extended by classUtils.javassist.sample.duplicate.DuplicatedObject
All Implemented Interfaces:
java.io.Serializable

public class DuplicatedObject
extends Metaobject

See Also:
Serialized Form

Constructor Summary
DuplicatedObject(java.lang.Object self, java.lang.Object[] args)
           
 
Method Summary
 java.lang.Object trapMethodcall(int identifier, java.lang.Object[] args)
          Is invoked when base-level method invocation is intercepted.
 
Methods inherited from class classUtils.javassist.reflect.Metaobject
getClassMetaobject, getMethodName, getObject, getParameterTypes, getReturnType, setObject, trapFieldRead, trapFieldWrite
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DuplicatedObject

public DuplicatedObject(java.lang.Object self,
                        java.lang.Object[] args)
Method Detail

trapMethodcall

public java.lang.Object trapMethodcall(int identifier,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
Description copied from class: Metaobject
Is invoked when base-level method invocation is intercepted. This method simply executes the intercepted method invocation with the original parameters and returns the resulting value.

Every subclass of this class should redefine this method.

Note: this method is not invoked if the base-level method is invoked by a constructor in the super class. For example,

if an instance of B is created, the invocation of initialize() in B is intercepted only once. The first invocation by the constructor in A is not intercepted. This is because the link between a base-level object and a metaobject is not created until the execution of a constructor of the super class finishes.

Overrides:
trapMethodcall in class Metaobject
Throws:
java.lang.Throwable