Michael Rimov
2013-06-05 05:04:42 UTC
Ok, so this is the last thing on the todo list to get the TCK + all optional
tests running for JSR-330.
The TCK wants static initialization, but to keep track of things so that we
only inject statics one time.
To me that means we have to maintain some sort of state about what's been
initialized, but what scope?
Do we do it across all containers? (ie a static variable inside default
picocontainer) (for the record, my own personal opinion on this solution.
ick!)
Personally I'm of the opinion that we keep track of static initialization
once per container. (via a Non static member variable, probably a
WeakHashSet. weak so it doesn't prevent classloaders from gc'ing a class?)
If we have multiple containers (not in a parent-child way) referencing the
same class, then it would mean that a static variable will be initialized
multiple times, but personally I think this is an edge case behavior that we
can live with compared to having to have Static variables inside DPC.
I suppose a complicated way would be to run a class enhancer to offload the
state information there. but that seems like a lot of work for what we would
call an recommended way of doing things.
Thoughts?
-Mike
tests running for JSR-330.
The TCK wants static initialization, but to keep track of things so that we
only inject statics one time.
To me that means we have to maintain some sort of state about what's been
initialized, but what scope?
Do we do it across all containers? (ie a static variable inside default
picocontainer) (for the record, my own personal opinion on this solution.
ick!)
Personally I'm of the opinion that we keep track of static initialization
once per container. (via a Non static member variable, probably a
WeakHashSet. weak so it doesn't prevent classloaders from gc'ing a class?)
If we have multiple containers (not in a parent-child way) referencing the
same class, then it would mean that a static variable will be initialized
multiple times, but personally I think this is an edge case behavior that we
can live with compared to having to have Static variables inside DPC.
I suppose a complicated way would be to run a class enhancer to offload the
state information there. but that seems like a lot of work for what we would
call an recommended way of doing things.
Thoughts?
-Mike