Examples of ImportedOsgiServiceProxy


Examples of org.springframework.osgi.service.importer.ImportedOsgiServiceProxy

  public void destroy() {
    OsgiListenerUtils.removeServiceListener(context, listener);

    synchronized (serviceProxies) {
      for (Iterator iterator = serviceProxies.iterator(); iterator.hasNext();) {
        ImportedOsgiServiceProxy serviceProxy = (ImportedOsgiServiceProxy) iterator.next();
        ServiceReference ref = serviceProxy.getServiceReference();

        // get first the destruction callback
        ProxyPlusCallback ppc = (ProxyPlusCallback) servicesIdMap.get((Long) ref.getProperty(Constants.SERVICE_ID));
        listener.serviceChanged(new ServiceEvent(ServiceEvent.UNREGISTERING, ref));
View Full Code Here

Examples of org.springframework.osgi.service.importer.ImportedOsgiServiceProxy

      super.setValue(null);
      return;
    }

    if (value instanceof ImportedOsgiServiceProxy) {
      ImportedOsgiServiceProxy serviceProxy = (ImportedOsgiServiceProxy) value;
      super.setValue(serviceProxy.getServiceReference());
      return;
    }

    if (value instanceof ServiceReference) {
      super.setValue(value);
View Full Code Here

Examples of org.springframework.osgi.service.importer.ImportedOsgiServiceProxy

    // look first for service references
    if (o1 instanceof ServiceReference) {
      ref1 = (ServiceReference) o1;
    }
    else {
      ImportedOsgiServiceProxy obj1 = (ImportedOsgiServiceProxy) o1;
      ref1 = obj1.getServiceReference();
    }

    if (o2 instanceof ServiceReference) {
      ref2 = (ServiceReference) o2;
    }
    else {
      ImportedOsgiServiceProxy obj2 = (ImportedOsgiServiceProxy) o2;
      ref2 = obj2.getServiceReference();
    }

    return compare(ref1, ref2);
  }
View Full Code Here

Examples of org.springframework.osgi.service.importer.ImportedOsgiServiceProxy

  public void destroy() {
    OsgiListenerUtils.removeServiceListener(context, listener);

    synchronized (serviceProxies) {
      for (Iterator iterator = serviceProxies.iterator(); iterator.hasNext();) {
        ImportedOsgiServiceProxy serviceProxy = (ImportedOsgiServiceProxy) iterator.next();
        ServiceReference ref = serviceProxy.getServiceReference();

        // get first the destruction callback
        ProxyPlusCallback ppc = (ProxyPlusCallback) servicesIdMap.get((Long) ref.getProperty(Constants.SERVICE_ID));
        listener.serviceChanged(new ServiceEvent(ServiceEvent.UNREGISTERING, ref));
View Full Code Here

Examples of org.springframework.osgi.service.importer.ImportedOsgiServiceProxy

    fb.setCardinality(Cardinality.C_1__1);

    fb.setInterfaces(new Class[] { Date.class });
    fb.afterPropertiesSet();

    ImportedOsgiServiceProxy refAware = null;
    try {
      Object result = fb.getObject();
      assertTrue(result instanceof Date);
      // check it's our object
      assertEquals(time, ((Date) result).getTime());
      assertTrue(result instanceof SpringProxy);
      assertTrue(result instanceof ImportedOsgiServiceProxy);
      assertTrue(result instanceof InfrastructureProxy);

      refAware = (ImportedOsgiServiceProxy) result;
      assertNotNull(refAware.getServiceReference());

      assertEquals("wrong target returned", date, ((InfrastructureProxy) result).getWrappedObject());
    }
    finally {
      if (reg != null)
        reg.unregister();
    }

    // test reference after the service went down
    assertNotNull(refAware.getServiceReference());
    assertNull(refAware.getServiceReference().getBundle());
  }
View Full Code Here

Examples of org.springframework.osgi.service.importer.ImportedOsgiServiceProxy

      Object result = fb.getObject();
      assertTrue(result instanceof Date);
      // check it's our object
      assertEquals(time, ((Date) result).getTime());

      ImportedOsgiServiceProxy refAware = (ImportedOsgiServiceProxy) result;

      assertTrue(doesMapContainsDictionary(dict,
        OsgiServiceReferenceUtils.getServicePropertiesAsMap(refAware.getServiceReference())));

      InfrastructureProxy targetAware = (InfrastructureProxy) result;
      assertEquals(date, targetAware.getWrappedObject());
    }
    finally {
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.