[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: DESCRIBE phase - Dependency builders for MC Beans

alesj do-not-reply at jboss.com
Tue May 12 06:07:28 EDT 2009


"jaikiran" wrote : 
  | I guess, instead of checking two things in the metadata (a DependencyBuilder and a IgnoreAOP annotation), its better to just look for a single annotation 
  | 
Yes, I was just thinking about this duplicate lookup.
This is what we have now:

  |    protected DependencyBuilder getDependencyBuilder(MetaData md, Kernel kernel) throws Throwable
  |    {
  |       DependencyBuilder dependencyBuilder = null;
  |       DependencyBuilderFactory factory = md.getAnnotation(DependencyBuilderFactory.class);
  |       if (factory != null)
  |       {
  |          if (factory.checkMetaDataForBuilderInstance())
  |          {
  |             // still allow for more configurable DependencyBuilder
  |             dependencyBuilder = md.getMetaData(DependencyBuilder.class);
  |          }
  |          else
  |          {
  |             Class<? extends DependencyBuilder> value = factory.value();
  |             if (basicDependencyBuilder.getClass().equals(value))
  |             {
  |                dependencyBuilder = basicDependencyBuilder;   
  |             }
  |             else
  |             {
  |                dependencyBuilder = value.newInstance();
  |             }
  |          }
  |       }
  | 
  |       if (dependencyBuilder == null)
  |       {
  |          KernelConfig config = kernel.getConfig();
  |          dependencyBuilder = config.getDependencyBuilder();
  |       }
  | 
  |       return dependencyBuilder;
  |    }
  | 

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

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



More information about the jboss-dev-forums mailing list