[jboss-dev-forums] [Design of EJB 3.0] - Depends metadata ignored if no xml file present

bstansberry@jboss.com do-not-reply at jboss.com
Fri Aug 29 00:51:26 EDT 2008


Been working on adding dependencies on the specified HAPartition for clustered EJB2/3 beans (https://jira.jboss.org/jira/browse/JBAS-4952 ) and am seeing an issue with EJB3.

The way I'm doing this is with a deployer that add an item to the JBossEnterpriseBeanMetaData.getDepends() set for clustered beans. This works fine for EJB2 beans and for EJB3 jars with an xml descriptor.  But it doesn't work if there is no xml descriptor.

I tracked the issue down to this in Ejb3Deployment:


  |    protected void deployElement(Ejb3HandlerFactory factory, ClassFile cf, InitialContext ctx) throws Exception
  |    {
  |       Ejb3Handler handler = factory.createHandler(cf);
  |       handler.setCtxProperties(unit.getJndiProperties());
  | 
  |       if (handler.isEjb() || handler.isJBossBeanType())
  |       {
  |          List<Container> containers = handler.getContainers(cf, this);
  | 

The handler.getContainers() call is what results in various metadata being converted into annotations on the container, including the conversion of JBossEnterpriseBeanMetaData.getDepends() into @Depends.  The annotations are what ultimately drive the creation of MC dependencies.

The problem is if there's no xml the "if (handler.isEjb() || handler.isJBossBeanType())" test returns false, and the whole thing is short-circuited.

Besides impacting my particular task, I wonder if this is a general problem -- other types of metadata that deployers might add won't make it onto the annotations that drive actual behavior.

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

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



More information about the jboss-dev-forums mailing list