commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcar...@apache.org
Subject svn commit: r278737 - 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/reflect/ s...
Date Mon, 05 Sep 2005 13:42:41 GMT
Author: jcarman
Date: Mon Sep  5 06:42:35 2005
New Revision: 278737

URL: http://svn.apache.org/viewcvs?rev=278737&view=rev
Log:
Changing proxy factory method names to be more consistent.

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/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/java/org/apache/commons/proxy/interceptor/MethodInterceptorChain.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java
    jakarta/commons/sandbox/proxy/trunk/xdocs/index.xml

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=278737&r1=278736&r2=278737&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 Sep  5 06:42:35 2005
@@ -42,7 +42,7 @@
      * @param proxyInterfaces  the interfaces that the proxy should implement
      * @return a proxy which delegates to the object provided by the target object provider
      */
-    public Object createDelegatingProxy( ObjectProvider delegateProvider, Class... proxyInterfaces
);
+    public Object createDelegatorProxy( ObjectProvider delegateProvider, Class... proxyInterfaces
);
 
     /**
      * Creates a proxy which delegates to the object provided by <code>delegateProvider</code>.
@@ -52,8 +52,8 @@
      * @param proxyInterfaces  the interfaces that the proxy should implement
      * @return a proxy which delegates to the object provided by the target <code>delegateProvider>
      */
-    public Object createDelegatingProxy( ClassLoader classLoader, ObjectProvider delegateProvider,
-                                         Class... proxyInterfaces );
+    public Object createDelegatorProxy( ClassLoader classLoader, ObjectProvider delegateProvider,
+                                        Class... proxyInterfaces );
 
     /**
      * Creates a proxy which passes through a {@link MethodInterceptor method interceptor}
before eventually reaching
@@ -65,7 +65,7 @@
      * @return a proxy which passes through a {@link MethodInterceptor method interceptor}
before eventually reaching
      *         the <code>target</code> object.
      */
-    public Object createInterceptingProxy( Object target, MethodInterceptor interceptor,
Class... proxyInterfaces );
+    public Object createInterceptorProxy( Object target, MethodInterceptor interceptor, Class...
proxyInterfaces );
     /**
      * Creates a proxy which passes through a {@link org.aopalliance.intercept.MethodInterceptor
method interceptor}
      * before eventually reaching the <code>target</code> object.
@@ -77,8 +77,8 @@
      * @return a proxy which passes through a {@link org.aopalliance.intercept.MethodInterceptor
method interceptor}
      *         before eventually reaching the <code>target</code> object.
      */
-    public Object createInterceptingProxy( ClassLoader classLoader, Object target, MethodInterceptor
interceptor,
-                                           Class... proxyInterfaces );
+    public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor
interceptor,
+                                          Class... proxyInterfaces );
 
     /**
      * Creates a proxy which uses the provided {@link InvocationHandler} to handle all method
invocations.  The proxy

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=278737&r1=278736&r2=278737&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 Sep  5 06:42:35 2005
@@ -41,8 +41,8 @@
 // ProxyFactory Implementation
 //----------------------------------------------------------------------------------------------------------------------
 
-    public Object createDelegatingProxy( ClassLoader classLoader, ObjectProvider targetProvider,
-                                         Class... proxyInterfaces )
+    public Object createDelegatorProxy( ClassLoader classLoader, ObjectProvider targetProvider,
+                                        Class... proxyInterfaces )
     {
         final Enhancer enhancer = new Enhancer();
         enhancer.setClassLoader( classLoader );
@@ -51,8 +51,8 @@
         return enhancer.create();
     }
 
-    public Object createInterceptingProxy( ClassLoader classLoader, Object target, MethodInterceptor
interceptor,
-                                           Class... proxyInterfaces )
+    public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor
interceptor,
+                                          Class... proxyInterfaces )
     {
         final Enhancer enhancer = new Enhancer();
         enhancer.setClassLoader( classLoader );

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=278737&r1=278736&r2=278737&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 Sep  5 06:42:35 2005
@@ -54,8 +54,8 @@
 // ProxyFactory Implementation
 //----------------------------------------------------------------------------------------------------------------------
 
-    public Object createDelegatingProxy( ClassLoader classLoader, ObjectProvider targetProvider,
-                                         Class... proxyInterfaces )
+    public Object createDelegatorProxy( ClassLoader classLoader, ObjectProvider targetProvider,
+                                        Class... proxyInterfaces )
     {
         try
         {
@@ -68,8 +68,8 @@
         }
     }
 
-    public Object createInterceptingProxy( ClassLoader classLoader, Object target, MethodInterceptor
interceptor,
-                                           Class... proxyInterfaces )
+    public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor
interceptor,
+                                          Class... proxyInterfaces )
     {
         try
         {

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=278737&r1=278736&r2=278737&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 Sep  5 06:42:35 2005
@@ -35,15 +35,15 @@
 // ProxyFactory Implementation
 //----------------------------------------------------------------------------------------------------------------------
 
-    public Object createDelegatingProxy( ClassLoader classLoader, ObjectProvider targetProvider,
-                                         Class... proxyInterfaces )
+    public Object createDelegatorProxy( ClassLoader classLoader, ObjectProvider targetProvider,
+                                        Class... proxyInterfaces )
     {
         return Proxy.newProxyInstance( classLoader, proxyInterfaces,
                                        new DelegateProviderInvocationHandler( targetProvider
) );
     }
 
-    public Object createInterceptingProxy( ClassLoader classLoader, Object target, MethodInterceptor
interceptor,
-                                           Class... proxyInterfaces )
+    public Object createInterceptorProxy( ClassLoader classLoader, Object target, MethodInterceptor
interceptor,
+                                          Class... proxyInterfaces )
     {
         return new MethodInterceptorInvocationHandler( target, interceptor )
                 .createProxy( classLoader, proxyInterfaces );

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=278737&r1=278736&r2=278737&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 Sep  5 06:42:35 2005
@@ -56,16 +56,16 @@
 // ProxyFactory Implementation
 //----------------------------------------------------------------------------------------------------------------------
 
-    public final Object createDelegatingProxy( ObjectProvider targetProvider, Class... proxyInterfaces
)
+    public final Object createDelegatorProxy( ObjectProvider targetProvider, Class... proxyInterfaces
)
     {
-        return createDelegatingProxy( Thread.currentThread().getContextClassLoader(), targetProvider,
proxyInterfaces );
+        return createDelegatorProxy( Thread.currentThread().getContextClassLoader(), targetProvider,
proxyInterfaces );
     }
 
-    public final Object createInterceptingProxy( Object target, MethodInterceptor interceptor,
-                                                 Class... proxyInterfaces )
+    public final Object createInterceptorProxy( Object target, MethodInterceptor interceptor,
+                                                Class... proxyInterfaces )
     {
-        return createInterceptingProxy( Thread.currentThread().getContextClassLoader(), target,
interceptor,
-                                        proxyInterfaces );
+        return createInterceptorProxy( Thread.currentThread().getContextClassLoader(), target,
interceptor,
+                                       proxyInterfaces );
     }
 
     public final Object createInvocationHandlerProxy( InvocationHandler invocationHandler,
Class... proxyInterfaces )

Modified: 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/MethodInterceptorChain.java?rev=278737&r1=278736&r2=278737&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/MethodInterceptorChain.java
Mon Sep  5 06:42:35 2005
@@ -56,7 +56,7 @@
         for( int i = interceptors.length - 1; i >= 0; --i )
         {
             currentTarget = proxyFactory
-                    .createInterceptingProxy( classLoader, currentTarget, interceptors[i],
proxyInterfaces );
+                    .createInterceptorProxy( classLoader, currentTarget, interceptors[i],
proxyInterfaces );
         }
         return currentTarget;
     }

Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java?rev=278737&r1=278736&r2=278737&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java
(original)
+++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/factory/AbstractProxyFactoryTestCase.java
Mon Sep  5 06:42:35 2005
@@ -50,7 +50,7 @@
 
     public void testInterfaceHierarchies()
     {
-        final SortedSet<String> set = ( SortedSet<String> ) factory.createDelegatingProxy(
constantProvider( new TreeSet<String>() ), SortedSet.class );
+        final SortedSet<String> set = ( SortedSet<String> ) factory.createDelegatorProxy(
constantProvider( new TreeSet<String>() ), SortedSet.class );
         set.add( "Hello" );
     }
 
@@ -68,7 +68,7 @@
 
     public void testDelegatingProxyInterfaceOrder()
     {
-        final Echo echo = ( Echo ) factory.createDelegatingProxy( singletonProvider( beanProvider(
EchoImpl.class ) ), Echo.class, DuplicateEcho.class );
+        final Echo echo = ( Echo ) factory.createDelegatorProxy( singletonProvider( beanProvider(
EchoImpl.class ) ), Echo.class, DuplicateEcho.class );
         final List<Class> expected = new LinkedList<Class>( Arrays.asList( Echo.class,
DuplicateEcho.class ) );
         final List<Class> actual = new LinkedList<Class>( Arrays.asList( echo.getClass().getInterfaces()
) );
         actual.retainAll( expected );  // Doesn't alter order!
@@ -77,7 +77,7 @@
 
     public void testCreateDelegatingProxy()
     {
-        final Echo echo = ( Echo ) factory.createDelegatingProxy( singletonProvider( beanProvider(
EchoImpl.class ) ), Echo.class );
+        final Echo echo = ( Echo ) factory.createDelegatorProxy( singletonProvider( beanProvider(
EchoImpl.class ) ), Echo.class );
         echo.echo();
         assertEquals( "message", echo.echoBack( "message" ) );
         assertEquals( "ab", echo.echoBack( "a", "b" ) );
@@ -85,14 +85,14 @@
 
     public void testPrimitiveParameter()
     {
-        final Echo echo = ( Echo ) factory.createDelegatingProxy( singletonProvider( beanProvider(
EchoImpl.class ) ), Echo.class );
+        final Echo echo = ( Echo ) factory.createDelegatorProxy( singletonProvider( beanProvider(
EchoImpl.class ) ), Echo.class );
         assertEquals( 1, echo.echoBack( 1 ) );
     }
 
     public void testCreateInterceptorProxy()
     {
-        final Echo target = ( Echo ) factory.createDelegatingProxy( singletonProvider( beanProvider(
EchoImpl.class ) ), Echo.class );
-        final Echo proxy = ( Echo ) factory.createInterceptingProxy( target, new SuffixMethodInterceptor(
" suffix" ), Echo.class );
+        final Echo target = ( Echo ) factory.createDelegatorProxy( singletonProvider( beanProvider(
EchoImpl.class ) ), Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, new SuffixMethodInterceptor(
" suffix" ), Echo.class );
         proxy.echo();
         assertEquals( "message suffix", proxy.echoBack( "message" ) );
     }
@@ -101,7 +101,7 @@
     {
         final MethodInvocationTester tester = new MethodInvocationTester();
         final EchoImpl target = new EchoImpl();
-        final Echo proxy = ( Echo ) factory.createInterceptingProxy( target, tester, Echo.class
);
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, tester, Echo.class
);
         proxy.echo();
         assertNull( tester.arguments );
         assertEquals( Echo.class.getMethod( "echo" ), tester.method );
@@ -124,7 +124,7 @@
     {
         final MethodInvocationTester tester = new MethodInvocationTester();
         final EchoImpl target = new EchoImpl();
-        final Echo proxy = ( Echo ) factory.createInterceptingProxy( target, tester, Echo.class,
DuplicateEcho.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( target, tester, Echo.class,
DuplicateEcho.class );
         proxy.echoBack( "hello" );
         assertEquals( Echo.class.getMethod( "echoBack", String.class ), tester.method );
     }
@@ -134,8 +134,8 @@
     {
         final MethodInvocationTester tester = new MethodInvocationTester();
         final EchoImpl target = new EchoImpl();
-        final Echo proxy1 = ( Echo ) factory.createInterceptingProxy( target, tester, Echo.class
);
-        final Echo proxy2 = ( Echo ) factory.createInterceptingProxy( target, tester, Echo.class,
DuplicateEcho.class );
+        final Echo proxy1 = ( Echo ) factory.createInterceptorProxy( target, tester, Echo.class
);
+        final Echo proxy2 = ( Echo ) factory.createInterceptorProxy( target, tester, Echo.class,
DuplicateEcho.class );
         proxy1.echoBack( "hello1" );
         final Class invocationClass1 = tester.invocationClass;
         proxy2.echoBack( "hello2" );
@@ -144,21 +144,21 @@
 
     public void testDelegatingProxyClassCaching() throws Exception
     {
-        final Echo proxy1 = ( Echo ) factory.createDelegatingProxy( constantProvider( new
EchoImpl() ), Echo.class );
-        final Echo proxy2 = ( Echo ) factory.createDelegatingProxy( constantProvider( new
EchoImpl() ), Echo.class );
+        final Echo proxy1 = ( Echo ) factory.createDelegatorProxy( constantProvider( new
EchoImpl() ), Echo.class );
+        final Echo proxy2 = ( Echo ) factory.createDelegatorProxy( constantProvider( new
EchoImpl() ), Echo.class );
         assertEquals( proxy1.getClass(), proxy2.getClass() );
     }
 
     public void testInterceptingProxyClassCaching() throws Exception
     {
-        final Echo proxy1 = ( Echo ) factory.createInterceptingProxy( new EchoImpl(), new
NoOpMethodInterceptor(), Echo.class );
-        final Echo proxy2 = ( Echo ) factory.createInterceptingProxy( new EchoImpl(), new
NoOpMethodInterceptor(), Echo.class );
+        final Echo proxy1 = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new
NoOpMethodInterceptor(), Echo.class );
+        final Echo proxy2 = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new
NoOpMethodInterceptor(), Echo.class );
         assertEquals( proxy1.getClass(), proxy2.getClass() );
     }
 
     public void testProxyWithCheckedException() throws Exception
     {
-        final Echo proxy = ( Echo ) factory.createDelegatingProxy( constantProvider( new
EchoImpl() ), Echo.class );
+        final Echo proxy = ( Echo ) factory.createDelegatorProxy( constantProvider( new EchoImpl()
), Echo.class );
         try
         {
             proxy.ioException();
@@ -171,7 +171,7 @@
 
     public void testProxyWithUncheckedException() throws Exception
     {
-        final Echo proxy = ( Echo ) factory.createDelegatingProxy( constantProvider( new
EchoImpl() ), Echo.class );
+        final Echo proxy = ( Echo ) factory.createDelegatorProxy( constantProvider( new EchoImpl()
), Echo.class );
         try
         {
             proxy.illegalArgument();
@@ -184,7 +184,7 @@
 
     public void testInterceptorProxyWithUncheckedException() throws Exception
     {
-        final Echo proxy = ( Echo ) factory.createInterceptingProxy( new EchoImpl(), new
NoOpMethodInterceptor(),  Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),
 Echo.class );
         try
         {
             proxy.illegalArgument();
@@ -197,7 +197,7 @@
 
     public void testInterceptorProxyWithCheckedException() throws Exception
     {
-        final Echo proxy = ( Echo ) factory.createInterceptingProxy( new EchoImpl(), new
NoOpMethodInterceptor(),  Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new NoOpMethodInterceptor(),
 Echo.class );
         try
         {
             proxy.ioException();
@@ -210,14 +210,14 @@
 
     public void testWithNonAccessibleTargetType()
     {
-        final Echo proxy = ( Echo ) factory.createInterceptingProxy( new PrivateEcho(), new
NoOpMethodInterceptor(), Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new PrivateEcho(), new
NoOpMethodInterceptor(), Echo.class );
         proxy.echo();
 
     }
 
     public void testChangingArguments()
     {
-        final Echo proxy = ( Echo ) factory.createInterceptingProxy( new EchoImpl(), new
ChangeArgumentInterceptor(), Echo.class );
+        final Echo proxy = ( Echo ) factory.createInterceptorProxy( new EchoImpl(), new ChangeArgumentInterceptor(),
Echo.class );
         assertEquals( "something different", proxy.echoBack( "whatever" ) );
     }
 

Modified: jakarta/commons/sandbox/proxy/trunk/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/proxy/trunk/xdocs/index.xml?rev=278737&r1=278736&r2=278737&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/xdocs/index.xml (original)
+++ jakarta/commons/sandbox/proxy/trunk/xdocs/index.xml Mon Sep  5 06:42:35 2005
@@ -49,9 +49,9 @@
                     <a href="http://www.jboss.org/products/javassist">Javassist</a>.
 Proxy factories allow you to create
                     three different types of proxy objects:
                     <ul>
-                        <li><b>Delegating Proxies</b> - a proxy that merely
delegates each method invocation to an
+                        <li><b>Delegator Proxies</b> - a proxy that merely
delegates each method invocation to an
                             object provided by a object provider.</li>
-                        <li><b>Intercepting Proxies</b> - a proxy that
allows a method interceptor to intercept each
+                        <li><b>Interceptor Proxies</b> - a proxy that allows
a method interceptor to intercept each
                             method invocation.</li>
                         <li><b>Invocation Handler Proxies</b> - a proxy
that uses an
                             <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/InvocationHandler.html">InvocationHandler</a>
object to handle all method



---------------------------------------------------------------------
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