You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by Eduardo Gouvea <ec...@gmail.com> on 2008/10/04 00:29:16 UTC

Extensible Custom Control with invoke method: how to get a reference to the extended bean instance?

Hi,

I'm try to implement both a Extensible and its extended Custom Control
to log any method invocation issued in a extended custom control instance.

I have 2 interfaces and 2 implementations:

@ControlInterface
... MyCustomControl {
}

@ControlImplementation
... MyCustomControlImpl ... implements Extensible ... {
    public Object invoke(Method m, Object[] args)  ... {
        // How to invoke the method been issued in the extended custom
control instance
        // without losing its state, without instantiate a new bean?
        return ...
    }
}

@ControlExtension
@ControlInterface
... MyExtendedCustomControl ...{
    public void sayHello();
}

@ControlImplementation
... MyExtendedCustomControlImpl ... extends MyCustomControlImpl implements
MyCustomControl ... {
}
    public void sayHello() {
        System.out.println("Hello!");
    }
}

But, given the parameters of the "invoke" method, I'm not able to actually
invoke
the extended custom control method after logging some information about it.

How to get a reference to the extended custom control instance within the
"invoke" method
in order to call the intercepted method in that instance?

Att.
Eduardo Gouvea