Package org.apache.aries.proxy.impl

Examples of org.apache.aries.proxy.impl.SingleInstanceDispatcher


  @Override
  protected Object getProxyInstance(Class<?> proxyClass,
      InvocationListener listener) {
    AbstractProxyManager apm = new AsmProxyManager();
    return getProxyInstance(proxyClass, new ProxyHandler(apm, new SingleInstanceDispatcher(getProxyInstance(proxyClass)), listener))
  }
View Full Code Here


   
    assertFalse("Should not be equal", p1.equals(p2));
   
    Object p3 = getP3();
   
    p1 = setDelegate(p1, new SingleInstanceDispatcher(p3));
    p2 = setDelegate(p2, new SingleInstanceDispatcher(p3));
   
    assertTrue("Should be equal", p1.equals(p2));
   
    Object p4 = getProxyInstance(getProxyClass(getTestClass()));
    Object p5 = getProxyInstance(getProxyClass(getTestClass()));
   
    p4 = setDelegate(p4, new SingleInstanceDispatcher(p1));
    p5 = setDelegate(p5, new SingleInstanceDispatcher(p2));
   
    assertTrue("Should be equal", p4.equals(p5));
  }
View Full Code Here

  @Override
  protected Object getProxyInstance(Class<?> proxyClass,
      InvocationListener listener) {
    WovenProxy proxy = (WovenProxy) getProxyInstance(proxyClass);
    proxy = proxy.org_apache_aries_proxy_weaving_WovenProxy_createNewProxyInstance(
        new SingleInstanceDispatcher(proxy), listener);
    return proxy;
  }
View Full Code Here

   * Test a covariant override method
   */
  @Test
  public void testCovariant() throws Exception
  {
    testCallable = new SingleInstanceDispatcher(COVARIANT_CLASS.newInstance());
    Object o = setDelegate(getProxyInstance(getProxyClass(COVARIANT_CLASS)), testCallable);
    Class<?> generatedProxySubclass = o.getClass();
    Method m = generatedProxySubclass.getDeclaredMethod("getCovariant", new Class[] {});
    Object returned = m.invoke(o);
    assertTrue("Object was of wrong type: " + returned.getClass().getSimpleName(), COVARIANT_CLASS
View Full Code Here

   * Test a covariant override method
   */
  @Test
  public void testGenerics() throws Exception
  {
    testCallable = new SingleInstanceDispatcher(GENERIC_CLASS.newInstance());
    super.testGenerics();
  }
View Full Code Here

    }
   
    try {
      Constructor<?> con = proxyClass.getDeclaredConstructor(Callable.class, InvocationListener.class);
      con.setAccessible(true);
      return con.newInstance((testCallable == null) ? new SingleInstanceDispatcher(getTestClass().newInstance()) : testCallable, null);
    } catch (Exception e) {
      return null;
    }
  }
View Full Code Here

  @Override
  protected Object getProxyInstance(Class<?> proxyClass,
      InvocationListener listener) {
    WovenProxy proxy = (WovenProxy) getProxyInstance(proxyClass);
    proxy = proxy.org_apache_aries_proxy_weaving_WovenProxy_createNewProxyInstance(
        new SingleInstanceDispatcher(proxy), listener);
    return proxy;
  }
View Full Code Here

    }
   
    try {
      Constructor<?> con = proxyClass.getDeclaredConstructor(Callable.class, InvocationListener.class);
      con.setAccessible(true);
      return con.newInstance((testCallable == null) ? new SingleInstanceDispatcher(super.getProxyInstance(proxyClass.getSuperclass())) : testCallable, null);
    } catch (Exception e) {
      return null;
    }
  }
View Full Code Here

  @Override
  protected Object getProxyInstance(Class<?> proxyClass,
      InvocationListener listener) {
    WovenProxy proxy = (WovenProxy) getProxyInstance(proxyClass);
    proxy = proxy.org_apache_aries_proxy_weaving_WovenProxy_createNewProxyInstance(
        new SingleInstanceDispatcher(proxy), listener);
    return proxy;
  }
View Full Code Here

  @Override
  protected Object getProxyInstance(Class<?> proxyClass,
      InvocationListener listener) {
    AbstractProxyManager apm = new AsmProxyManager();
    return getProxyInstance(proxyClass, new ProxyHandler(apm, new SingleInstanceDispatcher(getProxyInstance(proxyClass)), listener))
  }
View Full Code Here

TOP

Related Classes of org.apache.aries.proxy.impl.SingleInstanceDispatcher

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.