3 Replies Latest reply on Aug 30, 2007 11:37 AM by Scott Stark

    InstanceClassFactory extension to the ManagedObjectFactory

    Scott Stark Master

      In order to deal with wrapping metadata instances like the ServiceMetaData class, I need to add an InstanceClassFactory plugin to the ManagedObjectFactory. This allows for the management annotations to be on the underlying mbean instance:

      public interface InstanceClassFactory
       * Return the Class that represents the root ManagedObject to scan
       * for management object related annotations.
       * @param instance - the instance a ManagedObject is to be created for.
       * @return the Class that represents the root ManagedObject.
       public Class<? extends Serializable> getManagedObjectClass(Serializable instance);

      This allows one to mark up the instance the mbean service wraps. The alternative would be to assume the ServiceMetaData jmx representation is the ManagedObject. I don't think that is generally the case as the interfaces were more a description of the bean service rather than the management interface.