[Design the new POJO MicroContainer] - Re: Nested property ref
by adrian@jboss.org
"
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.
"
What? I don't understand the logic?
You modified the code and are now claiming that you don't need to
implement a feature of the old code?
Or are you saying it is already done elsewhere?
The classloader/metadata stack stuff needs doing more generically anyway.
i.e. It should be doing it for JMX as well (although in the case of,
JBossMX it already does the classloader - the RI JMX doesn't though).
And it should also be doing it for all callouts to the bean (I don't know that
it is done currently?).
My preference is that this code should be in an AOP interceptor not in the MC
anyway. You want the classloader/metadata stack for all invocations
(if you want it all) not just the MC lifecycle.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112219#4112219
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112219
18 years, 4 months
[Design the new POJO MicroContainer] - Re: Nested property ref
by alesj
"adrian(a)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
18 years, 4 months