[jboss-dev-forums] [Design of POJO Server] - Re: Why do Topic/Queue descriptors need extra metadata in or

alesj do-not-reply at jboss.com
Wed Dec 3 04:09:25 EST 2008


I've changed it to be more OO + use newly added mechanisms.
e.g. QueueMODefinition

  | public class QueueMODefinition extends ManagedObjectDefinition
  | {
  |    private static Logger log = Logger.getLogger(QueueMODefinition.class);
  | 
  |    public QueueMODefinition(ManagedObjectFactory factory)
  |    {
  |       super(QueueService.class, new QueueMOBuilder(factory));
  |    }
  | 
  |    private static class QueueMOBuilder implements ManagedObjectBuilder
  |    {
  |       private ManagedObjectFactory factory;
  | 
  |       private QueueMOBuilder(ManagedObjectFactory factory)
  |       {
  |          this.factory = factory;
  |       }
  | 
  |       /**
  |        * Create a ManagedObject from QueueService to QueueServiceMO.
  |        *
  |        * @param clazz - the mbean class to create the ManagedObject for
  |        * @param metaData - the MDR MetaData view
  |        */
  |       public ManagedObject buildManagedObject(Class<?> clazz, MetaData metaData)
  |       {
  |          ManagedObjectFactory mof = getMOFactory();
  |          log.debug("Creating QueueServiceMO template for: " + clazz);
  |          return mof.createManagedObject(QueueServiceMO.class, metaData);
  |       }
  | 
  |       /**
  |        * Get MO factory.
  |        *
  |        * @return the MO factory
  |        */
  |       protected ManagedObjectFactory getMOFactory()
  |       {
  |          if (factory == null)
  |             factory = ManagedObjectFactory.getInstance();
  | 
  |          return factory;
  |       }
  |    }
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193940#4193940

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193940



More information about the jboss-dev-forums mailing list