[jboss-dev-forums] [JBoss Microcontainer Development POJO Server] - Re: AS weld-int

kabir.khan@jboss.com do-not-reply at jboss.com
Tue Nov 3 16:02:03 EST 2009


"kabir.khan at jboss.com" wrote : 
  | I will see if I can make 'vfs://top-level.ear/BootstrapBeanInstaller=SimpleBean' uninstall itself, but it feels a bit strange to do that from its start() method.

It leaves the context in an inconsistent state

  |    public void start() throws Exception
  |    {
  |       BeanDeploymentArchive archive = deployment.getBeanDeploymentArchives().iterator().next();
  |       
  |       if (deployment.getBeanDeploymentArchives().size() > 1)
  |          log.warn("More than one bean deployment archives, using the first " + archive);
  |       
  |       BeanManager manager = bootstrapBean.getBootstrap().getManager(archive);
  |       if (manager == null)
  |          throw new IllegalStateException("Could not find a manager for archive " + null);
  |       
  |       WeldKernelControllerContext ctx = new WeldKernelControllerContext(null, beanMetaDataHolder.getBeanMetaData(), null, manager);
  | 
  |       try
  |       {
  |          context.getController().install(ctx);
  |       }
  |       catch(Exception e)
  |       {
  |          throw e;
  |       }
  |       catch(Throwable t)
  |       {
  |          throw new Exception(t);
  |       }
  |       finally
  |       {
  |          ControllerContext me = context;
  |          context.getController().uninstall(context.getName());
  |          System.out.println(me);
  |       }
  |    }
  | 
context is the context of the bean. The call to uninstall completes successfully, unconfiguring the target and setting it to null. However, when StartStopLifecycleAction completes and ends up back in incrementState() the context is picked up and moved through the remainder of the states.


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

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



More information about the jboss-dev-forums mailing list