commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1582563 [3/6] - in /commons/proper/proxy/trunk: asm/src/main/java/org/apache/commons/proxy2/asm/ asm/src/test/java/org/apache/commons/proxy2/asm/ cglib/src/main/java/org/apache/commons/proxy2/cglib/ cglib/src/test/java/org/apache/commons/p...
Date Fri, 28 Mar 2014 00:21:31 GMT
Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/InvocationHandlerAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/InvocationHandlerAdapter.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/InvocationHandlerAdapter.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/InvocationHandlerAdapter.java Fri Mar 28 00:21:29 2014
@@ -1,67 +1,67 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.invoker;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-
-import org.apache.commons.proxy2.Invoker;
-
-/**
- * An adapter class to adapt the JDK's {@link InvocationHandler} interface to Commons Proxy's {@link Invoker} interface.
- * 
- * @since 1.0
- */
-public class InvocationHandlerAdapter implements Invoker
-{
-    /** Serialization version */
-    private static final long serialVersionUID = 1L;
-
-    //******************************************************************************************************************
-    // Fields
-    //******************************************************************************************************************
-
-    private final InvocationHandler invocationHandler;
-
-    //******************************************************************************************************************
-    // Constructors
-    //******************************************************************************************************************
-
-    /**
-     * Create a new InvocationHandlerAdapter instance.
-     * 
-     * @param invocationHandler
-     */
-    public InvocationHandlerAdapter(InvocationHandler invocationHandler)
-    {
-        this.invocationHandler = invocationHandler;
-    }
-
-    //******************************************************************************************************************
-    // Invoker Implementation
-    //******************************************************************************************************************
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] arguments) throws Throwable
-    {
-        return invocationHandler.invoke(proxy, method, arguments);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.invoker;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+import org.apache.commons.proxy2.Invoker;
+
+/**
+ * An adapter class to adapt the JDK's {@link InvocationHandler} interface to Commons Proxy's {@link Invoker} interface.
+ * 
+ * @since 1.0
+ */
+public class InvocationHandlerAdapter implements Invoker
+{
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
+    //******************************************************************************************************************
+    // Fields
+    //******************************************************************************************************************
+
+    private final InvocationHandler invocationHandler;
+
+    //******************************************************************************************************************
+    // Constructors
+    //******************************************************************************************************************
+
+    /**
+     * Create a new InvocationHandlerAdapter instance.
+     * 
+     * @param invocationHandler
+     */
+    public InvocationHandlerAdapter(InvocationHandler invocationHandler)
+    {
+        this.invocationHandler = invocationHandler;
+    }
+
+    //******************************************************************************************************************
+    // Invoker Implementation
+    //******************************************************************************************************************
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Object invoke(Object proxy, Method method, Object[] arguments) throws Throwable
+    {
+        return invocationHandler.invoke(proxy, method, arguments);
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/InvocationHandlerAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/NullInvoker.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/NullInvoker.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/NullInvoker.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/NullInvoker.java Fri Mar 28 00:21:29 2014
@@ -1,55 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.invoker;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-
-import org.apache.commons.proxy2.Invoker;
-import org.apache.commons.proxy2.ProxyUtils;
-
-/**
- * An {@link Invoker} implementation which merely returns null for all method invocations. This class is useful for
- * scenarios where the "null object" design pattern is needed.
- * 
- * @since 1.0
- */
-public class NullInvoker implements Invoker, Serializable
-{
-    /** Serialization version */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Statically available instance.
-     */
-    public static final NullInvoker INSTANCE = new NullInvoker();
-
-    //******************************************************************************************************************
-    // Invoker Implementation
-    //******************************************************************************************************************
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
-    {
-        final Class<?> returnType = method.getReturnType();
-        return ProxyUtils.nullValue(returnType);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.invoker;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+import org.apache.commons.proxy2.Invoker;
+import org.apache.commons.proxy2.ProxyUtils;
+
+/**
+ * An {@link Invoker} implementation which merely returns null for all method invocations. This class is useful for
+ * scenarios where the "null object" design pattern is needed.
+ * 
+ * @since 1.0
+ */
+public class NullInvoker implements Invoker, Serializable
+{
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Statically available instance.
+     */
+    public static final NullInvoker INSTANCE = new NullInvoker();
+
+    //******************************************************************************************************************
+    // Invoker Implementation
+    //******************************************************************************************************************
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+    {
+        final Class<?> returnType = method.getReturnType();
+        return ProxyUtils.nullValue(returnType);
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/NullInvoker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/RecordedInvocation.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/RecordedInvocation.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/RecordedInvocation.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/RecordedInvocation.java Fri Mar 28 00:21:29 2014
@@ -1,149 +1,149 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.invoker;
-
-import java.lang.reflect.Method;
-
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.proxy2.ProxyUtils;
-
-/**
- * Detached representation of a method invocation.
- * 
- */
-public class RecordedInvocation
-{
-    //******************************************************************************************************************
-    // Fields
-    //******************************************************************************************************************
-
-    private final Method invokedMethod;
-    private final Object[] arguments;
-
-    //******************************************************************************************************************
-    // Constructors
-    //******************************************************************************************************************
-
-    /**
-     * Create a new RecordedInvocation instance.
-     * 
-     * @param invokedMethod
-     * @param arguments
-     */
-    public RecordedInvocation(Method invokedMethod, Object[] arguments)
-    {
-        this.invokedMethod = invokedMethod;
-        this.arguments = ArrayUtils.nullToEmpty(ArrayUtils.clone(arguments));
-    }
-
-    //******************************************************************************************************************
-    // Getter/Setter Methods
-    //******************************************************************************************************************
-
-    /**
-     * Get the invokedMethod.
-     * 
-     * @return Method
-     */
-    public Method getInvokedMethod()
-    {
-        return invokedMethod;
-    }
-
-    //******************************************************************************************************************
-    // Canonical Methods
-    //******************************************************************************************************************
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String toString()
-    {
-        StringBuilder buffer = new StringBuilder();
-        buffer.append(invokedMethod.getDeclaringClass().getName());
-        buffer.append(".");
-        buffer.append(invokedMethod.getName());
-        buffer.append("(");
-        int count = arguments.length;
-        for (int i = 0; i < count; i++)
-        {
-            Object arg = arguments[i];
-            if (i > 0)
-            {
-                buffer.append(", ");
-            }
-            convert(buffer, arg);
-        }
-        buffer.append(")");
-        return buffer.toString();
-    }
-
-    //******************************************************************************************************************
-    // Other Methods
-    //******************************************************************************************************************
-
-    /**
-     * Add a string representation of <code>input</code> to <code>buffer</code>.
-     * 
-     * @param buffer
-     * @param input
-     */
-    protected void convert(StringBuilder buffer, Object input)
-    {
-        if (input == null)
-        {
-            buffer.append("<null>");
-            return;
-        }
-
-        // Primitive types, and non-object arrays
-        // use toString().
-        if (!(input instanceof Object[]))
-        {
-            buffer.append(input.toString());
-            return;
-        }
-        buffer.append("(");
-        buffer.append(ProxyUtils.getJavaClassName(input.getClass()));
-        buffer.append("){");
-        Object[] array = (Object[]) input;
-        int count = array.length;
-        for (int i = 0; i < count; i++)
-        {
-            if (i > 0)
-            {
-                buffer.append(", ");
-            }
-            // We use convert() again, because it could be a multi-dimensional array
-            // where each element must be converted.
-            convert(buffer, array[i]);
-        }
-        buffer.append("}");
-    }
-
-    /**
-     * Get the arguments.
-     * 
-     * @return Object[]
-     */
-    public Object[] getArguments()
-    {
-        return ArrayUtils.clone(arguments);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.invoker;
+
+import java.lang.reflect.Method;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.proxy2.ProxyUtils;
+
+/**
+ * Detached representation of a method invocation.
+ * 
+ */
+public class RecordedInvocation
+{
+    //******************************************************************************************************************
+    // Fields
+    //******************************************************************************************************************
+
+    private final Method invokedMethod;
+    private final Object[] arguments;
+
+    //******************************************************************************************************************
+    // Constructors
+    //******************************************************************************************************************
+
+    /**
+     * Create a new RecordedInvocation instance.
+     * 
+     * @param invokedMethod
+     * @param arguments
+     */
+    public RecordedInvocation(Method invokedMethod, Object[] arguments)
+    {
+        this.invokedMethod = invokedMethod;
+        this.arguments = ArrayUtils.nullToEmpty(ArrayUtils.clone(arguments));
+    }
+
+    //******************************************************************************************************************
+    // Getter/Setter Methods
+    //******************************************************************************************************************
+
+    /**
+     * Get the invokedMethod.
+     * 
+     * @return Method
+     */
+    public Method getInvokedMethod()
+    {
+        return invokedMethod;
+    }
+
+    //******************************************************************************************************************
+    // Canonical Methods
+    //******************************************************************************************************************
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String toString()
+    {
+        StringBuilder buffer = new StringBuilder();
+        buffer.append(invokedMethod.getDeclaringClass().getName());
+        buffer.append(".");
+        buffer.append(invokedMethod.getName());
+        buffer.append("(");
+        int count = arguments.length;
+        for (int i = 0; i < count; i++)
+        {
+            Object arg = arguments[i];
+            if (i > 0)
+            {
+                buffer.append(", ");
+            }
+            convert(buffer, arg);
+        }
+        buffer.append(")");
+        return buffer.toString();
+    }
+
+    //******************************************************************************************************************
+    // Other Methods
+    //******************************************************************************************************************
+
+    /**
+     * Add a string representation of <code>input</code> to <code>buffer</code>.
+     * 
+     * @param buffer
+     * @param input
+     */
+    protected void convert(StringBuilder buffer, Object input)
+    {
+        if (input == null)
+        {
+            buffer.append("<null>");
+            return;
+        }
+
+        // Primitive types, and non-object arrays
+        // use toString().
+        if (!(input instanceof Object[]))
+        {
+            buffer.append(input.toString());
+            return;
+        }
+        buffer.append("(");
+        buffer.append(ProxyUtils.getJavaClassName(input.getClass()));
+        buffer.append("){");
+        Object[] array = (Object[]) input;
+        int count = array.length;
+        for (int i = 0; i < count; i++)
+        {
+            if (i > 0)
+            {
+                buffer.append(", ");
+            }
+            // We use convert() again, because it could be a multi-dimensional array
+            // where each element must be converted.
+            convert(buffer, array[i]);
+        }
+        buffer.append("}");
+    }
+
+    /**
+     * Get the arguments.
+     * 
+     * @return Object[]
+     */
+    public Object[] getArguments()
+    {
+        return ArrayUtils.clone(arguments);
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/RecordedInvocation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/recorder/InvocationRecorder.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/recorder/InvocationRecorder.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/recorder/InvocationRecorder.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/recorder/InvocationRecorder.java Fri Mar 28 00:21:29 2014
@@ -1,122 +1,122 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.invoker.recorder;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.commons.lang3.reflect.TypeUtils;
-import org.apache.commons.proxy2.Invoker;
-import org.apache.commons.proxy2.ProxyFactory;
-import org.apache.commons.proxy2.ProxyUtils;
-import org.apache.commons.proxy2.invoker.RecordedInvocation;
-
-/**
- * An {@link InvocationRecorder} records method invocations against its generated proxies.
- * 
- */
-public class InvocationRecorder
-{
-    private final ProxyFactory proxyFactory;
-    private final List<RecordedInvocation> recordedInvocations = new LinkedList<RecordedInvocation>();
-
-    /**
-     * Create a new InvocationRecorder instance.
-     * 
-     * @param proxyFactory
-     */
-    public InvocationRecorder(ProxyFactory proxyFactory)
-    {
-        this.proxyFactory = proxyFactory;
-    }
-
-    /**
-     * Get the invocations that have been recorded up to this point. The list is "live" and should not be modified.
-     * 
-     * @return {@link List} of {@link RecordedInvocation}
-     */
-    public List<RecordedInvocation> getRecordedInvocations()
-    {
-        return recordedInvocations;
-    }
-
-    /**
-     * Generate a recording proxy for the specified class.
-     * 
-     * @param <T>
-     * @param type
-     * @return the generated proxy
-     */
-    public <T> T proxy(Class<T> type)
-    {
-        return proxy(type, type);
-    }
-
-    /**
-     * Generate a recording proxy for the specified class, qualified as <code>genericType</code>.
-     * 
-     * @param <T>
-     * @param genericType
-     * @param type
-     * @return the generated proxy
-     */
-    public <T> T proxy(Type genericType, Class<T> type)
-    {
-        if (proxyFactory.canProxy(type))
-        {
-            return proxyFactory.<T> createInvokerProxy(new InvocationRecorderInvoker(genericType), type);
-        }
-        return ProxyUtils.nullValue(type);
-    }
-
-    private final class InvocationRecorderInvoker implements Invoker
-    {
-        /** Serialization version */
-        private static final long serialVersionUID = 1L;
-
-        private final Type targetType;
-
-        private InvocationRecorderInvoker(Type targetType)
-        {
-            this.targetType = targetType;
-        }
-
-        /**
-         * {@inheritDoc}
-         */
-        @Override
-        public Object invoke(Object o, Method method, Object[] args) throws Throwable
-        {
-            recordedInvocations.add(new RecordedInvocation(method, args));
-            final Class<?> returnType = TypeUtils.getRawType(method.getGenericReturnType(), targetType);
-            //what to do if returnType is null?
-            return proxy(method.getGenericReturnType(), returnType);
-        }
-    }
-
-    /**
-     * Reset this {@link InvocationRecorder}.
-     */
-    public void reset()
-    {
-        recordedInvocations.clear();
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.invoker.recorder;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.commons.lang3.reflect.TypeUtils;
+import org.apache.commons.proxy2.Invoker;
+import org.apache.commons.proxy2.ProxyFactory;
+import org.apache.commons.proxy2.ProxyUtils;
+import org.apache.commons.proxy2.invoker.RecordedInvocation;
+
+/**
+ * An {@link InvocationRecorder} records method invocations against its generated proxies.
+ * 
+ */
+public class InvocationRecorder
+{
+    private final ProxyFactory proxyFactory;
+    private final List<RecordedInvocation> recordedInvocations = new LinkedList<RecordedInvocation>();
+
+    /**
+     * Create a new InvocationRecorder instance.
+     * 
+     * @param proxyFactory
+     */
+    public InvocationRecorder(ProxyFactory proxyFactory)
+    {
+        this.proxyFactory = proxyFactory;
+    }
+
+    /**
+     * Get the invocations that have been recorded up to this point. The list is "live" and should not be modified.
+     * 
+     * @return {@link List} of {@link RecordedInvocation}
+     */
+    public List<RecordedInvocation> getRecordedInvocations()
+    {
+        return recordedInvocations;
+    }
+
+    /**
+     * Generate a recording proxy for the specified class.
+     * 
+     * @param <T>
+     * @param type
+     * @return the generated proxy
+     */
+    public <T> T proxy(Class<T> type)
+    {
+        return proxy(type, type);
+    }
+
+    /**
+     * Generate a recording proxy for the specified class, qualified as <code>genericType</code>.
+     * 
+     * @param <T>
+     * @param genericType
+     * @param type
+     * @return the generated proxy
+     */
+    public <T> T proxy(Type genericType, Class<T> type)
+    {
+        if (proxyFactory.canProxy(type))
+        {
+            return proxyFactory.<T> createInvokerProxy(new InvocationRecorderInvoker(genericType), type);
+        }
+        return ProxyUtils.nullValue(type);
+    }
+
+    private final class InvocationRecorderInvoker implements Invoker
+    {
+        /** Serialization version */
+        private static final long serialVersionUID = 1L;
+
+        private final Type targetType;
+
+        private InvocationRecorderInvoker(Type targetType)
+        {
+            this.targetType = targetType;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public Object invoke(Object o, Method method, Object[] args) throws Throwable
+        {
+            recordedInvocations.add(new RecordedInvocation(method, args));
+            final Class<?> returnType = TypeUtils.getRawType(method.getGenericReturnType(), targetType);
+            //what to do if returnType is null?
+            return proxy(method.getGenericReturnType(), returnType);
+        }
+    }
+
+    /**
+     * Reset this {@link InvocationRecorder}.
+     */
+    public void reset()
+    {
+        recordedInvocations.clear();
+    }
+
+}

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/invoker/recorder/InvocationRecorder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/BeanProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/BeanProvider.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/BeanProvider.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/BeanProvider.java Fri Mar 28 00:21:29 2014
@@ -1,81 +1,81 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.provider;
-
-import java.io.Serializable;
-
-import org.apache.commons.lang3.Validate;
-import org.apache.commons.proxy2.ObjectProvider;
-import org.apache.commons.proxy2.exception.ObjectProviderException;
-
-/**
- * Uses <code>Class.newInstance()</code> to instantiate an object.
- * 
- * @since 1.0
- */
-public class BeanProvider<T> implements ObjectProvider<T>, Serializable
-{
-    /** Serialization version */
-    private static final long serialVersionUID = 1L;
-
-    //******************************************************************************************************************
-    // Fields
-    //******************************************************************************************************************
-
-    private final Class<? extends T> beanClass;
-
-    //******************************************************************************************************************
-    // Constructors
-    //******************************************************************************************************************
-
-    /**
-     * Constructs a provider which instantiates objects of the specified bean class.
-     * 
-     * @param beanClass
-     *            the bean class
-     */
-    public BeanProvider(Class<? extends T> beanClass)
-    {
-        Validate.notNull(beanClass, "Bean class cannot be null.");
-        this.beanClass = beanClass;
-    }
-
-    //******************************************************************************************************************
-    // ObjectProvider Implementation
-    //******************************************************************************************************************
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public T getObject()
-    {
-        try
-        {
-            return beanClass.newInstance();
-        }
-        catch (InstantiationException e)
-        {
-            throw new ObjectProviderException(e, "%s is not concrete.", beanClass);
-        }
-        catch (IllegalAccessException e)
-        {
-            throw new ObjectProviderException(e, "Constructor for %s is not accessible.", beanClass);
-        }
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.provider;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang3.Validate;
+import org.apache.commons.proxy2.ObjectProvider;
+import org.apache.commons.proxy2.exception.ObjectProviderException;
+
+/**
+ * Uses <code>Class.newInstance()</code> to instantiate an object.
+ * 
+ * @since 1.0
+ */
+public class BeanProvider<T> implements ObjectProvider<T>, Serializable
+{
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
+    //******************************************************************************************************************
+    // Fields
+    //******************************************************************************************************************
+
+    private final Class<? extends T> beanClass;
+
+    //******************************************************************************************************************
+    // Constructors
+    //******************************************************************************************************************
+
+    /**
+     * Constructs a provider which instantiates objects of the specified bean class.
+     * 
+     * @param beanClass
+     *            the bean class
+     */
+    public BeanProvider(Class<? extends T> beanClass)
+    {
+        Validate.notNull(beanClass, "Bean class cannot be null.");
+        this.beanClass = beanClass;
+    }
+
+    //******************************************************************************************************************
+    // ObjectProvider Implementation
+    //******************************************************************************************************************
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public T getObject()
+    {
+        try
+        {
+            return beanClass.newInstance();
+        }
+        catch (InstantiationException e)
+        {
+            throw new ObjectProviderException(e, "%s is not concrete.", beanClass);
+        }
+        catch (IllegalAccessException e)
+        {
+            throw new ObjectProviderException(e, "Constructor for %s is not accessible.", beanClass);
+        }
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/BeanProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java Fri Mar 28 00:21:29 2014
@@ -1,84 +1,84 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.provider;
-
-import java.io.Serializable;
-
-import org.apache.commons.lang3.ObjectUtils;
-import org.apache.commons.lang3.Validate;
-import org.apache.commons.lang3.exception.CloneFailedException;
-import org.apache.commons.lang3.reflect.MethodUtils;
-import org.apache.commons.proxy2.ObjectProvider;
-import org.apache.commons.proxy2.exception.ObjectProviderException;
-
-/**
- * Merely calls <code>clone()</code> (reflectively) on the given {@link Cloneable} object.
- * 
- * @since 1.0
- */
-public class CloningProvider<T extends Cloneable> implements ObjectProvider<T>, Serializable
-{
-    /**
-     * Serialization version
-     */
-    private static final long serialVersionUID = 1L;
-
-    //******************************************************************************************************************
-    // Fields
-    //******************************************************************************************************************
-
-    private final T cloneable;
-
-    //******************************************************************************************************************
-    // Constructors
-    //******************************************************************************************************************
-
-    /**
-     * Constructs a provider which returns clone copies of the specified {@link Cloneable} object.
-     * 
-     * @param cloneable
-     *            the object to clone
-     */
-    public CloningProvider(T cloneable)
-    {
-        Validate.notNull(cloneable, "Cloneable object cannot be null.");
-        Validate.isTrue(MethodUtils.getAccessibleMethod(cloneable.getClass(), "clone") != null,
-                String.format("Class %s does not override clone() method as public.", cloneable.getClass().getName()));
-        this.cloneable = cloneable;
-    }
-
-    //******************************************************************************************************************
-    // ObjectProvider Implementation
-    //******************************************************************************************************************
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public T getObject()
-    {
-        try
-        {
-            return ObjectUtils.clone(cloneable);
-        }
-        catch (CloneFailedException e) {
-            throw new ObjectProviderException(e.getMessage(), e.getCause());
-        }
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.provider;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.Validate;
+import org.apache.commons.lang3.exception.CloneFailedException;
+import org.apache.commons.lang3.reflect.MethodUtils;
+import org.apache.commons.proxy2.ObjectProvider;
+import org.apache.commons.proxy2.exception.ObjectProviderException;
+
+/**
+ * Merely calls <code>clone()</code> (reflectively) on the given {@link Cloneable} object.
+ * 
+ * @since 1.0
+ */
+public class CloningProvider<T extends Cloneable> implements ObjectProvider<T>, Serializable
+{
+    /**
+     * Serialization version
+     */
+    private static final long serialVersionUID = 1L;
+
+    //******************************************************************************************************************
+    // Fields
+    //******************************************************************************************************************
+
+    private final T cloneable;
+
+    //******************************************************************************************************************
+    // Constructors
+    //******************************************************************************************************************
+
+    /**
+     * Constructs a provider which returns clone copies of the specified {@link Cloneable} object.
+     * 
+     * @param cloneable
+     *            the object to clone
+     */
+    public CloningProvider(T cloneable)
+    {
+        Validate.notNull(cloneable, "Cloneable object cannot be null.");
+        Validate.isTrue(MethodUtils.getAccessibleMethod(cloneable.getClass(), "clone") != null,
+                String.format("Class %s does not override clone() method as public.", cloneable.getClass().getName()));
+        this.cloneable = cloneable;
+    }
+
+    //******************************************************************************************************************
+    // ObjectProvider Implementation
+    //******************************************************************************************************************
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public T getObject()
+    {
+        try
+        {
+            return ObjectUtils.clone(cloneable);
+        }
+        catch (CloneFailedException e) {
+            throw new ObjectProviderException(e.getMessage(), e.getCause());
+        }
+    }
+
+}

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/CloningProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ConstantProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ConstantProvider.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ConstantProvider.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ConstantProvider.java Fri Mar 28 00:21:29 2014
@@ -1,66 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.provider;
-
-import java.io.Serializable;
-
-import org.apache.commons.proxy2.ObjectProvider;
-
-/**
- * Always returns the same object.
- * 
- * @since 1.0
- */
-public class ConstantProvider<T> implements ObjectProvider<T>, Serializable
-{
-    /** Serialization version */
-    private static final long serialVersionUID = 1L;
-
-    //******************************************************************************************************************
-    // Fields
-    //******************************************************************************************************************
-
-    private final T constant;
-
-    //******************************************************************************************************************
-    // Constructors
-    //******************************************************************************************************************
-
-    /**
-     * Create a new ConstantProvider instance.
-     * 
-     * @param constant
-     */
-    public ConstantProvider(T constant)
-    {
-        this.constant = constant;
-    }
-
-    //******************************************************************************************************************
-    // ObjectProvider Implementation
-    //******************************************************************************************************************
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public T getObject()
-    {
-        return constant;
-    }
-}   
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.provider;
+
+import java.io.Serializable;
+
+import org.apache.commons.proxy2.ObjectProvider;
+
+/**
+ * Always returns the same object.
+ * 
+ * @since 1.0
+ */
+public class ConstantProvider<T> implements ObjectProvider<T>, Serializable
+{
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
+    //******************************************************************************************************************
+    // Fields
+    //******************************************************************************************************************
+
+    private final T constant;
+
+    //******************************************************************************************************************
+    // Constructors
+    //******************************************************************************************************************
+
+    /**
+     * Create a new ConstantProvider instance.
+     * 
+     * @param constant
+     */
+    public ConstantProvider(T constant)
+    {
+        this.constant = constant;
+    }
+
+    //******************************************************************************************************************
+    // ObjectProvider Implementation
+    //******************************************************************************************************************
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public T getObject()
+    {
+        return constant;
+    }
+}   

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ConstantProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/NullProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/NullProvider.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/NullProvider.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/NullProvider.java Fri Mar 28 00:21:29 2014
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.provider;
-
-/**
- * Always returns null.
- * 
- * @since 1.0
- */
-public class NullProvider<T> extends ConstantProvider<T>
-{
-    /** Serialization version */
-    private static final long serialVersionUID = 1L;
-
-    //******************************************************************************************************************
-    // Constructors
-    //******************************************************************************************************************
-
-    /**
-     * Create a new NullProvider instance.
-     */
-    public NullProvider()
-    {
-        super(null);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.provider;
+
+/**
+ * Always returns null.
+ * 
+ * @since 1.0
+ */
+public class NullProvider<T> extends ConstantProvider<T>
+{
+    /** Serialization version */
+    private static final long serialVersionUID = 1L;
+
+    //******************************************************************************************************************
+    // Constructors
+    //******************************************************************************************************************
+
+    /**
+     * Create a new NullProvider instance.
+     */
+    public NullProvider()
+    {
+        super(null);
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/NullProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ObjectProviderUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ProviderDecorator.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ProviderDecorator.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ProviderDecorator.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ProviderDecorator.java Fri Mar 28 00:21:29 2014
@@ -1,82 +1,82 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.provider;
-
-import org.apache.commons.proxy2.ObjectProvider;
-
-/**
- * Returns the result of the inner {@link ObjectProvider provider}. Subclasses can override the {@link #getObject()}
- * method and decorate what comes back from the inner provider in some way (by {@link SingletonProvider caching it} for
- * example).
- * 
- * @since 1.0
- */
-public class ProviderDecorator<T> implements ObjectProvider<T>
-{
-    //******************************************************************************************************************
-    // Fields
-    //******************************************************************************************************************
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * The wrapped {@link ObjectProvider}.
-     */
-    private ObjectProvider<? extends T> inner;
-
-    //******************************************************************************************************************
-    // Constructors
-    //******************************************************************************************************************
-
-    /**
-     * Create a new ProviderDecorator instance.
-     * 
-     * @param inner
-     */
-    public ProviderDecorator(ObjectProvider<? extends T> inner)
-    {
-        this.inner = inner;
-    }
-
-    //******************************************************************************************************************
-    // ObjectProvider Implementation
-    //******************************************************************************************************************
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public T getObject()
-    {
-        return inner.getObject();
-    }
-
-    //******************************************************************************************************************
-    // Getter/Setter Methods
-    //******************************************************************************************************************
-
-    protected ObjectProvider<? extends T> getInner()
-    {
-        return inner;
-    }
-
-    public void setInner(ObjectProvider<? extends T> inner)
-    {
-        this.inner = inner;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.provider;
+
+import org.apache.commons.proxy2.ObjectProvider;
+
+/**
+ * Returns the result of the inner {@link ObjectProvider provider}. Subclasses can override the {@link #getObject()}
+ * method and decorate what comes back from the inner provider in some way (by {@link SingletonProvider caching it} for
+ * example).
+ * 
+ * @since 1.0
+ */
+public class ProviderDecorator<T> implements ObjectProvider<T>
+{
+    //******************************************************************************************************************
+    // Fields
+    //******************************************************************************************************************
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * The wrapped {@link ObjectProvider}.
+     */
+    private ObjectProvider<? extends T> inner;
+
+    //******************************************************************************************************************
+    // Constructors
+    //******************************************************************************************************************
+
+    /**
+     * Create a new ProviderDecorator instance.
+     * 
+     * @param inner
+     */
+    public ProviderDecorator(ObjectProvider<? extends T> inner)
+    {
+        this.inner = inner;
+    }
+
+    //******************************************************************************************************************
+    // ObjectProvider Implementation
+    //******************************************************************************************************************
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public T getObject()
+    {
+        return inner.getObject();
+    }
+
+    //******************************************************************************************************************
+    // Getter/Setter Methods
+    //******************************************************************************************************************
+
+    protected ObjectProvider<? extends T> getInner()
+    {
+        return inner;
+    }
+
+    public void setInner(ObjectProvider<? extends T> inner)
+    {
+        this.inner = inner;
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/ProviderDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/SingletonProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/SingletonProvider.java?rev=1582563&r1=1582562&r2=1582563&view=diff
==============================================================================
--- commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/SingletonProvider.java (original)
+++ commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/SingletonProvider.java Fri Mar 28 00:21:29 2014
@@ -1,73 +1,73 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.proxy2.provider;
-
-import org.apache.commons.proxy2.ObjectProvider;
-
-/**
- * Wraps another object provider, making sure to only call it once, returning the value returned from the wrapped
- * provider on all subsequent invocations.
- * 
- * @since 1.0
- */
-public class SingletonProvider<T> extends ProviderDecorator<T>
-{
-    //******************************************************************************************************************
-    // Fields
-    //******************************************************************************************************************
-
-    private static final long serialVersionUID = 1L;
-
-    private T instance;
-
-    //******************************************************************************************************************
-    // Constructors
-    //******************************************************************************************************************
-
-    /**
-     * Create a new SingletonProvider instance.
-     * 
-     * @param inner
-     */
-    public SingletonProvider(ObjectProvider<? extends T> inner)
-    {
-        super(inner);
-    }
-
-    //******************************************************************************************************************
-    // ObjectProvider Implementation
-    //******************************************************************************************************************
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public T getObject()
-    {
-        synchronized (this)
-        {
-            if (instance == null)
-            {
-                instance = super.getObject();
-                // Garbage collection
-                setInner(null);
-            }
-            return instance;
-        }
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.proxy2.provider;
+
+import org.apache.commons.proxy2.ObjectProvider;
+
+/**
+ * Wraps another object provider, making sure to only call it once, returning the value returned from the wrapped
+ * provider on all subsequent invocations.
+ * 
+ * @since 1.0
+ */
+public class SingletonProvider<T> extends ProviderDecorator<T>
+{
+    //******************************************************************************************************************
+    // Fields
+    //******************************************************************************************************************
+
+    private static final long serialVersionUID = 1L;
+
+    private T instance;
+
+    //******************************************************************************************************************
+    // Constructors
+    //******************************************************************************************************************
+
+    /**
+     * Create a new SingletonProvider instance.
+     * 
+     * @param inner
+     */
+    public SingletonProvider(ObjectProvider<? extends T> inner)
+    {
+        super(inner);
+    }
+
+    //******************************************************************************************************************
+    // ObjectProvider Implementation
+    //******************************************************************************************************************
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public T getObject()
+    {
+        synchronized (this)
+        {
+            if (instance == null)
+            {
+                instance = super.getObject();
+                // Garbage collection
+                setInner(null);
+            }
+            return instance;
+        }
+    }
+}

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/provider/SingletonProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/serialization/ReadResolve.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/serialization/WriteReplace.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/serialization/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/AnnotationBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/AnnotationInvoker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/AnnotationTrainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/AnnotationTypeTrainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/StubBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/StubInterceptorBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/Trainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/proxy/trunk/core/src/main/java/org/apache/commons/proxy2/stub/TrainingContext.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message