Package com.thoughtworks.proxy.factory

Examples of com.thoughtworks.proxy.factory.CglibProxyFactory$CGLIBInvocationHandlerAdapter


public class FailoverToyExample {

    public static void packageOverviewExample1() {
        Format[] formats = new Format[]{
                NumberFormat.getInstance(), DateFormat.getDateInstance(), new MessageFormat("{1}, {0}"),};
        Format format = (Format)Failover.object(Format.class, new CglibProxyFactory(), formats, RuntimeException.class);
        System.out.println("Format a date: " + format.format(new Date()));
        System.out.println("Format a message: " + format.format(new String[]{"John", "Doe"}));
        System.out.println("Format a number: " + format.format(new Integer(42)));
    }
View Full Code Here


* @author Jörg Schaible
*/
public class CglibMulticastTest extends ProxyTestCase {

    protected ProxyFactory createProxyFactory() {
        return new CglibProxyFactory();
    }
View Full Code Here

*/
public class NullToyExample {

    public static void packageOverviewExample1() {
        try {
            ProxyFactory factory = new CglibProxyFactory();
            File file = (File)Null.object(File.class, factory);
            System.out.println("Length is: " + file.length());
            System.out.println("Exists: " + file.exists());
            System.out.println("Array is empty: " + file.list().length);
            System.out.println("toURL returns null, since URL is final: " + (file.toURL() == null));
View Full Code Here

/**
* @author Aslak Hellesøy
*/
public class CglibHotSwappingTest extends ProxyTestCase {
    protected ProxyFactory createProxyFactory() {
        return new CglibProxyFactory();
    }
View Full Code Here

            public Object decorateResult(Object proxy, Method method, Object[] args, Object result) {
                System.out.println(" ==> " + result);
                return result;
            }
        }, new CglibProxyFactory());
        decoratedFile.exists();
        decoratedFile.isFile();
        decoratedFile.isDirectory();
    }
View Full Code Here

import java.util.List;


public class CglibEchoingTest extends ProxyTestCase {
    protected ProxyFactory createProxyFactory() {
        return new CglibProxyFactory();
    }
View Full Code Here

    public static void packageOverviewExample3() {
        File workingDir = new File(".");
        List files = Arrays.asList(workingDir.list());
        Object multicast = Multicasting.object(
                new Class[]{File.class, List.class}, new CglibProxyFactory(), new Object[]{workingDir, files});
        System.out.println("Current working directory: " + ((File)multicast).getAbsolutePath());
        System.out.println("Files in working directory: " + ((List)multicast).size());
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.proxy.factory.CglibProxyFactory$CGLIBInvocationHandlerAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.