Package com.thoughtworks.proxy.factory

Examples of com.thoughtworks.proxy.factory.StandardProxyFactory


     * @param out the PrintWriter receiving the output
     * @return the generated proxy
     * @since 0.1
     */
    public static Object object(final Class type, final Object impl, final PrintWriter out) {
        return object(type, impl, out, new StandardProxyFactory());
    }
View Full Code Here


     * @param targets the target objects
     * @return the new proxy implementing {@link Multicast} or the only target
     * @since 0.1
     */
    public static Object object(final Object[] targets) {
        return object(new StandardProxyFactory(), targets);
    }
View Full Code Here

    }

    public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
        if (method.equals(ReflectionUtils.equals)) {
            final Object arg = args[0];
            if (new StandardProxyFactory().isProxyClass(arg.getClass())
                    && ((InvokerReference)arg).getInvoker() instanceof DispatchingInvoker) {
                final DispatchingInvoker invoker = (DispatchingInvoker)((InvokerReference)arg).getInvoker();
                if (new HashSet(types).equals(new HashSet(invoker.types))) {
                    boolean isEqual = true;
                    for (int i = 0; isEqual && i < types.size(); ++i) {
View Full Code Here

     * @param delegates the objects, that will receive the calls
     * @return the created proxy
     * @since 0.2
     */
    public static Object object(final Class[] types, final Object[] delegates) {
        return object(types, delegates, new StandardProxyFactory());
    }
View Full Code Here

     * @param delegate the object the proxy delegates to.
     * @return a new proxy of the specified type.
     * @since 0.1
     */
    public static Object object(final Class type, final Object delegate) {
        return object(type, delegate, new StandardProxyFactory());
    }
View Full Code Here

     * @return a new proxy of the specified type.
     * @throws IllegalArgumentException if the <tt>delegationMode</tt> is not one of the predefined constants
     * @since 0.2
     */
    public static Object object(final Class type, final Object delegate, final int delegationMode) {
        return object(type, delegate,new StandardProxyFactory(),delegationMode);
    }
View Full Code Here

     *
     * @param delegate the delegated object
     * @since 0.1
     */
    public DelegatingInvoker(final Object delegate) {
        this(new StandardProxyFactory(), new SimpleReference(delegate), Delegating.MODE_SIGNATURE);
    }
View Full Code Here

     * @return object, proxy or <code>null</code>
     * @see com.thoughtworks.proxy.toys.nullobject
     * @since 0.1
     */
    public static Object object(final Class type) {
        return object(type, new StandardProxyFactory());
    }
View Full Code Here

     * @param object the object to examine
     * @return <code>true</code> if the object is a Null proxy.
     * @since 0.1
     */
    public static boolean isNullObject(final Object object) {
        return isNullObject(object, new StandardProxyFactory());
    }
View Full Code Here

    public static Test suite() {
        TestSuite suite = new TestSuite("Test for com.thoughtworks.proxy");

        // Tests based on ProxyTestCase with different factories
        suite.addTest(createProxyFactorySuite(new StandardProxyFactory(), "Standard"));
        suite.addTest(createProxyFactorySuite(new CglibProxyFactory(), "Cglib"));

        // CGLIB-specific tests
        suite.addTestSuite(CglibProxyFactoryTest.class);
        suite.addTestSuite(CglibEchoingTest.class);
View Full Code Here

TOP

Related Classes of com.thoughtworks.proxy.factory.StandardProxyFactory

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.