[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Nested property ref

alesj do-not-reply at jboss.com
Wed Dec 12 05:42:07 EST 2007


"adrian at jboss.org" wrote : 
  | I've got no idea what you talking about?
:-)

About this code in KernelControllerContextAction:

  |    static Object dispatchJoinPoint(final KernelControllerContext context, final Joinpoint joinpoint) throws Throwable
  |    {
  |       BeanMetaData metaData = context.getBeanMetaData();
  |       ClassLoader cl = Configurator.getClassLoader(metaData);
  |       AccessControlContext access = null;
  |       if (context instanceof AbstractKernelControllerContext)
  |       {
  |          AbstractKernelControllerContext theContext = (AbstractKernelControllerContext) context;
  |          access = theContext.getAccessControlContext();
  |       }
  | 
  |       KernelController controller = (KernelController) context.getController();
  |       KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository();
  |       MetaData md = repository.getMetaData(context);
  |       if (md != null)
  |          MetaDataStack.push(md);
  |       else
  |          staticLog.warn("NO METADATA! for " + context.getName() + " with scope " + context.getScopeInfo().getScope());
  |       try
  |       {
  | 
  |          // Dispatch with the bean class loader if it exists
  |          ClassLoader tcl = Thread.currentThread().getContextClassLoader();
  |          try
  |          {
  |             if (cl != null && access == null)
  |                Thread.currentThread().setContextClassLoader(cl);
  | 
  |             if (access == null)
  |             {
  |                return joinpoint.dispatch();
  |             }
  |             else
  |             {
  |                DispatchJoinPoint action = new DispatchJoinPoint(joinpoint);
  |                try
  |                {
  |                   return AccessController.doPrivileged(action, access);
  |                }
  |                catch (PrivilegedActionException e)
  |                {
  |                   throw e.getCause();
  |                }
  |             }
  |          }
  |          finally
  |          {
  |             if (cl != null && access == null)
  |                Thread.currentThread().setContextClassLoader(tcl);
  |          }
  |       }
  |       finally
  |       {
  |          if (md != null)
  |             MetaDataStack.pop();
  |       }
  |    }
  | 

Now that I've changed ConfigureAction to use direct BeanInfo.set, I guess there is no need for this?
This == preparing MetaDataStack & ContextCL before BeanInfo.set invocation.

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

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



More information about the jboss-dev-forums mailing list