[jboss-dev-forums] [Design of POJO Server] - Re: Instance annotations from Object Models

adrian@jboss.org do-not-reply at jboss.com
Tue Nov 6 05:45:35 EST 2007


"scott.stark at jboss.org" wrote : 
  | I'm still not clear on what is needed for the aop aspects configuration. 
  | 

The idea is to replace this code + related methods:

  |    private void addEjbAnnotations(EJBContainer container,
  |          JBossEnterpriseBeanMetaData enterpriseBean) throws Exception
  |    {
  |       if (enterpriseBean != null)
  |       {
  |          if (enterpriseBean instanceof JBossSessionBeanMetaData)
  |          {
  |             addHomeAnnotations(container, (JBossSessionBeanMetaData) enterpriseBean);
  |    
  |             addJndiAnnotations(container, (JBossSessionBeanMetaData) enterpriseBean);
  |          }
  | 
  |          addInterceptorMethodAnnotations(container, enterpriseBean);
  | 
  |          handleResourceRefs(container, enterpriseBean.getResourceReferences());
  | 
  |          addMessageDestinationAnnotations(container, enterpriseBean.getMessageDestinationReferences());
  | 
  |          addSecurityIdentityAnnotation(container, enterpriseBean.getSecurityIdentity());
  | 
  |          addDependencies(container, enterpriseBean);
  | 
  |          addPoolAnnotations(container, enterpriseBean);
  |          
  |          addXmlAnnotations(container, enterpriseBean);
  | 
  |          if (enterpriseBean instanceof JBossSessionBeanMetaData)
  |          {
  |             addConcurrentAnnotations(container, (JBossSessionBeanMetaData)enterpriseBean);
  |             addClusterAnnotations(container, (JBossSessionBeanMetaData)enterpriseBean);
  |             addCacheAnnotations(container, (JBossSessionBeanMetaData)enterpriseBean);
  |          }
  |       }
  |    }
  | 

with something that loads into the INSTANCE mutable metadata.

My preference would be to make this a visitor pattern over the metadata itself,
e.g.

  | MutableMetaData mmd = deploymentUnit.getMutableMetaData();
  | MetaDataVisitor visitor = new MetaDataVisitor(mmd, ...);
  | visitor.visit(enterpriseBean);
  | 

Which is much more extensible/maintainable and OO than the current EJB3 sutff.
Each part of the JavaEE/JBoss metadata can decide if/where it goes in the
annotation view.

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

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



More information about the jboss-dev-forums mailing list