[jboss-jira] [JBoss JIRA] Resolved: (JBMAN-2) Need to refactor AbstractManagedObjectFactory

Scott M Stark (JIRA) jira-events at lists.jboss.org
Thu Sep 4 23:30:38 EDT 2008


     [ https://jira.jboss.org/jira/browse/JBMAN-2?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott M Stark resolved JBMAN-2.
-------------------------------

    Resolution: Done


The InstanceClassFactory(Serializable) behavior has been factored out to a  defaultInstanceFactory property:

   /**
    * Set the default InstanceClassFactory. This is used when there is not
    * match an exact match by the {@linkplain #getInstanceClassFactory(Class)}
    * factory method.
    * 
    * @param defaultInstanceFactory the default InstanceClassFactory to fall
    * back to. It may be null if no default should be used.
    */
   public void setDefaultInstanceFactory(
         InstanceClassFactory<? extends Serializable> defaultInstanceFactory)
   {
      this.defaultInstanceFactory = defaultInstanceFactory;
   }
which is initialized to an AbstractInstanceClassFactory<Serializable>. Note that the AbstractInstanceClassFactory needs an ManagedObjectFactory in order to be able to generate values for GenericValue(ManagedObject) values.

The ManagedObjectPopulator(Serializable) behavior has been factored out to a defaultManagedObjectPopulator property:
   /**
    * A default implementation of ManagedObjectPopulator that is used when
    * there is no ManagedObjectBuilder registered for a given type.
    * @see #getBuilder(Class)
    * @param defaultManagedObjectPopulator
    */
   public void setDefaultManagedObjectPopulator(
         ManagedObjectPopulator<? extends Serializable> defaultManagedObjectPopulator)

This is initialized to an AbstractManagedObjectPopulator value. Note that the AbstractManagedObjectPopulator requires a org.jboss.config.spi.Configuration and InstanceClassFactory defaults and mappings, so typically these are taken from the associated AbstractManagedObjectFactory:

      AbstractManagedObjectFactory mof = new AbstractManagedObjectFactory();
      TestMOP mop = new TestMOP(mof.getConfiguration(), new TestSimpleICF(), mof.getInstanceFactories());
      mof.setDefaultManagedObjectPopulator(mop);


> Need to refactor AbstractManagedObjectFactory
> ---------------------------------------------
>
>                 Key: JBMAN-2
>                 URL: https://jira.jboss.org/jira/browse/JBMAN-2
>             Project: JBoss Managed
>          Issue Type: Task
>          Components: managedobject
>            Reporter: Scott M Stark
>            Assignee: Scott M Stark
>             Fix For: JBossMan.2.0.0.CR1
>
>
> The current org.jboss.managed.plugins.factory.AbstractManagedObjectFactory has too much going on to be reusable. In particular, the InstanceClassFactory(Serializable), ManagedObjectPopulator(Serializable) parameterized interfaces cannot be changed by subclasse.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list