Package org.apache.aries.proxy

Examples of org.apache.aries.proxy.ProxyManager.createProxy()


    // classes so it needs to be
    // wrapping the service provider bundle. The class is actually defined
    // on this adapter.

    try {
      return proxyManager.createProxy(serviceProviderBundle, clazz, ih);
    } catch (UnableToProxyException e) {
      throw new IllegalArgumentException(e);
    } catch (RuntimeException e) {
      throw new IllegalArgumentException("Unable to create proxy for " + pair.ref, e);
    }
View Full Code Here


    Callable<Object> c2 = new TestCallable();
    ((List<Object>)c2.call()).add("Some test data");
   
    Collection<Class<?>> classes = new ArrayList<Class<?>>();
    classes.add(List.class);
    Object proxy = mgr.createProxy(b, classes, c);
    Object otherProxy = mgr.createProxy(b, classes, c);
    Object totallyOtherProxy = mgr.createProxy(b, classes, c2);
    assertTrue("The object is not equal to itself", proxy.equals(proxy));
    assertTrue("The object is not equal to another proxy of itself", proxy.equals(otherProxy));
    assertFalse("The object is equal to proxy to another object", proxy.equals(totallyOtherProxy));
View Full Code Here

    ((List<Object>)c2.call()).add("Some test data");
   
    Collection<Class<?>> classes = new ArrayList<Class<?>>();
    classes.add(List.class);
    Object proxy = mgr.createProxy(b, classes, c);
    Object otherProxy = mgr.createProxy(b, classes, c);
    Object totallyOtherProxy = mgr.createProxy(b, classes, c2);
    assertTrue("The object is not equal to itself", proxy.equals(proxy));
    assertTrue("The object is not equal to another proxy of itself", proxy.equals(otherProxy));
    assertFalse("The object is equal to proxy to another object", proxy.equals(totallyOtherProxy));
  }
View Full Code Here

   
    Collection<Class<?>> classes = new ArrayList<Class<?>>();
    classes.add(List.class);
    Object proxy = mgr.createProxy(b, classes, c);
    Object otherProxy = mgr.createProxy(b, classes, c);
    Object totallyOtherProxy = mgr.createProxy(b, classes, c2);
    assertTrue("The object is not equal to itself", proxy.equals(proxy));
    assertTrue("The object is not equal to another proxy of itself", proxy.equals(otherProxy));
    assertFalse("The object is equal to proxy to another object", proxy.equals(totallyOtherProxy));
  }
 
View Full Code Here

    Bundle b = FrameworkUtil.getBundle(this.getClass());
    Callable<Object> c = new TestCallable();
    Collection<Class<?>> classes = new ArrayList<Class<?>>();
    classes.add(TestCallable.class);
    try {
      mgr.createProxy(b, classes, c);
    } catch (FinalModifierException e) {
      String msg = e.getMessage();
      assertEquals("The message didn't look right", "The class " + TestCallable.class.getName() + " is final.", msg);
      assertTrue("The message didn't appear in the toString", e.toString().endsWith(msg));
    }
View Full Code Here

      public final void run() {
      }
    };
    classes.add(r.getClass());
    try {
      mgr.createProxy(b, classes, c);
    } catch (FinalModifierException e) {
      assertTrue("The methods didn't appear in the message", e.getMessage().contains("run"));
    }
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.