Search code examples
javaaopjodd

Including extra interfaces with Proxetta


I'd like to implement a class as DynamicMBean (and NotificationBroadcaster) with help of Proxetta. That is I'd like to keep my original public abstract class MyBean signature instead of having to change it so something like public abstract class MyBean implements DynamicMBean, NotificationBroadcaster.

Is this (currently) possible?


Solution

  • To be sure that I've understood your needs, let me recap - you don't want to add interfaces to your MyBean declaration, but you want to add methods that are defined by the DynamicMBean? I am not sure I understand the part:

    implement a class as DynamicMBean

    From where the implementation (i.e. methods) would come? Why do you need AOP for this?

    Proxetta offers you way to create proxies in 2 ways (or 3:). First one is by subclassing your class and wrapping the methods you want to change; or by providing you the wrapper that delegates calls to your target. In both cases, I do not see how you would use Proxetta to achieve what you need, if I've understood it right.

    Anyway, you may always try to contact Jodds support with some code samples that explain your question :)