Package org.springframework.osgi.service.importer.support.internal.aop

Examples of org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker


    if (tcclAdvice != null)
      advices.add(tcclAdvice);

    // 4. add the infrastructure proxy
    // but first create the dispatcher since we need
    ServiceInvoker dispatcherInterceptor = createDispatcherInterceptor(reference);
    Advice infrastructureMixin = new InfrastructureOsgiProxyAdvice(dispatcherInterceptor);

    advices.add(infrastructureMixin);
    advices.add(dispatcherInterceptor);
View Full Code Here


    assertEquals(proxyA, proxyB);
  }

  public void testSpringInfrastructureProxyOnImportersWithTheSameRef() throws Exception {
    Object service = new Object();
    ServiceInvoker invokerA = new ServiceStaticInterceptor(createObjectTrackingBundleContext(service), ref);
    ServiceInvoker invokerB = new ServiceStaticInterceptor(createObjectTrackingBundleContext(service), ref);
    InfrastructureProxy proxyA = new InfrastructureOsgiProxyAdvice(invokerA);
    InfrastructureProxy proxyB = new InfrastructureOsgiProxyAdvice(invokerB);

    // though this is not normal, we want the interceptors to be different to make sure the wrapped object
    // gets properly delegated
View Full Code Here

  }

  public void testSpringInfrastructureProxyOnImportersWithDifferentRefs() throws Exception {
    Object service = new Object();
    BundleContext ctx = createObjectTrackingBundleContext(service);
    ServiceInvoker invokerA = new ServiceStaticInterceptor(ctx, new MockServiceReference());
    ServiceInvoker invokerB = new ServiceStaticInterceptor(ctx, new MockServiceReference());
    InfrastructureProxy proxyA = new InfrastructureOsgiProxyAdvice(invokerA);
    InfrastructureProxy proxyB = new InfrastructureOsgiProxyAdvice(invokerB);

    assertFalse("invokers should not be equal (they have different service references)", invokerA.equals(invokerB));
    assertFalse("proxies should not be equal", proxyA.equals(proxyB));
View Full Code Here

    assertFalse("target objects should not be equal", proxyA.getWrappedObject().equals(proxyB.getWrappedObject()));
  }

  public void testNakedTargetPropertyReturnedByTheInfrastructureProxy() throws Exception {
    Object service = new Object();
    ServiceInvoker invoker = new ServiceStaticInterceptor(createObjectTrackingBundleContext(service), ref);
    InfrastructureProxy proxy = new InfrastructureOsgiProxyAdvice(invoker);
    assertSame(TestUtils.invokeMethod(invoker, "getTarget", null), proxy.getWrappedObject());
    assertSame(service, proxy.getWrappedObject());
  }
View Full Code Here

   *
   * @see junit.framework.TestCase#setUp()
   */
  protected void setUp() throws Exception {
    target = new Object();
    invoker = new ServiceInvoker() {

      protected Object getTarget() {
        return target;
      }

View Full Code Here

TOP

Related Classes of org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker

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.