Package org.springframework.osgi.service.util.internal.aop

Examples of org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor


   */
  private Object wrapWithClassLoaderManagingProxy(final Object target, Class[] interfaces) {
    try {

      return ProxyUtils.createProxy(interfaces, target, aopClassLoader, bundleContext,
        new Advice[] { new ServiceTCCLInterceptor(classLoader) });
    }
    catch (Throwable th) {
      log.error("Cannot create TCCL managed proxy; falling back to the naked object", th);
      if (th instanceof NoClassDefFoundError) {
        NoClassDefFoundError ncdfe = (NoClassDefFoundError) th;
View Full Code Here


   * @return
   */
  private Object createCLLProxy(final Object target) {
    try {
      return ProxyUtils.createProxy(classes, target, aopClassLoader, bundleContext,
        new Advice[] { new ServiceTCCLInterceptor(classLoader) });
    }
    catch (Throwable th) {
      log.error("Cannot create TCCL managed proxy; falling back to the naked object", th);
      if (th instanceof NoClassDefFoundError) {
        NoClassDefFoundError ncdfe = (NoClassDefFoundError) th;
View Full Code Here

    // if reference is dead already, it's impossible to provide the service
    // class loader
    if (bundle == null)
      return null;

    return new ServiceTCCLInterceptor(ClassLoaderFactory.getBundleClassLoaderFor(bundle));
  }
View Full Code Here

    this.classes = classes;
    this.bundleContext = bundleContext;
    this.classLoader = aopClassLoader;
    this.iccl = iccl;

    clientTCCLAdvice = new ServiceTCCLInterceptor(bundleClassLoader);
    invokerBundleContextAdvice = new LocalBundleContextAdvice(bundleContext);
  }
View Full Code Here

    target = new Polygon();

    Advice interceptorA1 = createInterceptorWOServiceRequired();

    Advice interceptorA2 = new LocalBundleContextAdvice(bundleContext);
    Advice interceptorA3 = new ServiceTCCLInterceptor(null);

    Advice interceptorB1 = createInterceptorWOServiceRequired();
    Advice interceptorB2 = new LocalBundleContextAdvice(bundleContext);
    Advice interceptorB3 = new ServiceTCCLInterceptor(null);

    Object proxyA = createProxy(target, Shape.class, new Advice[] { interceptorA1, interceptorA2, interceptorA3 });
    Object proxyB = createProxy(target, Shape.class, new Advice[] { interceptorB1, interceptorB2, interceptorB3 });

    assertFalse(proxyA == proxyB);
View Full Code Here

  public void testDifferentProxySetupButTargetHasEquals() throws Exception {
    target = new Implementor();

    Advice interceptorA1 = new LocalBundleContextAdvice(bundleContext);
    Advice interceptorB1 = new ServiceTCCLInterceptor(null);

    InterfaceWithEquals proxyA = (InterfaceWithEquals) createProxy(target, InterfaceWithEquals.class,
      new Advice[] { interceptorA1 });
    InterfaceWithEquals proxyB = (InterfaceWithEquals) createProxy(target, InterfaceWithEquals.class,
      new Advice[] { interceptorB1 });
View Full Code Here

TOP

Related Classes of org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor

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.