Skip to content
Permalink
Browse files
use ServiceLoader to find available ProxyFactory implementations
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/proxy/trunk@1582392 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mbenson committed Mar 27, 2014
1 parent 3017615 commit 1cc4c72aceba5cc3a862b98924f9f1a83a5f0b5b
Showing 1 changed file with 5 additions and 9 deletions.
@@ -18,12 +18,8 @@

import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;

import org.apache.commons.proxy2.ProxyFactory;
import org.apache.commons.proxy2.asm.ASMProxyFactory;
import org.apache.commons.proxy2.cglib.CglibProxyFactory;
import org.apache.commons.proxy2.javassist.JavassistProxyFactory;
import org.apache.commons.proxy2.jdk.JdkProxyFactory;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
@@ -40,10 +36,10 @@
public static List<Object[]> createParameters()
{
final List<Object[]> result = new ArrayList<Object[]>();
result.add(new Object[] { new JdkProxyFactory() });
result.add(new Object[] { new CglibProxyFactory() });
result.add(new Object[] { new JavassistProxyFactory() });
result.add(new Object[] { new ASMProxyFactory() });
for (ProxyFactory proxyFactory : ServiceLoader.load(ProxyFactory.class))
{
result.add(new Object[] { proxyFactory });
}
return result;
}

0 comments on commit 1cc4c72

Please sign in to comment.