[jboss-dev-forums] [Design of POJO Server] - Re: ReferenceMetaDataResolverDeployer is wrong

adrian@jboss.org do-not-reply at jboss.com
Tue Dec 4 08:38:14 EST 2007


Finally, the algorithm is very inefficient and is wrong anway.

You effectively have:

  | for (Deployment Unit unit : deployments)
  | {
  |    for (InjectionTargetMetaData target : unit.getInjectMetaDatas)
  |    {
  |         ArrayList<JBossMetaData> allEJBDeployments = unit.getTopLevelUnit().getAllAttachments(JBossMetaData.class);
  |         for (JBossMetaData jbossMetaData : allEJBDeployments)
  |         {
  |              search(jbossMetaData);
  |         }
  |    }
  | }
  | 

It is rebuilding the allEJBDeployments for every reference that gets resolved.

Surely it would be much more efficient to create some sort of index/repository
in a previous step which the resolver could quickly use.

In fact, the whole approach is totally wrong, since an ejb-reference
can come from a ejb deployment that has not been deployed yet.
It should not fail, it should wait.

The correct solution would be not to try to resolve straight away
but to set up a dependency for the ejb (or deployment) and populate a registry
that can be checked to do the resolution.
This would only allow the ejb to proceed to full deployment 
when the reference can be resolved in the reference registry.

i.e. there would be no occurance when a DeploymentException is explicitly thrown,
instead it would appear as an unresolved dependency in the IncompleteDeploymentException.

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

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



More information about the jboss-dev-forums mailing list