public abstract class StatefulExtensionHandler extends Object implements ExtensionHandler
ExtensionHandler implementations that
need to maintain their own state. Concrete implementations can choose with of
the default implementations of
handleExtendedInterfaceCall(IBeanContext, IBeanFieldAccess, Object, Method, Object[]),
ExtensionHandler.interceptGetterCall(IBeanContext, IBeanFieldMetaInfo, Object, Object)
and
ExtensionHandler.interceptSetterCall(IBeanContext, IBeanFieldMetaInfo, Object, Object)
to override.
For stateful handlers it is recommendable if the handler itself implements
the extension interface. This class' implementation of
handleExtendedInterfaceCall(IBeanContext, IBeanFieldAccess, Object, Method, Object[])
does simply forwards any extension interface call to the bean to associated
handler instance.
| Constructor and Description |
|---|
StatefulExtensionHandler() |
| Modifier and Type | Method and Description |
|---|---|
Object |
handleExtendedInterfaceCall(IBeanContext<?> context,
IBeanFieldAccess bean,
Object proxyInstance,
Method method,
Object[] params)
This default implementation re-calls the interface method onto the
handler itself assuming the handler implements the extension interface as
well.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinterceptGetterCall, interceptSetterCall, onInitStatefulpublic Object handleExtendedInterfaceCall(IBeanContext<?> context, IBeanFieldAccess bean, Object proxyInstance, Method method, Object[] params) throws Throwable
handleExtendedInterfaceCall in interface ExtensionHandlercontext - provides meta information about the beanbean - allows this method to read or change field values of the IBeanproxyInstance - the IBean instance object (see
InvocationHandler.invoke(Object, Method, Object[]) for
more details)method - the Method of the extension interface that was called
on the IBean (see
InvocationHandler.invoke(Object, Method, Object[]) for
more details)params - the parameters passed to the extension method call (see
InvocationHandler.invoke(Object, Method, Object[]) for
more details)null if the return type is
void. (see
InvocationHandler.invoke(Object, Method, Object[]) for
more details)Throwable - can be any Error, RuntimeException or checked
exception that is definied in the signature of the extension
method. (see
InvocationHandler.invoke(Object, Method, Object[])
for more details)ExtensionHandler.handleExtendedInterfaceCall(IBeanContext,
IBeanFieldAccess, Object, Method, Object[])