That doesn't work because the bean itself isn't there yet. So right now I 
examine the BeanMetaData.

(iterating over mainDeployer.getTopLevel())
   private DeploymentUnit findBean(DeploymentUnit deploymentUnit, String 
contextName)
  |    {
  |       if(deploymentUnit == null)
  |          return null;
  |       /*
  |       Set<Object> controllerContextNames = 
deploymentUnit.getControllerContextNames();
  |       if(controllerContextNames != null)
  |       {
  |          for(Object name : controllerContextNames)
  |          {
  |             if(name.equals(contextName))
  |                return deploymentUnit;
  |          }
  |       }
  |       */
  |       BeanMetaData bmd = deploymentUnit.getAttachment(BeanMetaData.class);
  |       if(bmd != null && bmd.getName().equals(contextName))
  |          return deploymentUnit;
  |       DeploymentUnit result;
  |       for(DeploymentUnit component : deploymentUnit.getComponents())
  |       {
  |          result = findBean(component, contextName);
  |          if(result != null)
  |             return deploymentUnit;
  |       }
  |       for(DeploymentUnit child : deploymentUnit.getChildren())
  |       {
  |          result = findBean(child, contextName);
  |          if(result != null)
  |             return result;
  |       }
  |       return null;
  |    }

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4210956
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to