[Design of JBossCache] - Re: JBCACHE-957 Discussion Thread
by manik.surtani@jboss.com
While this is an interesting idea, and will very cleanly encapsulate the decision around the type of lock acquired based on:
1) Locking Scheme (opt or pess)
2) Operation (readdata, writedata, deletedata, readchild, createchild, deletechild for PL, readIntoWorkspace, writeFromWorkspace for OL)
3) State of the LockParentForChildInsertRemove param.
I'm a bit concerned about getting this into 2.0.0.B1. If anything, this will be a B2 feature, but I am really concerned with feature creep in 2.0.0. Anyone has the spare cycles for this? :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008386#4008386
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008386
17 years, 11 months
[Design of EJB 3.0] - Re: Issues with passivation of nested SFSBs
by bstansberry@jboss.com
Can we solve the XPC issue with something along these lines?
1) XPC is stored in the parent bean context.
2) Child beans have an independent lifecycle (i.e. bean instance is cached with the context, not in an internal data structure of the parent. Child bean context stores data about location of parent, and vice versa.
3) When nested bean is invoked, interceptor accesses the parent bean, gets the XPC and injects it into the nested bean instance. On the way out clear the XPC ref from the nested bean. I.e. don't try to maintain a shared ref to XPC across serialization; instead cache it in the parent and inject it into the child as needed.
4) As part of remove process, check if the bean is a parent. If so, check if any children are still alive. If yes, don't remove context from the cache; instead set a removed flag in the context. If removed flag is set an interceptor will not allow any call to the context (throw NoSuchEjbException). But the context is still cached, so child beans can find the XPC.
5) As part of remove process, check if bean is a child. If so, have parent re-check if all its children are still alive. If not, parent context can be removed.
Along with this, in general it would be good to have a background thread that runs to check for and remove orphaned beans. But that's true regardless of the value of the above.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008363#4008363
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008363
17 years, 11 months
[Design the new POJO MicroContainer] - Bug in Sun compiler?
by adrian@jboss.org
I found this while looking at a microcontainer test.
It fails in both JDK5 and JDK6, but works with eclipse.
Looks like a bug to me? Anybody confirm?
| package test;
|
| import java.lang.reflect.Constructor;
| import java.lang.reflect.Type;
| import java.util.Arrays;
|
| public class Main
| {
| public static void main(String[] args) throws Exception
| {
| Class<MyEnum> clazz = MyEnum.class;
| Constructor<MyEnum> constructor = clazz.getDeclaredConstructor(new Class[] { String.class, Integer.TYPE });
| Type[] types = constructor.getParameterTypes();
| Type[] generic = constructor.getGenericParameterTypes();
| System.out.println("types = " + Arrays.asList(types));
| System.out.println("generic = " + Arrays.asList(generic));
| if (Arrays.equals(types, generic) == false)
| throw new RuntimeException("They should be the same?");
| }
|
| public enum MyEnum { ONE, TWO, THREE };
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008317#4008317
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008317
17 years, 11 months