Class DynamicInterceptor

  • All Implemented Interfaces:
    MBeanServer, MBeanServerConnection

    public class DynamicInterceptor
    extends Object
    implements MBeanServer
    This Interceptor wraps the real MBeanServer so that additional interceptor code can be "turned on" at a later point. However, it must be possible to start the MBeanServer even before the JVM calls main(). Therefore, This class must not depend on anything that can't initialize before the JVM calls main(). This includes things like logging which is not happy being invoked that early.

    When instantiated at startup, the instance of this class that wraps the real MBeanServer is termed the "Primary Interceptor". There can only be one such Interceptor for each real* MBeanServer. MBeanServer #0 is the Platform MBeanServer, and this class must be used for GlassFish. Additional MBeanServers can be created if desired.

    This class can also be used to implement an Interceptor which can be set for use by the Primary Interceptor. Such interceptors are used only for get/setAttribute(s) and invoke(), though the use of them could be expanded for other methods.

    Note that many methods are declared 'final' for efficiency. If a subclass needs to override a method, remove 'final'. Until that time, we might as well remain efficient, since most methods won't be overridden.