Author: gavin.king(a)jboss.com
Date: 2009-11-16 18:47:30 -0500 (Mon, 16 Nov 2009)
New Revision: 5079
Modified:
doc/trunk/reference/en-US/extend.xml
Log:
fix bug
Modified: doc/trunk/reference/en-US/extend.xml
===================================================================
--- doc/trunk/reference/en-US/extend.xml 2009-11-16 23:41:00 UTC (rev 5078)
+++ doc/trunk/reference/en-US/extend.xml 2009-11-16 23:47:30 UTC (rev 5079)
@@ -286,82 +286,81 @@
void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager bm) {
- //use this to read annotations of the class
- AnnotatedType<SecurityManager> at =
bm.createAnnotatedType(SecurityManager.class);
+ //use this to read annotations of the class
+ AnnotatedType<SecurityManager> at =
bm.createAnnotatedType(SecurityManager.class);
- //use this to instantiate the class and inject dependencies
- final InjectionTarget<SecurityManager> it =
bm.createInjectionTarget(at);
+ //use this to instantiate the class and inject dependencies
+ final InjectionTarget<SecurityManager> it = bm.createInjectionTarget(at);
- abd.addBean( new Bean<SecurityManager>() {
-
- @Override
- public Class<?> getBeanClass() {
- return SecurityManager.class;
- }
-
- @Override
- public Set<InjectionPoint> getInjectionPoints() {
- return it.getInjectionPoints();
- }
-
- @Override
- public String getName() {
- return "securityManager";
- }
-
- @Override
- public Set<Annotation> getQualifiers() {
- Set<Annotation> qualifiers = new HashSet<Annotation>();
- qualifiers.add( new AnnotationLiteral<Default>() {} );
- qualifiers.add( new AnnotationLiteral<Any>() {} );
- return qualifiers;
- }
-
- @Override
- public Class<? extends Annotation> getScope() {
- return SessionScoped.class;
- }
-
- @Override
- public Set<Class<? extends Annotation>> getStereotypes() {
- return Collections.emptySet();
- }
-
- @Override
- public Set<Type> getTypes() {
- Set<Type> types = new HashSet<Type>();
- types.add(SecurityManager.class);
- types.add(Object.class);
- return types;
- }
-
- @Override
- public boolean isAlternative() {
- return false;
- }
-
- @Override
- public boolean isNullable() {
- return false;
- }
-
- @Override
- public Object create(CreationalContext<SecurityManager> ctx) {
- SecurityManager instance = it.produce(ctx);
- it.inject(instance, ctx);
- it.postConstruct(instance);
- return instance;
- }
-
- @Override
- public void destroy(SecurityManager instance,
CreationalContext<SecurityManager> ctx) {
- it.preDestroy(instance);
- it.dispose(instance);
- ctx.release();
- }
-
- } );
- }
+ abd.addBean( new Bean<SecurityManager>() {
+
+ @Override
+ public Class<?> getBeanClass() {
+ return SecurityManager.class;
+ }
+
+ @Override
+ public Set<InjectionPoint> getInjectionPoints() {
+ return it.getInjectionPoints();
+ }
+
+ @Override
+ public String getName() {
+ return "securityManager";
+ }
+
+ @Override
+ public Set<Annotation> getQualifiers() {
+ Set<Annotation> qualifiers = new HashSet<Annotation>();
+ qualifiers.add( new AnnotationLiteral<Default>() {} );
+ qualifiers.add( new AnnotationLiteral<Any>() {} );
+ return qualifiers;
+ }
+
+ @Override
+ public Class<? extends Annotation> getScope() {
+ return SessionScoped.class;
+ }
+
+ @Override
+ public Set<Class<? extends Annotation>> getStereotypes() {
+ return Collections.emptySet();
+ }
+
+ @Override
+ public Set<Type> getTypes() {
+ Set<Type> types = new HashSet<Type>();
+ types.add(SecurityManager.class);
+ types.add(Object.class);
+ return types;
+ }
+
+ @Override
+ public boolean isAlternative() {
+ return false;
+ }
+
+ @Override
+ public boolean isNullable() {
+ return false;
+ }
+
+ @Override
+ public SecurityManager create(CreationalContext<SecurityManager> ctx)
{
+ SecurityManager instance = it.produce(ctx);
+ it.inject(instance, ctx);
+ it.postConstruct(instance);
+ return instance;
+ }
+
+ @Override
+ public void destroy(SecurityManager instance,
CreationalContext<SecurityManager> ctx) {
+ it.preDestroy(instance);
+ it.dispose(instance);
+ ctx.release();
+ }
+
+ } );
}
}]]></programlisting>