directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r109778 - /incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveJndiProvider.java /incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/Invocation.java
Date Sat, 04 Dec 2004 06:08:06 GMT
Author: akarasulu
Date: Fri Dec  3 22:08:06 2004
New Revision: 109778

URL: http://svn.apache.org/viewcvs?view=rev&rev=109778
Log:
Changes ...

 o added boolean bypass property to an invocation
 o made framework take bypass property into account by not calling the target
   method on the proxied object

Notes ...

 o change is being made to be able to implement the following fix:

    http://nagoya.apache.org/jira/browse/DIREVE-101

 o this change would be required by several dynamic entry generation and 
   transformation services critical for implementing views.


Modified:
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveJndiProvider.java
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/Invocation.java

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveJndiProvider.java
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveJndiProvider.java?view=diff&rev=109778&p1=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveJndiProvider.java&r1=109777&p2=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveJndiProvider.java&r2=109778
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveJndiProvider.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/EveJndiProvider.java
Fri Dec  3 22:08:06 2004
@@ -208,8 +208,22 @@
 
             try
             {
-                Object retVal = method.invoke( nexus, invocation.getParameters() );
-                invocation.setReturnValue( retVal );
+                /*
+                 * If the invocation is not bypassed, we invoke on the proxied
+                 * object and set the return value on invocation.  If we do
+                 * bypass, its because a before chain service set the bypass
+                 * flag.  If the invoked method has a return value it's the
+                 * responsibility of the bypass triggering interceptor to set
+                 * the value to return.
+                 */
+
+                if ( ! invocation.doBypass() )
+                {
+                    Object retVal = method.invoke( nexus, invocation.getParameters() );
+                    invocation.setReturnValue( retVal );
+                }
+
+                // even if invocation is bypassed state is now post invocation 
                 invocation.setState( InvocationStateEnum.POSTINVOCATION );
             }
             catch ( InvocationTargetException ite )
@@ -231,7 +245,7 @@
                     target = new NamingException();
                     target.setRootCause( ite );
                 }
-                
+
                 invocation.setThrowable( target );
                 invocation.setState( InvocationStateEnum.FAILUREHANDLING );
             }
@@ -254,12 +268,12 @@
 
 
         /*
-         * If we have gotten this far then the before pipeline succeeded.  If 
-         * the target invocation succeeded then we should be in the 
+         * If we have gotten this far then the before pipeline succeeded.  If
+         * the target invocation succeeded then we should be in the
          * POSTINVOCATION state in which case we invoke the after pipeline.
-         * 
+         *
          * If the target invocation failed then we should run the after failure
-         * pipeline since we will be in the FAILUREHANDLINE state and after 
+         * pipeline since we will be in the FAILUREHANDLINE state and after
          * doing so we throw the original throwable raised by the target.
          */
         if ( invocation.getState() == InvocationStateEnum.POSTINVOCATION )

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/Invocation.java
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/Invocation.java?view=diff&rev=109778&p1=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/Invocation.java&r1=109777&p2=incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/Invocation.java&r2=109778
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/Invocation.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/Invocation.java
Fri Dec  3 22:08:06 2004
@@ -53,7 +53,12 @@
      * The invokation state: when call has completed isCompleted will be true
      */
     private boolean isComplete = false;
-    
+
+    /**
+     * When set to true the invocation on the target is bypassed.
+     */
+    private boolean bypass = false;
+
     /**
      * Thrown by the first interceptor to fail within the before invocation
      * InterceptorPipeline which is fail fast.
@@ -131,10 +136,10 @@
 
 
     /**
-     * Gets the completion state of this invokation.  
+     * Gets the completion state of this invokation.
      *
-     * @return true if the call on the proxied object has returned, false 
-     * otherwise 
+     * @return true if the call on the proxied object has returned, false
+     * otherwise
      */
     public boolean isComplete()
     {
@@ -153,7 +158,30 @@
     {
         this.isComplete = isComplete;
     }
-    
+
+
+    /**
+     * Gets whether or not this invokation is to be bypassed.
+     *
+     * @return true if the call on the proxied object is to be bypassed, false
+     * otherwise
+     */
+    public boolean doBypass()
+    {
+        return bypass;
+    }
+
+
+    /**
+     * Sets the whether or not the invocation on the proxied object is bypassed.
+     *
+     * @param bypass whether or not the call on the proxied object is bypassed
+     */
+    void setBypass( boolean bypass )
+    {
+        this.bypass = bypass;
+    }
+
 
     /**
      * Lists the Throwables thrown by interceptors within the failure pipeline

Mime
View raw message