[Design of JBoss Web Services] - Re: Why is the UMDM using ConcurrentHashMap?
by jason.greene@jboss.com
ConcurrentHashMap usually does not lock on reads with a successful ConcurrentHashMap usually does not lock on reads with a successful result. However, if the entry does not exist, a lock is always held on the corresponding stripe. Along with the extra locking, it also adds more processing and memory overhead. All of this is of course needed to handle multiple concurrent writers (or the possibility of multiple concurrent writers).
However, since the UMD is written to only at the start, and only from one thread, no synchronization is needed, even in that single thread. So, since no locking is needed, there is no need for ConcurrentHashMap.
It could be argued though that ConcurrentHashMap would improve safety, since improper use of the UMD (a writer happens after eager initialization for example) would be slightly protected. However the problem is that this would only be protecting one of the many internal types within the UMD, so the overall access to it still can not allow for multiple writers, unless of course, it was redesigned to allow for the multiple writer scenario.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014598#4014598
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014598
19 years, 1 month
[Design the new POJO MicroContainer] - Re: Lifecycle aspects revisited
by kabir.khan@jboss.com
Another issue at the moment is if something for example has both lifecycle-configure and aop:lifecycle-install aspects.
In this case setKernelControllerContext() gets called both during configure and install, with no real way to controll which of the lifecycle aspects to call. This could be handled at aspect level, since we have access to the KernelControllerContext, but that seems slightly ugly. Would it make sense to make these methods more finegrained? i.e.
| public interface ConfigureKernelControllerContextAware extends KernelControllerContextAware
| {
| void setConfigureKernelControllerContext(KernelControllerContext context) throws Exception;
| void unsetConfigureKernelControllerContext(KernelControllerContext context) throws Exception;
| }
|
| public interface InstallKernelControllerContextAware extends KernelControllerContextAware
| {
| void setInstallKernelControllerContext(KernelControllerContext context) throws Exception;
| void unsetInstallKernelControllerContext(KernelControllerContext context) throws Exception;
|
| ...
| }
WRT my previous post the default pointcut for a lifecycle-configure would then become
| execution(* CLASSES_VALUE->$implements{org.jboss.kernel.spi.dependency.ConfigureKernelControllerContextAware}(..))"
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014270#4014270
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014270
19 years, 1 month
[Design the new POJO MicroContainer] - Re: Lifecycle aspects revisited
by kabir.khan@jboss.com
I also think it should be possible to make the pointcut attribute optional for the lifecycle events
| <aop:lifecycle-configure xmlns:aop="urn:jboss:aop-beans:1.0"
| name="JMXLifecycle"
| class="org.jboss.aop.microcontainer.aspects.jmx.JMXIntroduction"
| classes="@org.jboss.aop.microcontainer.aspects.jmx.JMX"
| </aop:lifecycle-configure>
|
Since in most cases the pointcut will be something along the lines of
| execution(* CLASSES_VALUE->$implements{org.jboss.kernel.spi.dependency.KernelControllerContextAware}(..))">
|
i.e.:
| execution(* @org.jboss.aop.microcontainer.aspects.jmx.JMX->$implements{org.jboss.kernel.spi.dependency.KernelControllerContextAware}(..))">
|
If something apart from this defaul needs doing it will be possible to specify the "pointcut" attribute as it works at present.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014258#4014258
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014258
19 years, 1 month
[Design the new POJO MicroContainer] - Lifecycle aspects revisited
by kabir.khan@jboss.com
One problem with the current lifecycle introduction aspects (JMXIntroduction, JndiIntroduction) is that they do not call invocation.invokeNext().
This means that if we use both the @JMX and the @JndiBinding annotations to a bean, the first one in the chain wins, so we either get registered in JMX or in JNDI, but not both.
If these asepcts are changed to call invokeNext(), we will eventually end up with the MethodInvocation trying to call the setKernelControllerContext() method in the target which does not exist, resulting in an exception. I think the woven/proxy code needs to be modified to detect if an interface introduction is the cause of the MethodInvocation, and if this is the case we do not attempt to call the target method at the end of the interceptor chain.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014257#4014257
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014257
19 years, 1 month