You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by st...@apache.org on 2013/01/01 23:29:48 UTC

svn commit: r1427577 - in /geronimo/specs/trunk/geronimo-jcdi_1.1_spec: ./ src/main/java/javax/enterprise/inject/spi/Interceptor.java

Author: struberg
Date: Tue Jan  1 22:29:47 2013
New Revision: 1427577

URL: http://svn.apache.org/viewvc?rev=1427577&view=rev
Log:
GERONIMO-6182 add JavaDoc and fix ignore rules

Modified:
    geronimo/specs/trunk/geronimo-jcdi_1.1_spec/   (props changed)
    geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Interceptor.java

Propchange: geronimo/specs/trunk/geronimo-jcdi_1.1_spec/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jan  1 22:29:47 2013
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Modified: geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Interceptor.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Interceptor.java?rev=1427577&r1=1427576&r2=1427577&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Interceptor.java (original)
+++ geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Interceptor.java Tue Jan  1 22:29:47 2013
@@ -24,12 +24,39 @@ import java.util.Set;
 import javax.interceptor.InvocationContext;
 
 
+/**
+ * A Bean for creating and using an interceptor.
+ * A CDI interceptor is always a separate dependent instance
+ * for each intercepted class. It will get created when the
+ * intercepted bean gets created and destroyed when the
+ * intercepted bean gets destroyed.
+ *
+ * @param <T>
+ */
 public interface Interceptor<T> extends Bean<T>
 {
+    /**
+     * Usually a single Interceptor
+     * @return all {@link javax.interceptor.InterceptorBinding}s handled by this interceptor.
+     */
     public abstract Set<Annotation> getInterceptorBindings();
-    
+
+    /**
+     * @param type InterceptionType in question
+     * @return <code>true</code> if this interceptor handles the given InterceptionType, <code>false</code> otherwise
+     */
     public boolean intercepts(InterceptionType type);
 
+    /**
+     * Perform the interception. This will e.g. invoke the &#064;AroundInvoke annotated method
+     * on the given instance of T.
+     * @param type the InterceptionType. This is important if an interceptor has multiple interceptor methods
+     *             e.g. one &#064;AroundInvoke and one &#064;PostConstruct;
+     * @param instance the interceptor instance
+     * @param ctx the InvocationContext contains all the interceptor chain state for a single invocation.
+     * @return the object or wrapper type returned by the intercepted instance or the previous interceptor
+     *         (if this is not the last interceptor in the chain)
+     */
     public Object intercept(InterceptionType type, T instance, InvocationContext ctx);
 
 }