[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Scoped beans deployment
alesj
do-not-reply at jboss.com
Thu Feb 8 12:13:17 EST 2007
"adrian at jboss.org" wrote :
| To make this work for generic scopes, the annotation will need to be meta-annotated
| so we know what it means:
|
|
| | public interface ScopeFactory<T extends Annotation>
| | {
| | ScopeKey create(T annotation);
| | }
| |
| | public class InstanceScopeFactory<InstanceScope annotation>
| | {
| | public ScopeKey create(InstanceScope annotation)
| | {
| | return new ScopeKey(CommonLevels.INSTANCE, annotation.value());
| | }
| | }
| |
| | @ScopeFactory(class=InstanceScopeFactory.class)
| | public @interface InstanceScope
| | {
| | /** The bean name */
| | String value();
| | }
| |
For the last example we probably need new annotation with the same name as ScopeFactory interface.
Any other possible name or diff package?
I'm currently putting these things into org.jboss.metadata.spi.scope and org.jboss.metadata.plugins.scope in Container.
What about in the case when Scope annotation doesn't have a factory determining annotation? Ok, since we are the ones that will be providing these scope annotations, we can throw an exception or should presume some default ScopeKey?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013145#4013145
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013145
More information about the jboss-dev-forums
mailing list