Package com.thoughtworks.proxy

Examples of com.thoughtworks.proxy.Invoker


      if (type.getDeclaringClass() != null && !Modifier.isStatic(type.getModifiers())) {
            throw new IllegalArgumentException("cannot mock non-static inner class " + type.getName());
        }
     
        return (Mock) new CglibProxyFactory().createProxy(new Class[]{type, Mock.class, ExpectationRegistry.class},
                new Invoker() {
        final ClassMockObject mock = new ClassMockObject(type, name);

            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                try {
                    Class targetClass = method.getDeclaringClass();
View Full Code Here


        if (interfaces == null) {
            interfaces = getInterfaces();
        }

        final ComponentAdapter delegate = getDelegate();
        final Invoker invoker = new ThreadLocalInvoker(pico, delegate);
        return proxyFactory.createProxy(interfaces, invoker);
    }
View Full Code Here

        if (method.equals(ReflectionUtils.equals)) {
            // Note: equals will normally compare the classes directly, so we have to dereference
            // all delegates and then swap the call (in case of our argument is also a delegation proxy).
            final Object arg = args[0];
            while (delegate != null && proxyFactory.isProxyClass(delegate.getClass())) {
                Invoker invoker = proxyFactory.getInvoker(delegate);
                if (invoker instanceof DelegatingInvoker) {
                    delegate = ((DelegatingInvoker)invoker).delegate();
                }
            }
            if (arg == null) {
View Full Code Here

        if (interfaces == null) {
            interfaces = getInterfaces();
        }

        final Invoker invoker = new ThreadLocalInvoker(pico, getDelegate());
        return (T)proxyFactory.createProxy(interfaces, invoker);
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.proxy.Invoker

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.