Author: swd847
Date: 2010-04-12 17:11:29 -0400 (Mon, 12 Apr 2010)
New Revision: 6096
Added:
extensions/trunk/src/main/java/org/jboss/weld/extensions/Veto.java
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/CoreExtension.java
Log:
@Veto annotation
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/CoreExtension.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/CoreExtension.java 2010-04-12
16:06:08 UTC (rev 6095)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/CoreExtension.java 2010-04-12
21:11:29 UTC (rev 6096)
@@ -34,6 +34,12 @@
<X> void processAnnotatedType(@Observes final ProcessAnnotatedType<X> pat,
BeanManager bm)
{
+ if (pat.getAnnotatedType().isAnnotationPresent(Veto.class))
+ {
+ pat.veto();
+ return;
+ }
+
final AnnotatedType<X> at = pat.getAnnotatedType();
ReannotatedType<X> rt = new ReannotatedType<X>(at);
Added: extensions/trunk/src/main/java/org/jboss/weld/extensions/Veto.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/Veto.java
(rev 0)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/Veto.java 2010-04-12 21:11:29
UTC (rev 6096)
@@ -0,0 +1,21 @@
+package org.jboss.weld.extensions;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Signifies that a bean should be vetoed at startup
+ *
+ * @author Stuart Douglas
+ *
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Veto
+{
+
+}
Show replies by date