commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcar...@apache.org
Subject svn commit: r325897 [1/2] - in /jakarta/commons/sandbox/proxy/trunk: src/java/org/apache/commons/proxy/ src/java/org/apache/commons/proxy/factory/cglib/ src/java/org/apache/commons/proxy/factory/javassist/ src/java/org/apache/commons/proxy/factory/refl...
Date Mon, 17 Oct 2005 14:12:22 GMT
Author: jcarman
Date: Mon Oct 17 07:11:52 2005
New Revision: 325897

URL: http://svn.apache.org/viewcvs?rev=325897&view=rev
Log:
API Cleanup: 
1.  Introduced our own interfaces instead of relying upon outside classes/interfaces.
2.  Renamed some classes for consistency.
3.  Updated documentation to match the new API.

Added:
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Interceptor.java   (with props)
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Invoker.java   (with props)
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistInvocation.java   (contents, props changed)
      - copied, changed from r321332, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatorInvocationHandler.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatingInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InterceptorInvocationHandler.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/MethodInterceptorInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InvokerInvocationHandler.java   (with props)
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionInvocation.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionMethodInvocation.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorInterceptor.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredInterceptor.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/InterceptorChain.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingInterceptor.java   (contents, props changed)
      - copied, changed from r321332, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorAdapter.java   (with props)
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternFilter.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleFilter.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/
      - copied from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/handler/
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/InvocationHandlerAdapter.java   (with props)
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/NullInvoker.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/handler/NullInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/XmlRpcInvoker.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/handler/XmlRpcInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestExecutorInterceptor.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestExecutorMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestFilteredInterceptor.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestFilteredMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestInterceptorChain.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestMethodInterceptorChain.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestLoggingInterceptor.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestLoggingMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/filter/TestPatternFilter.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/filter/TestPatternMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/filter/TestSimpleFilter.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/filter/TestSimpleMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/invoker/
      - copied from r321183, jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/handler/
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/invoker/TestNullInvoker.java   (with props)
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/invoker/TestXmlRpcInvoker.java   (with props)
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/util/SuffixInterceptor.java   (contents, props changed)
      - copied, changed from r321183, jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/util/SuffixMethodInterceptor.java
Removed:
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/AbstractInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegateProviderInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatingInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/MethodInterceptorInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionMethodInvocation.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/handler/
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/NullInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/XmlRpcInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/reflect/TestAbstractInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/reflect/TestDelegatingInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/handler/
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestExecutorMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestFilteredMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestLoggingMethodInterceptor.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/TestMethodInterceptorChain.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/filter/TestPatternMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/interceptor/filter/TestSimpleMethodFilter.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/invoker/TestNullInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/invoker/TestXmlRpcInvocationHandler.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/util/SuffixMethodInterceptor.java
Modified:
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractSubclassingProxyFactoryTestCase.java
    jakarta/commons/sandbox/proxy/trunk/xdocs/index.xml

Added: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Interceptor.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Interceptor.java?rev=325897&view=auto
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Interceptor.java (added)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Interceptor.java Mon Oct 17 07:11:52 2005
@@ -0,0 +1,26 @@
+/* $Id$
+ *
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.proxy;
+
+/**
+ * @author James Carman
+ * @version 1.0
+ */
+public interface Interceptor
+{
+    public Object intercept( Invocation invocation ) throws Throwable;
+}

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Interceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Interceptor.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Invoker.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Invoker.java?rev=325897&view=auto
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Invoker.java (added)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Invoker.java Mon Oct 17 07:11:52 2005
@@ -0,0 +1,28 @@
+/* $Id$
+ *
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.proxy;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author James Carman
+ * @version 1.0
+ */
+public interface Invoker
+{
+    public Object invoke( Object proxy, Method method, Object[] arguments ) throws Throwable;
+}

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Invoker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/Invoker.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java?rev=325897&r1=325896&r2=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyFactory.java Mon Oct 17 07:11:52 2005
@@ -16,12 +16,8 @@
  */
 package org.apache.commons.proxy;
 
-import org.aopalliance.intercept.MethodInterceptor;
-
-import java.lang.reflect.InvocationHandler;
-
 /**
- * A <code>ProxyFactory</code> essentially encapsulates a "proxying strategy."  All <code>commons-proxy</code> proxies
+ * A <code>ProxyFactory</code> essentially encapsulates a "proxying strategy."  All Commons Proxy proxies
  * are created using a <code>ProxyFactory</code>.  So, to change the proxying strategy, simply provide a different
  * <code>ProxyFactory</code> implementation.
  *
@@ -56,50 +52,50 @@
                                         Class[] proxyClasses );
 
     /**
-     * Creates a proxy which passes through a {@link MethodInterceptor method interceptor} before eventually reaching
+     * Creates a proxy which passes through a {@link Interceptor interceptor} before eventually reaching
      * the <code>target</code> object.  The proxy will be generated using the current thread's "context class loader."
      *
      * @param target       the target object
      * @param interceptor  the method interceptor
      * @param proxyClasses the interfaces that the proxy should implement
-     * @return a proxy which passes through a {@link MethodInterceptor method interceptor} before eventually reaching
+     * @return a proxy which passes through a {@link Interceptor interceptor} before eventually reaching
      *         the <code>target</code> object.
      */
-    public Object createInterceptorProxy( Object target, MethodInterceptor interceptor, Class[] proxyClasses );
+    public Object createInterceptorProxy( Object target, Interceptor interceptor, Class[] proxyClasses );
 
     /**
-     * Creates a proxy which passes through a {@link org.aopalliance.intercept.MethodInterceptor method interceptor}
+     * Creates a proxy which passes through a {@link Interceptor interceptor}
      * before eventually reaching the <code>target</code> object.
      *
      * @param classLoader  the class loader to use when generating the proxy
      * @param target       the target object
      * @param interceptor  the method interceptor
      * @param proxyClasses the interfaces that the proxy should implement.
-     * @return a proxy which passes through a {@link org.aopalliance.intercept.MethodInterceptor method interceptor}
+     * @return a proxy which passes through a {@link Interceptor interceptor}
      *         before eventually reaching the <code>target</code> object.
      */
-    public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor interceptor,
+    public Object createInterceptorProxy( ClassLoader classLoader, Object target, Interceptor interceptor,
                                           Class[] proxyClasses );
 
     /**
-     * Creates a proxy which uses the provided {@link InvocationHandler} to handle all method invocations.  The proxy
+     * Creates a proxy which uses the provided {@link Invoker} to handle all method invocations.  The proxy
      * will be generated using the current thread's "context class loader."
      *
-     * @param invocationHandler the invocation handler
+     * @param invoker the invoker
      * @param proxyClasses      the interfaces that the proxy should implement
-     * @return a proxy which uses the provided {@link InvocationHandler} to handle all method invocations
+     * @return a proxy which uses the provided {@link Invoker} to handle all method invocations
      */
-    public Object createInvocationHandlerProxy( InvocationHandler invocationHandler, Class[] proxyClasses );
+    public Object createInvokerProxy( Invoker invoker, Class[] proxyClasses );
 
     /**
-     * Creates a proxy which uses the provided {@link InvocationHandler} to handle all method invocations.
+     * Creates a proxy which uses the provided {@link Invoker} to handle all method invocations.
      *
      * @param classLoader       the class loader to use when generating the proxy
-     * @param invocationHandler the invocation handler
+     * @param invoker the invoker
      * @param proxyClasses      the interfaces that the proxy should implement
-     * @return a proxy which uses the provided {@link InvocationHandler} to handle all method invocations
+     * @return a proxy which uses the provided {@link Invoker} to handle all method invocations
      */
-    public Object createInvocationHandlerProxy( ClassLoader classLoader, InvocationHandler invocationHandler,
+    public Object createInvokerProxy( ClassLoader classLoader, Invoker invoker,
                                                 Class[] proxyClasses );
 
     /**

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java?rev=325897&r1=325896&r2=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/ProxyUtils.java Mon Oct 17 07:11:52 2005
@@ -17,7 +17,7 @@
 package org.apache.commons.proxy;
 
 import org.apache.commons.proxy.exception.ProxyFactoryException;
-import org.apache.commons.proxy.handler.NullInvocationHandler;
+import org.apache.commons.proxy.invoker.NullInvoker;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -50,7 +50,7 @@
      */
     public static Object createNullObject( ProxyFactory proxyFactory, Class[] proxyClasses )
     {
-        return proxyFactory.createInvocationHandlerProxy( new NullInvocationHandler(), proxyClasses );
+        return proxyFactory.createInvokerProxy( new NullInvoker(), proxyClasses );
     }
 
     /**
@@ -63,7 +63,7 @@
      */
     public static Object createNullObject( ProxyFactory proxyFactory, ClassLoader classLoader, Class[] proxyClasses )
     {
-        return proxyFactory.createInvocationHandlerProxy( classLoader, new NullInvocationHandler(), proxyClasses );
+        return proxyFactory.createInvokerProxy( classLoader, new NullInvoker(), proxyClasses );
     }
 
     /**

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java?rev=325897&r1=325896&r2=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/cglib/CglibProxyFactory.java Mon Oct 17 07:11:52 2005
@@ -19,14 +19,14 @@
 import net.sf.cglib.proxy.Dispatcher;
 import net.sf.cglib.proxy.Enhancer;
 import net.sf.cglib.proxy.MethodProxy;
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.proxy.Invocation;
+import org.apache.commons.proxy.Interceptor;
+import org.apache.commons.proxy.Invoker;
 import org.apache.commons.proxy.ObjectProvider;
 import org.apache.commons.proxy.ProxyUtils;
 import org.apache.commons.proxy.factory.util.AbstractSubclassingProxyFactory;
 
 import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 
 /**
@@ -53,7 +53,7 @@
         return enhancer.create();
     }
 
-    public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor interceptor,
+    public Object createInterceptorProxy( ClassLoader classLoader, Object target, Interceptor interceptor,
                                           Class[] proxyClasses )
     {
         final Enhancer enhancer = new Enhancer();
@@ -64,14 +64,14 @@
         return enhancer.create();
     }
 
-    public Object createInvocationHandlerProxy( ClassLoader classLoader, InvocationHandler invocationHandler,
+    public Object createInvokerProxy( ClassLoader classLoader, Invoker invoker,
                                                 Class[] proxyClasses )
     {
         final Enhancer enhancer = new Enhancer();
         enhancer.setClassLoader( classLoader );
         enhancer.setInterfaces( toInterfaces( proxyClasses ) );
         enhancer.setSuperclass( getSuperclass( proxyClasses ) );
-        enhancer.setCallback( new InvocationHandlerBridge( invocationHandler ) );
+        enhancer.setCallback( new InvokerBridge( invoker ) );
         return enhancer.create();
     }
 
@@ -79,11 +79,11 @@
 // Inner Classes
 //----------------------------------------------------------------------------------------------------------------------
 
-    private class InvocationHandlerBridge implements net.sf.cglib.proxy.InvocationHandler
+    private class InvokerBridge implements net.sf.cglib.proxy.InvocationHandler
     {
-        private final InvocationHandler original;
+        private final Invoker original;
 
-        public InvocationHandlerBridge( InvocationHandler original )
+        public InvokerBridge( Invoker original )
         {
             this.original = original;
         }
@@ -96,10 +96,10 @@
 
     private class InterceptorBridge implements net.sf.cglib.proxy.MethodInterceptor
     {
-        private final MethodInterceptor inner;
+        private final Interceptor inner;
         private final Object target;
 
-        public InterceptorBridge( Object target, MethodInterceptor inner )
+        public InterceptorBridge( Object target, Interceptor inner )
         {
             this.inner = inner;
             this.target = target;
@@ -107,18 +107,18 @@
 
         public Object intercept( Object object, Method method, Object[] args, MethodProxy methodProxy ) throws Throwable
         {
-            return inner.invoke( new MethodProxyMethodInvocation( target, method, args, methodProxy ) );
+            return inner.intercept( new MethodProxyInvocation( target, method, args, methodProxy ) );
         }
     }
 
-    private class MethodProxyMethodInvocation implements MethodInvocation
+    private class MethodProxyInvocation implements Invocation
     {
         private final MethodProxy methodProxy;
         private final Method method;
         private final Object[] args;
         private final Object target;
 
-        public MethodProxyMethodInvocation( Object target, Method method, Object[] args, MethodProxy methodProxy )
+        public MethodProxyInvocation( Object target, Method method, Object[] args, MethodProxy methodProxy )
         {
             this.target = target;
             this.method = method;
@@ -141,7 +141,7 @@
             return methodProxy.invoke( target, args );
         }
 
-        public Object getThis()
+        public Object getProxy()
         {
             return target;
         }

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistInvocation.java (from r321332, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistInvocation.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistInvocation.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java&r1=321332&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistMethodInvocation.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistInvocation.java Mon Oct 17 07:11:52 2005
@@ -20,11 +20,10 @@
 import javassist.CtClass;
 import javassist.CtConstructor;
 import javassist.CtMethod;
-import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.proxy.Invocation;
 import org.apache.commons.proxy.ProxyUtils;
 
 import java.lang.ref.WeakReference;
-import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
@@ -34,7 +33,7 @@
  * @author James Carman
  * @version 1.0
  */
-public abstract class JavassistMethodInvocation implements MethodInvocation
+public abstract class JavassistInvocation implements Invocation
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Fields
@@ -49,56 +48,6 @@
 // Static Methods
 //----------------------------------------------------------------------------------------------------------------------
 
-    public synchronized static Class getMethodInvocationClass( ClassLoader classLoader, Method interfaceMethod )
-            throws CannotCompileException
-    {
-        final Map classCache = getClassCache( classLoader );
-        final String key = toClassCacheKey( interfaceMethod );
-        final WeakReference invocationClassRef = ( WeakReference )classCache.get( key );
-        Class invocationClass;
-        if( invocationClassRef == null )
-        {
-            invocationClass = createInvocationClass( classLoader, interfaceMethod );
-            classCache.put( key, new WeakReference( invocationClass ) );
-        }
-        else
-        {
-            synchronized( invocationClassRef )
-            {
-                invocationClass = ( Class )invocationClassRef.get();
-                if( invocationClass == null )
-                {
-                    invocationClass = createInvocationClass( classLoader, interfaceMethod );
-                    classCache.put( key, new WeakReference( invocationClass ) );
-                }
-            }
-        }
-        return invocationClass;
-    }
-
-    private static Map getClassCache( ClassLoader classLoader )
-    {
-        Map cache = ( Map )loaderToClassCache.get( classLoader );
-        if( cache == null )
-        {
-            cache = new HashMap();
-            loaderToClassCache.put( classLoader, cache );
-        }
-        return cache;
-    }
-
-    private static String toClassCacheKey( Method method )
-    {
-        return String.valueOf( method );
-    }
-
-    private static String getSimpleName( Class c )
-    {
-        final String name = c.getName();
-        final int ndx = name.lastIndexOf( '.' );
-        return ndx == -1 ? name : name.substring( ndx + 1 );
-    }
-
     private static Class createInvocationClass( ClassLoader classLoader, Method interfaceMethod )
             throws CannotCompileException
     {
@@ -106,7 +55,7 @@
         final CtClass ctClass = JavassistUtils.createClass(
                 getSimpleName( interfaceMethod.getDeclaringClass() ) + "_" + interfaceMethod.getName() +
                 "_invocation",
-                JavassistMethodInvocation.class );
+                JavassistInvocation.class );
         final CtConstructor constructor = new CtConstructor(
                 JavassistUtils.resolve( new Class[]{Method.class, Object.class, Object[].class} ), ctClass );
         constructor.setBody( "{\n\tsuper($$);\n}" );
@@ -152,11 +101,61 @@
         return invocationClass;
     }
 
+    private static Map getClassCache( ClassLoader classLoader )
+    {
+        Map cache = ( Map )loaderToClassCache.get( classLoader );
+        if( cache == null )
+        {
+            cache = new HashMap();
+            loaderToClassCache.put( classLoader, cache );
+        }
+        return cache;
+    }
+
+    public synchronized static Class getMethodInvocationClass( ClassLoader classLoader, Method interfaceMethod )
+            throws CannotCompileException
+    {
+        final Map classCache = getClassCache( classLoader );
+        final String key = toClassCacheKey( interfaceMethod );
+        final WeakReference invocationClassRef = ( WeakReference )classCache.get( key );
+        Class invocationClass;
+        if( invocationClassRef == null )
+        {
+            invocationClass = createInvocationClass( classLoader, interfaceMethod );
+            classCache.put( key, new WeakReference( invocationClass ) );
+        }
+        else
+        {
+            synchronized( invocationClassRef )
+            {
+                invocationClass = ( Class )invocationClassRef.get();
+                if( invocationClass == null )
+                {
+                    invocationClass = createInvocationClass( classLoader, interfaceMethod );
+                    classCache.put( key, new WeakReference( invocationClass ) );
+                }
+            }
+        }
+        return invocationClass;
+    }
+
+    private static String getSimpleName( Class c )
+    {
+        final String name = c.getName();
+        final int ndx = name.lastIndexOf( '.' );
+        return ndx == -1 ? name : name.substring( ndx + 1 );
+    }
+
+    private static String toClassCacheKey( Method method )
+    {
+        return String.valueOf( method );
+    }
+
 //----------------------------------------------------------------------------------------------------------------------
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public JavassistMethodInvocation( Method method, Object target, Object[] arguments )
+    public JavassistInvocation( Method method, Object target, Object[] arguments )
     {
         this.method = method;
         this.target = target;
@@ -172,27 +171,14 @@
         return arguments;
     }
 
-//----------------------------------------------------------------------------------------------------------------------
-// Joinpoint Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
-    public AccessibleObject getStaticPart()
+    public Method getMethod()
     {
         return method;
     }
 
-    public Object getThis()
+    public Object getProxy()
     {
         return target;
-    }
-
-//----------------------------------------------------------------------------------------------------------------------
-// MethodInvocation Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
-    public Method getMethod()
-    {
-        return method;
     }
 }
 

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistInvocation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistInvocation.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java?rev=325897&r1=325896&r2=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/javassist/JavassistProxyFactory.java Mon Oct 17 07:11:52 2005
@@ -20,14 +20,14 @@
 import javassist.CtClass;
 import javassist.CtConstructor;
 import javassist.CtMethod;
-import org.aopalliance.intercept.MethodInterceptor;
+import org.apache.commons.proxy.Interceptor;
+import org.apache.commons.proxy.Invoker;
 import org.apache.commons.proxy.ObjectProvider;
 import org.apache.commons.proxy.exception.ProxyFactoryException;
 import org.apache.commons.proxy.factory.util.AbstractProxyClassGenerator;
 import org.apache.commons.proxy.factory.util.AbstractSubclassingProxyFactory;
 import org.apache.commons.proxy.factory.util.ProxyClassCache;
 
-import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 
 /**
@@ -44,10 +44,10 @@
 //----------------------------------------------------------------------------------------------------------------------
     private static final ProxyClassCache delegatingProxyClassCache = new ProxyClassCache(
             new DelegatingProxyClassGenerator() );
-    private static final ProxyClassCache interceptingProxyClassCache = new ProxyClassCache(
-            new InterceptingProxyClassGenerator() );
+    private static final ProxyClassCache interceptorProxyClassCache = new ProxyClassCache(
+            new InterceptorProxyClassGenerator() );
     private static final ProxyClassCache invocationHandlerProxyClassCache = new ProxyClassCache(
-            new InvocationHandlerProxyClassGenerator() );
+            new InvokerProxyClassGenerator() );
 
 //----------------------------------------------------------------------------------------------------------------------
 // ProxyFactory Implementation
@@ -68,14 +68,14 @@
         }
     }
 
-    public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor interceptor,
+    public Object createInterceptorProxy( ClassLoader classLoader, Object target, Interceptor interceptor,
                                           Class[] proxyClasses )
     {
         try
         {
-            final Class clazz = interceptingProxyClassCache.getProxyClass( classLoader, proxyClasses );
+            final Class clazz = interceptorProxyClassCache.getProxyClass( classLoader, proxyClasses );
             final Method[] methods = AbstractProxyClassGenerator.getImplementationMethods( proxyClasses );
-            return clazz.getConstructor( new Class[]{ Method[].class, Object.class, MethodInterceptor.class } )
+            return clazz.getConstructor( new Class[]{ Method[].class, Object.class, Interceptor.class } )
                     .newInstance( new Object[]{ methods, target, interceptor } );
         }
         catch( Exception e )
@@ -84,15 +84,15 @@
         }
     }
 
-    public Object createInvocationHandlerProxy( ClassLoader classLoader, InvocationHandler invocationHandler,
+    public Object createInvokerProxy( ClassLoader classLoader, Invoker invoker,
                                                 Class[] proxyClasses )
     {
         try
         {
             final Class clazz = invocationHandlerProxyClassCache.getProxyClass( classLoader, proxyClasses );
             final Method[] methods = AbstractProxyClassGenerator.getImplementationMethods( proxyClasses );
-            return clazz.getConstructor( new Class[]{ Method[].class, InvocationHandler.class } )
-                    .newInstance( new Object[]{ methods, invocationHandler } );
+            return clazz.getConstructor( new Class[]{ Method[].class, Invoker.class } )
+                    .newInstance( new Object[]{ methods, invoker } );
         }
         catch( Exception e )
         {
@@ -104,7 +104,7 @@
 // Inner Classes
 //----------------------------------------------------------------------------------------------------------------------
 
-    private static class InvocationHandlerProxyClassGenerator extends AbstractProxyClassGenerator
+    private static class InvokerProxyClassGenerator extends AbstractProxyClassGenerator
     {
         public Class generateProxyClass( ClassLoader classLoader, Class[] proxyClasses )
         {
@@ -114,13 +114,13 @@
                 final Method[] methods = getImplementationMethods( proxyClasses );
                 JavassistUtils.addInterfaces( proxyClass, toInterfaces( proxyClasses ) );
                 JavassistUtils.addField( Method[].class, "methods", proxyClass );
-                JavassistUtils.addField( InvocationHandler.class, "invocationHandler", proxyClass );
+                JavassistUtils.addField( Invoker.class, "invoker", proxyClass );
                 final CtConstructor proxyConstructor = new CtConstructor(
                         JavassistUtils.resolve(
-                                new Class[]{ Method[].class, InvocationHandler.class } ),
+                                new Class[]{ Method[].class, Invoker.class } ),
                         proxyClass );
                 proxyConstructor
-                        .setBody( "{\n\tthis.methods = $1;\n\tthis.invocationHandler = $2; }" );
+                        .setBody( "{\n\tthis.methods = $1;\n\tthis.invoker = $2; }" );
                 proxyClass.addConstructor( proxyConstructor );
                 for( int i = 0; i < methods.length; ++i )
                 {
@@ -128,7 +128,7 @@
                                                           methods[i].getName(),
                                                           JavassistUtils.resolve( methods[i].getParameterTypes() ),
                                                           proxyClass );
-                    final String body = "{\n\t return ( $r ) invocationHandler.invoke( this, methods[" + i +
+                    final String body = "{\n\t return ( $r ) invoker.invoke( this, methods[" + i +
                                         "], $args );\n }";
                     method.setBody( body );
                     proxyClass.addMethod( method );
@@ -142,7 +142,7 @@
         }
     }
 
-    private static class InterceptingProxyClassGenerator extends AbstractProxyClassGenerator
+    private static class InterceptorProxyClassGenerator extends AbstractProxyClassGenerator
     {
         public Class generateProxyClass( ClassLoader classLoader, Class[] proxyClasses )
         {
@@ -153,10 +153,10 @@
                 JavassistUtils.addInterfaces( proxyClass, toInterfaces( proxyClasses ) );
                 JavassistUtils.addField( Method[].class, "methods", proxyClass );
                 JavassistUtils.addField( Object.class, "target", proxyClass );
-                JavassistUtils.addField( MethodInterceptor.class, "interceptor", proxyClass );
+                JavassistUtils.addField( Interceptor.class, "interceptor", proxyClass );
                 final CtConstructor proxyConstructor = new CtConstructor(
                         JavassistUtils.resolve(
-                                new Class[]{ Method[].class, Object.class, MethodInterceptor.class } ),
+                                new Class[]{ Method[].class, Object.class, Interceptor.class } ),
                         proxyClass );
                 proxyConstructor
                         .setBody( "{\n\tthis.methods = $1;\n\tthis.target = $2;\n\tthis.interceptor = $3; }" );
@@ -167,9 +167,9 @@
                                                           methods[i].getName(),
                                                           JavassistUtils.resolve( methods[i].getParameterTypes() ),
                                                           proxyClass );
-                    final Class invocationClass = JavassistMethodInvocation
+                    final Class invocationClass = JavassistInvocation
                             .getMethodInvocationClass( classLoader, methods[i] );
-                    final String body = "{\n\t return ( $r ) interceptor.invoke( new " + invocationClass.getName() +
+                    final String body = "{\n\t return ( $r ) interceptor.intercept( new " + invocationClass.getName() +
                                         "( methods[" + i + "], target, $args ) );\n }";
                     method.setBody( body );
                     proxyClass.addMethod( method );

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatorInvocationHandler.java (from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatingInvocationHandler.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatorInvocationHandler.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatorInvocationHandler.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatingInvocationHandler.java&r1=321183&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatingInvocationHandler.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatorInvocationHandler.java Mon Oct 17 07:11:52 2005
@@ -16,24 +16,34 @@
  */
 package org.apache.commons.proxy.factory.reflect;
 
-import org.apache.commons.proxy.ProxyUtils;
+import org.apache.commons.proxy.ObjectProvider;
 
+import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
 /**
- * An invocation handler which delegates to another object.
+ * An invocation handler which delegates to an object provided by an {@link ObjectProvider}.
  *
  * @author James Carman
  * @version 1.0
  */
-public abstract class DelegatingInvocationHandler extends AbstractInvocationHandler
+class DelegatorInvocationHandler implements InvocationHandler
 {
 //----------------------------------------------------------------------------------------------------------------------
-// Abstract Methods
+// Fields
 //----------------------------------------------------------------------------------------------------------------------
 
-    protected abstract Object getDelegate();
+    private final ObjectProvider delegateProvider;
+
+//----------------------------------------------------------------------------------------------------------------------
+// Constructors
+//----------------------------------------------------------------------------------------------------------------------
+
+    protected DelegatorInvocationHandler( ObjectProvider delegateProvider )
+    {
+        this.delegateProvider = delegateProvider;
+    }
 
 //----------------------------------------------------------------------------------------------------------------------
 // InvocationHandler Implementation
@@ -43,38 +53,12 @@
     {
         try
         {
-            return method.invoke( getDelegate(), args );
+            return method.invoke( delegateProvider.getObject(), args );
         }
         catch( InvocationTargetException e )
         {
             throw e.getTargetException();
         }
-    }
-
-//----------------------------------------------------------------------------------------------------------------------
-// Other Methods
-//----------------------------------------------------------------------------------------------------------------------
-
-    /**
-     * A simplified proxy creation method which merely creates a proxy which supports all the interfaces implemented by
-     * the delegate.
-     *
-     * @return a proxy which supports all the interfaces implemented by the delegate
-     */
-    public Object createProxy()
-    {
-        return createProxy( ProxyUtils.getAllInterfaces( getDelegate().getClass() ) );
-    }
-
-    /**
-     * A simplified proxy creation method which merely creates a proxy which supports all the interfaces implemented by
-     * the delegate, using the specified class loader.
-     *
-     * @return a proxy which supports all the interfaces implemented by the delegate, using the specified class loader.
-     */
-    public Object createProxy( ClassLoader classLoader )
-    {
-        return createProxy( classLoader, ProxyUtils.getAllInterfaces( getDelegate().getClass() ) );
     }
 }
 

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatorInvocationHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/DelegatorInvocationHandler.java
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InterceptorInvocationHandler.java (from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/MethodInterceptorInvocationHandler.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InterceptorInvocationHandler.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InterceptorInvocationHandler.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/MethodInterceptorInvocationHandler.java&r1=321183&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/MethodInterceptorInvocationHandler.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InterceptorInvocationHandler.java Mon Oct 17 07:11:52 2005
@@ -16,30 +16,31 @@
  */
 package org.apache.commons.proxy.factory.reflect;
 
-import org.aopalliance.intercept.MethodInterceptor;
+import org.apache.commons.proxy.Interceptor;
 
 import java.lang.reflect.Method;
+import java.lang.reflect.InvocationHandler;
 
 /**
- * An invocation handler that passes through a <code>MethodInterceptor</code>.
+ * An invocation invoker that passes through a {@link Interceptor}.
  *
  * @author James Carman
  * @version 1.0
  */
-public class MethodInterceptorInvocationHandler extends AbstractInvocationHandler
+class InterceptorInvocationHandler implements InvocationHandler
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Fields
 //----------------------------------------------------------------------------------------------------------------------
 
     private final Object target;
-    private final MethodInterceptor methodInterceptor;
+    private final Interceptor methodInterceptor;
 
 //----------------------------------------------------------------------------------------------------------------------
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public MethodInterceptorInvocationHandler( Object target, MethodInterceptor methodInterceptor )
+    public InterceptorInvocationHandler( Object target, Interceptor methodInterceptor )
     {
         this.target = target;
         this.methodInterceptor = methodInterceptor;
@@ -51,8 +52,8 @@
 
     public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable
     {
-        final ReflectionMethodInvocation invocation = new ReflectionMethodInvocation( target, method, args );
-        return methodInterceptor.invoke( invocation );
+        final ReflectionInvocation invocation = new ReflectionInvocation( target, method, args );
+        return methodInterceptor.intercept( invocation );
     }
 }
 

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InterceptorInvocationHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InterceptorInvocationHandler.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InvokerInvocationHandler.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InvokerInvocationHandler.java?rev=325897&view=auto
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InvokerInvocationHandler.java (added)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InvokerInvocationHandler.java Mon Oct 17 07:11:52 2005
@@ -0,0 +1,58 @@
+/* $Id$
+ *
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.proxy.factory.reflect;
+
+import org.apache.commons.proxy.Invoker;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+/**
+ * Adaptor class to adapt the commons-proxy {@link Invoker} interface to the
+ * {@link InvocationHandler} interface.
+ *
+ * @author James Carman
+ * @version 1.0
+ */
+class InvokerInvocationHandler implements InvocationHandler
+{
+//----------------------------------------------------------------------------------------------------------------------
+// Fields
+//----------------------------------------------------------------------------------------------------------------------
+
+    private final Invoker invoker;
+
+//----------------------------------------------------------------------------------------------------------------------
+// Constructors
+//----------------------------------------------------------------------------------------------------------------------
+
+    public InvokerInvocationHandler( Invoker invoker )
+    {
+        this.invoker = invoker;
+    }
+
+//----------------------------------------------------------------------------------------------------------------------
+// InvocationHandler Implementation
+//----------------------------------------------------------------------------------------------------------------------
+
+
+    public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable
+    {
+        return invoker.invoke( proxy, method, args );
+    }
+}
+

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InvokerInvocationHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/InvokerInvocationHandler.java
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionInvocation.java (from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionMethodInvocation.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionInvocation.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionInvocation.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionMethodInvocation.java&r1=321183&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionMethodInvocation.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionInvocation.java Mon Oct 17 07:11:52 2005
@@ -16,20 +16,19 @@
  */
 package org.apache.commons.proxy.factory.reflect;
 
-import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.proxy.Invocation;
 import org.apache.commons.proxy.ProxyUtils;
 
-import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
 /**
- * A reflection-based implementation of the <code>MethodInvocation</code> interface.
+ * A reflection-based implementation of the {@link Invocation} interface.
  *
  * @author James Carman
  * @version 1.0
  */
-class ReflectionMethodInvocation implements MethodInvocation
+class ReflectionInvocation implements Invocation
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Fields
@@ -43,7 +42,7 @@
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public ReflectionMethodInvocation( Object target, Method method, Object[] arguments )
+    public ReflectionInvocation( Object target, Method method, Object[] arguments )
     {
         this.method = method;
         this.arguments = ( arguments == null ? ProxyUtils.EMPTY_ARGUMENTS : arguments );
@@ -54,21 +53,18 @@
 // Invocation Implementation
 //----------------------------------------------------------------------------------------------------------------------
 
+
     public Object[] getArguments()
     {
         return arguments;
     }
 
-//----------------------------------------------------------------------------------------------------------------------
-// Joinpoint Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
-    public AccessibleObject getStaticPart()
+    public Method getMethod()
     {
         return method;
     }
 
-    public Object getThis()
+    public Object getProxy()
     {
         return target;
     }
@@ -83,15 +79,6 @@
         {
             throw e.getTargetException();
         }
-    }
-
-//----------------------------------------------------------------------------------------------------------------------
-// MethodInvocation Implementation
-//----------------------------------------------------------------------------------------------------------------------
-
-    public Method getMethod()
-    {
-        return method;
     }
 }
 

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionInvocation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionInvocation.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java?rev=325897&r1=325896&r2=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/reflect/ReflectionProxyFactory.java Mon Oct 17 07:11:52 2005
@@ -16,11 +16,11 @@
  */
 package org.apache.commons.proxy.factory.reflect;
 
-import org.aopalliance.intercept.MethodInterceptor;
+import org.apache.commons.proxy.Interceptor;
+import org.apache.commons.proxy.Invoker;
 import org.apache.commons.proxy.ObjectProvider;
 import org.apache.commons.proxy.factory.util.AbstractProxyFactory;
 
-import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
 
 /**
@@ -39,20 +39,20 @@
                                         Class[] proxyClasses )
     {
         return Proxy.newProxyInstance( classLoader, proxyClasses,
-                                       new DelegateProviderInvocationHandler( targetProvider ) );
+                                       new DelegatorInvocationHandler( targetProvider ) );
     }
 
-    public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor interceptor,
+    public Object createInterceptorProxy( ClassLoader classLoader, Object target, Interceptor interceptor,
                                           Class[] proxyClasses )
     {
-        return new MethodInterceptorInvocationHandler( target, interceptor )
-                .createProxy( classLoader, proxyClasses );
+        return Proxy
+                .newProxyInstance( classLoader, proxyClasses, new InterceptorInvocationHandler( target, interceptor ) );
     }
 
-    public Object createInvocationHandlerProxy( ClassLoader classLoader, InvocationHandler invocationHandler,
-                                                Class[] proxyClasses )
+    public Object createInvokerProxy( ClassLoader classLoader, Invoker invoker,
+                                      Class[] proxyClasses )
     {
-        return Proxy.newProxyInstance( classLoader, proxyClasses, invocationHandler );
+        return Proxy.newProxyInstance( classLoader, proxyClasses, new InvokerInvocationHandler( invoker ) );
     }
 }
 

Modified: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java?rev=325897&r1=325896&r2=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/factory/util/AbstractProxyFactory.java Mon Oct 17 07:11:52 2005
@@ -16,12 +16,11 @@
  */
 package org.apache.commons.proxy.factory.util;
 
-import org.aopalliance.intercept.MethodInterceptor;
+import org.apache.commons.proxy.Interceptor;
+import org.apache.commons.proxy.Invoker;
 import org.apache.commons.proxy.ObjectProvider;
 import org.apache.commons.proxy.ProxyFactory;
 
-import java.lang.reflect.InvocationHandler;
-
 /**
  * A helpful superclass for {@link org.apache.commons.proxy.ProxyFactory} implementations.
  *
@@ -58,16 +57,16 @@
         return createDelegatorProxy( Thread.currentThread().getContextClassLoader(), targetProvider, proxyClasses );
     }
 
-    public final Object createInterceptorProxy( Object target, MethodInterceptor interceptor,
+    public final Object createInterceptorProxy( Object target, Interceptor interceptor,
                                                 Class[] proxyClasses )
     {
         return createInterceptorProxy( Thread.currentThread().getContextClassLoader(), target, interceptor,
                                        proxyClasses );
     }
 
-    public final Object createInvocationHandlerProxy( InvocationHandler invocationHandler, Class[] proxyClasses )
+    public final Object createInvokerProxy( Invoker invocationHandler, Class[] proxyClasses )
     {
-        return createInvocationHandlerProxy( Thread.currentThread().getContextClassLoader(), invocationHandler,
+        return createInvokerProxy( Thread.currentThread().getContextClassLoader(), invocationHandler,
                                              proxyClasses );
     }
 }

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorInterceptor.java (from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorInterceptor.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorInterceptor.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java&r1=321183&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorMethodInterceptor.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorInterceptor.java Mon Oct 17 07:11:52 2005
@@ -17,36 +17,36 @@
 package org.apache.commons.proxy.interceptor;
 
 import EDU.oswego.cs.dl.util.concurrent.Executor;
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.proxy.Invocation;
+import org.apache.commons.proxy.Interceptor;
 
 /**
  * A method interceptor that uses an {@link Executor} to execute the method invocation.
  * <p/>
  * <b>Note</b>: Only <em>void</em> methods can be intercepted using this class!  Any attempts to intercept non-void
  * methods will result in an {@link IllegalArgumentException}.  If the proxy interfaces include non-void methods, try
- * using a {@link FilteredMethodInterceptor} along with a
+ * using a {@link FilteredInterceptor} along with a
  * {@link org.apache.commons.proxy.interceptor.filter.ReturnTypeFilter} to wrap an instance of this class.
  *
  * @author James Carman
  * @version 1.0
  */
-public class ExecutorMethodInterceptor implements MethodInterceptor
+public class ExecutorInterceptor implements Interceptor
 {
     private final Executor executor;
 
-    public ExecutorMethodInterceptor( Executor executor )
+    public ExecutorInterceptor( Executor executor )
     {
         this.executor = executor;
     }
 
-    public Object invoke( final MethodInvocation methodInvocation ) throws Throwable
+    public Object intercept( final Invocation invocation ) throws Throwable
     {
-        if( Void.TYPE.equals( methodInvocation.getMethod().getReturnType() ) )
+        if( Void.TYPE.equals( invocation.getMethod().getReturnType() ) )
         {
             // Special case for finalize() method (should not be run in a different thread)...
-            if( !( methodInvocation.getMethod().getName().equals( "finalize" ) &&
-                   methodInvocation.getMethod().getParameterTypes().length == 0 ) )
+            if( !( invocation.getMethod().getName().equals( "finalize" ) &&
+                   invocation.getMethod().getParameterTypes().length == 0 ) )
             {
                 executor.execute( new Runnable()
                 {
@@ -54,7 +54,7 @@
                     {
                         try
                         {
-                            methodInvocation.proceed();
+                            invocation.proceed();
                         }
                         catch( Throwable t )
                         {
@@ -66,7 +66,7 @@
             }
             else
             {
-                return methodInvocation.proceed();
+                return invocation.proceed();
             }
         }
         else

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/ExecutorInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredInterceptor.java (from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredMethodInterceptor.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredInterceptor.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredInterceptor.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredMethodInterceptor.java&r1=321183&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredMethodInterceptor.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredInterceptor.java Mon Oct 17 07:11:52 2005
@@ -16,8 +16,8 @@
  */
 package org.apache.commons.proxy.interceptor;
 
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.proxy.Invocation;
+import org.apache.commons.proxy.Interceptor;
 
 /**
  * Decorates another <code>MethodInterceptor</code> by only calling it if the method is accepted by the supplied
@@ -26,20 +26,20 @@
  * @author James Carman
  * @version 1.0
  */
-public class FilteredMethodInterceptor implements MethodInterceptor
+public class FilteredInterceptor implements Interceptor
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Fields
 //----------------------------------------------------------------------------------------------------------------------
 
-    private final MethodInterceptor inner;
+    private final Interceptor inner;
     private final MethodFilter filter;
 
 //----------------------------------------------------------------------------------------------------------------------
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public FilteredMethodInterceptor( MethodInterceptor inner, MethodFilter filter )
+    public FilteredInterceptor( Interceptor inner, MethodFilter filter )
     {
         this.inner = inner;
         this.filter = filter;
@@ -49,15 +49,15 @@
 // MethodInterceptor Implementation
 //----------------------------------------------------------------------------------------------------------------------
 
-    public Object invoke( MethodInvocation methodInvocation ) throws Throwable
+    public Object intercept( Invocation invocation ) throws Throwable
     {
-        if( filter.accepts( methodInvocation.getMethod() ) )
+        if( filter.accepts( invocation.getMethod() ) )
         {
-            return inner.invoke( methodInvocation );
+            return inner.intercept( invocation );
         }
         else
         {
-            return methodInvocation.proceed();
+            return invocation.proceed();
         }
     }
 }

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/FilteredInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/InterceptorChain.java (from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/InterceptorChain.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/InterceptorChain.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java&r1=321183&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/InterceptorChain.java Mon Oct 17 07:11:52 2005
@@ -16,10 +16,10 @@
  */
 package org.apache.commons.proxy.interceptor;
 
-import org.aopalliance.intercept.MethodInterceptor;
 import org.apache.commons.proxy.ObjectProvider;
 import org.apache.commons.proxy.ProxyFactory;
 import org.apache.commons.proxy.ProxyUtils;
+import org.apache.commons.proxy.Interceptor;
 
 /**
  * A <code>MethodInterceptorChain</code> assists with creating proxies which go through a series of
@@ -28,18 +28,18 @@
  * @author James Carman
  * @version 1.0
  */
-public class MethodInterceptorChain
+public class InterceptorChain
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Fields
 //----------------------------------------------------------------------------------------------------------------------
-    private final MethodInterceptor[] interceptors;
+    private final Interceptor[] interceptors;
 
 //----------------------------------------------------------------------------------------------------------------------
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public MethodInterceptorChain( MethodInterceptor[] interceptors )
+    public InterceptorChain( Interceptor[] interceptors )
     {
         this.interceptors = interceptors;
     }

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/InterceptorChain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/InterceptorChain.java
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingInterceptor.java (from r321332, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingMethodInterceptor.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingInterceptor.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingInterceptor.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingMethodInterceptor.java&r1=321332&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingMethodInterceptor.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingInterceptor.java Mon Oct 17 07:11:52 2005
@@ -16,10 +16,10 @@
  */
 package org.apache.commons.proxy.interceptor;
 
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
 import org.apache.commons.logging.Log;
 import org.apache.commons.proxy.ProxyUtils;
+import org.apache.commons.proxy.Interceptor;
+import org.apache.commons.proxy.Invocation;
 
 /**
  * An interceptor which logs each method invocation.
@@ -29,7 +29,7 @@
  * @author James Carman
  * @version 1.0
  */
-public class LoggingMethodInterceptor implements MethodInterceptor
+public class LoggingInterceptor implements Interceptor
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Fields
@@ -42,7 +42,7 @@
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public LoggingMethodInterceptor( Log log )
+    public LoggingInterceptor( Log log )
     {
         this.log = log;
     }
@@ -51,16 +51,16 @@
 // MethodInterceptor Implementation
 //----------------------------------------------------------------------------------------------------------------------
 
-    public Object invoke( MethodInvocation methodInvocation ) throws Throwable
+    public Object intercept( Invocation invocation ) throws Throwable
     {
         if( log.isDebugEnabled() )
         {
-            final String methodName = methodInvocation.getMethod().getName();
-            entry( methodName, methodInvocation.getArguments() );
+            final String methodName = invocation.getMethod().getName();
+            entry( methodName, invocation.getArguments() );
             try
             {
-                Object result = methodInvocation.proceed();
-                if( Void.TYPE.equals( methodInvocation.getMethod().getReturnType() ) )
+                Object result = invocation.proceed();
+                if( Void.TYPE.equals( invocation.getMethod().getReturnType() ) )
                 {
                     voidExit( methodName );
                 }
@@ -78,7 +78,7 @@
         }
         else
         {
-            return methodInvocation.proceed();
+            return invocation.proceed();
         }
     }
 

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/LoggingInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorAdapter.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorAdapter.java?rev=325897&view=auto
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorAdapter.java (added)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorAdapter.java Mon Oct 17 07:11:52 2005
@@ -0,0 +1,82 @@
+/* $Id$
+ *
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.proxy.interceptor;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.proxy.Interceptor;
+import org.apache.commons.proxy.Invocation;
+
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Method;
+
+/**
+ * An adapter class to adapt AOP Alliance's {@link MethodInterceptor} interface to Commons Proxy's
+ * {@link Interceptor} interface.
+ *
+ * @author James Carman
+ * @version 1.0
+ */
+public class MethodInterceptorAdapter implements Interceptor
+{
+    private final MethodInterceptor methodInterceptor;
+
+    public MethodInterceptorAdapter( MethodInterceptor methodInterceptor )
+    {
+        this.methodInterceptor = methodInterceptor;
+    }
+
+    public Object intercept( Invocation invocation ) throws Throwable
+    {
+        return methodInterceptor.invoke( new MethodInvocationAdapter( invocation ) );
+    }
+
+    private static class MethodInvocationAdapter implements MethodInvocation
+    {
+        private final Invocation invocation;
+
+        public MethodInvocationAdapter( Invocation invocation )
+        {
+            this.invocation = invocation;
+        }
+
+        public Method getMethod()
+        {
+            return invocation.getMethod();
+        }
+
+        public Object[] getArguments()
+        {
+            return invocation.getArguments();
+        }
+
+        public Object proceed() throws Throwable
+        {
+            return invocation.proceed();
+        }
+
+        public Object getThis()
+        {
+            return invocation.getProxy();
+        }
+
+        public AccessibleObject getStaticPart()
+        {
+            return invocation.getMethod();
+        }
+    }
+}

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/MethodInterceptorAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternFilter.java (from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternMethodFilter.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternFilter.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternFilter.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternMethodFilter.java&r1=321183&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternMethodFilter.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternFilter.java Mon Oct 17 07:11:52 2005
@@ -27,19 +27,34 @@
  * @author James Carman
  * @version 1.0
  */
-public class PatternMethodFilter implements MethodFilter
+public class PatternFilter implements MethodFilter
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Fields
 //----------------------------------------------------------------------------------------------------------------------
 
+    public static String GETTER_SETTER_PATTERN = "get\\w+|set\\w+";
     private final String pattern;
 
 //----------------------------------------------------------------------------------------------------------------------
+// Static Methods
+//----------------------------------------------------------------------------------------------------------------------
+
+    /**
+     * Returns a {@link MethodFilter} which accepts only "getters" and "setters."
+     *
+     * @return a {@link MethodFilter} which accepts only "getters" and "setters."
+     */
+    public static MethodFilter getterSetterFilter()
+    {
+        return new PatternFilter( GETTER_SETTER_PATTERN );
+    }
+
+//----------------------------------------------------------------------------------------------------------------------
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public PatternMethodFilter( String pattern )
+    public PatternFilter( String pattern )
     {
         this.pattern = pattern;
     }

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/PatternFilter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleFilter.java (from r321183, jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleFilter.java?p2=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleFilter.java&p1=jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java&r1=321183&r2=325897&rev=325897&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleMethodFilter.java (original)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleFilter.java Mon Oct 17 07:11:52 2005
@@ -29,7 +29,7 @@
  * @author James Carman
  * @version 1.0
  */
-public class SimpleMethodFilter implements MethodFilter
+public class SimpleFilter implements MethodFilter
 {
 //----------------------------------------------------------------------------------------------------------------------
 // Fields
@@ -41,12 +41,12 @@
 // Constructors
 //----------------------------------------------------------------------------------------------------------------------
 
-    public SimpleMethodFilter()
+    public SimpleFilter()
     {
         this.methodNames = new HashSet();
     }
     
-    public SimpleMethodFilter( String[] methodNames )
+    public SimpleFilter( String[] methodNames )
     {
         this.methodNames = new HashSet( Arrays.asList( methodNames ) );
     }

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/interceptor/filter/SimpleFilter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/InvocationHandlerAdapter.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/InvocationHandlerAdapter.java?rev=325897&view=auto
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/InvocationHandlerAdapter.java (added)
+++ jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/InvocationHandlerAdapter.java Mon Oct 17 07:11:52 2005
@@ -0,0 +1,44 @@
+/* $Id$
+ *
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.proxy.invoker;
+
+import org.apache.commons.proxy.Invoker;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationHandler;
+
+/**
+ * An adapter class to adapt the JDK's {@link InvocationHandler} interface to Commons Proxy's
+ * {@link Invoker} interface.
+ *
+ * @author James Carman
+ * @version 1.0
+ */
+public class InvocationHandlerAdapter implements Invoker
+{
+    private final InvocationHandler invocationHandler;
+
+    public InvocationHandlerAdapter( InvocationHandler invocationHandler )
+    {
+        this.invocationHandler = invocationHandler;
+    }
+
+    public Object invoke( Object proxy, Method method, Object[] arguments ) throws Throwable
+    {
+        return invocationHandler.invoke( proxy, method, arguments );
+    }
+}

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/InvocationHandlerAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/proxy/trunk/src/java/org/apache/commons/proxy/invoker/InvocationHandlerAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Id



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message