[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Annotation Tests in deployers-vfs

alesj do-not-reply at jboss.com
Fri May 30 06:43:35 EDT 2008


"adrian at jboss.org" wrote : 
  | Iteration and delegation, {insert explitive here :-) }
  | 
  |   |                for (BeanMetaData bfb : bfBeans)
  |   |                {
  |   |                   KernelDeploymentDeployer.addBeanComponent(unit, bfb);
  |   | 
  | 
  | Who knows what happens when addBeanComponent throws an error?
  | 
Why do we treat component failure on deploy (AbstractComponentDeployer)

  |       try
  |       {
  |          deployComponents(unit);
  |       }
  |       catch (Throwable t)
  |       {
  |          undeployComponents(unit);
  |          throw DeploymentException.rethrowAsDeploymentException("Error deploying: " + unit.getName(), t);
  |       }
  | 
differently then in AbstractRealDeployerWithInput

  |       List<T> visited = new ArrayList();
  |       try
  |       {
  |          Set<? extends T> deployments = unit.getAllMetaData(getInput());
  |          for (T deployment : deployments)
  |          {
  |             visitor.deploy(unit, deployment);
  |             visited.add(deployment);
  |          }
  |       }
  |       catch (Throwable t)
  |       {
  |          for (int i = visited.size()-1; i >= 0; --i)
  |          {
  |             try
  |             {
  |                visitor.undeploy(unit, visited.get(i));
  |             }
  |             catch (Throwable ignored)
  |             {
  |                log.warn("Error during undeploy: " + unit.getName(), ignored);
  |             }
  |          }
  |          throw DeploymentException.rethrowAsDeploymentException("Error deploying: " + unit.getName(), t);
  |       }
  | 

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

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



More information about the jboss-dev-forums mailing list