Author: trustin
Date: Mon Mar 21 03:42:51 2005
New Revision: 158452
URL: http://svn.apache.org/viewcvs?view=rev&rev=158452
Log:
Moved documentation about invocation chaining from NextInterceptor to
Interceptor.
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/NextInterceptor.java
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java?view=diff&r1=158451&r2=158452
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/Interceptor.java
Mon Mar 21 03:42:51 2005
@@ -27,6 +27,49 @@
* [EMAIL PROTECTED] Invocation}s performed on [EMAIL PROTECTED]
BackingStore}s just like Servlet
* filters do.
*
+ * <h2>Interceptor Chaining</h2>
+ * Interceptors should usually pass the control of current invocation
+ * to the next interceptor by calling [EMAIL PROTECTED]
NextInterceptor#process(Invocation)}.
+ * The flow control is returned when the next interceptor's
+ * [EMAIL PROTECTED] Interceptor#process(NextInterceptor, Invocation)} returns.
+ * You can therefore implement pre-, post-, around- invocation
+ * handler by how you place the statement.
+ * <p>
+ * <h3>Pre-invocation Filtering</h3>
+ * <pre>
+ * public void process( NextInterceptor nextInterceptor, Invocation invocation
)
+ * {
+ * System.out.println( "Starting invocation." );
+ * nextInterceptor.process( invocation );
+ * }
+ * </pre>
+ *
+ * <h3>Post-invocation Filtering</h3>
+ * <pre>
+ * public void process( NextInterceptor nextInterceptor, Invocation invocation
)
+ * {
+ * nextInterceptor.process( invocation );
+ * System.out.println( "Invocation ended." );
+ * }
+ * </pre>
+ *
+ * <h3>Around-invocation Filtering</h3>
+ * <pre>
+ * public void process( NextInterceptor nextInterceptor, Invocation invocation
)
+ * {
+ * long startTime = System.currentTimeMillis();
+ * try
+ * {
+ * nextInterceptor.process( invocation );
+ * }
+ * finally
+ * {
+ * long endTime = System.currentTimeMillis();
+ * System.out.println( ( endTime - startTime ) + "ms elapsed." );
+ * }
+ * }
+ * </pre>
+ *
* <h2>Interceptor Naming Convention</h2>
* <p>
* When you create an implementation of Interceptor, you have to follow
@@ -44,6 +87,7 @@
* @version $Rev$, $Date$
*
* @see InvocationChain
+ * @see NextInterceptor
*/
public interface Interceptor
{
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/NextInterceptor.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/NextInterceptor.java?view=diff&r1=158451&r2=158452
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/NextInterceptor.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/invocation/interceptor/NextInterceptor.java
Mon Mar 21 03:42:51 2005
@@ -22,13 +22,6 @@
/**
* Represents the next [EMAIL PROTECTED] Interceptor} in the interceptor chain.
- * [EMAIL PROTECTED] Interceptor}s should usually pass the control of current
invocation
- * to the next [EMAIL PROTECTED] Interceptor} by calling
- * <code>nextInterceptor.process(invocation)</code>.
- * This method returns when the next interceptor's
- * [EMAIL PROTECTED] Interceptor#process(NextInterceptor, Invocation)} returns.
- * You can therefore implement pre-, post-, around- invocation
- * handler by how you place the statement.
*
* @author The Apache Directory Project ([email protected])
* @author Trustin Lee ([EMAIL PROTECTED])