Package org.osgi.service.remoteserviceadmin

Examples of org.osgi.service.remoteserviceadmin.EndpointDescription


            Bundle bundle = osgiImpl.getBundle();
            bundleContext = bundle != null ? bundle.getBundleContext() : null;
        }

        // Notify the endpoint listeners
        EndpointDescription description = createEndpointDescription(bundleContext, endpoint);
        // Set the owning bundle to runtime bundle to avoid NPE
        synchronized (this) {
            endpointDescriptions.put(description, context.getBundle());
            endpointChanged(description, ADDED);
        }
View Full Code Here


            endpointChanged(description, ADDED);
        }
    }

    public void endpointRemoved(Endpoint endpoint) {
        EndpointDescription description = createEndpointDescription(context, endpoint);
        synchronized (this) {
            endpointDescriptions.remove(description);
            endpointChanged(description, REMOVED);
        }
    }
View Full Code Here

        props.put("bundle-symbolicname", rsaBundle.getSymbolicName());
        props.put("bundle-version", rsaBundle.getHeaders().get(Constants.BUNDLE_VERSION));
        props.put("cause", rsaEvent.getException());
        props.put("import.registration", rsaEvent.getImportReference());
        props.put("export.registration", rsaEvent.getExportReference());
        EndpointDescription ep = null;
        if (rsaEvent.getImportReference() != null) {
            ep = rsaEvent.getImportReference().getImportedEndpoint();
        }
        if (rsaEvent.getExportReference() != null) {
            ep = rsaEvent.getExportReference().getExportedEndpoint();
        }
       
        if (ep != null) {
            props.put("endpoint.service.id", ep.getServiceId());
            props.put("endpoint.framework.uuid", ep.getFrameworkUUID());
            props.put("endpoint.id", ep.getId());
            props.put("objectClass", ep.getInterfaces());
            props.put("service.imported.configs", ep.getConfigurationTypes());
            Object bindings = ep.getProperties().get("org.osgi.sca.bindings");
            if (bindings != null) {
                props.put("org.osgi.sca.bindings", bindings);
            }
            Object config = ep.getProperties().get("org.osgi.sca.config.url");
            if (config != null) {
                props.put("org.osgi.sca.config.url", config);
            }
            config = ep.getProperties().get("org.osgi.sca.config.xml");
            if (config != null) {
                props.put("org.osgi.sca.config.xml", config);
            }        }
        props.put("timestamp", Long.valueOf(System.currentTimeMillis()));
        props.put("event", rsaEvent);
View Full Code Here

              // is non-null
              if (discoveredEndpointDescription != null) {
                ed = discoveredEndpointDescription
                    .getEndpointDescription();
                if (ed != null) {
                  EndpointDescription prevEd = isEndpointDescriptionUpdate(
                      ed, serviceID);
                  if (prevEd == null) {
                    if (!contains(ed)) {
                      addEDServiceID(ed, serviceID);
                      handleEndpointDescription(ed, true);
View Full Code Here

            .getProperties();
        Long receivedTS = PropertiesUtil.getOSGiEndpointModifiedValue(edProperties);
        if (receivedTS != null) {
          String receivedId = endpointDescription.getId();
          boolean update = false;
          EndpointDescription ped = null;
          for (EndpointDescription previousEndpoint : getEndpointDescriptions()) {
            ped = previousEndpoint;
            // If the previously discovered endpoint id does not
            // equal
            // the receivedId, then we haven't found it
View Full Code Here

        // We now dispatch both EndpointListenerEvents
        if (eventObject instanceof EndpointListenerEvent) {
          final EndpointListenerEvent event = (EndpointListenerEvent) eventObject;
          final EndpointListener endpointListener = event
              .getEndpointListener();
          final EndpointDescription endpointDescription = event
              .getEndointDescription();
          final String matchingFilter = event.getMatchingFilter();

          try {
            boolean discovered = event.isDiscovered();
View Full Code Here

              .get(this.bundle);
          if (endpointEventHolders != null) {
            for (Iterator<EndpointEventHolder> i = endpointEventHolders
                .iterator(); i.hasNext();) {
              EndpointEventHolder eh = i.next();
              EndpointDescription oldEd = eh.getEndpoint();
              EndpointDescription newEd = event.getEndpoint();
              if (oldEd.equals(newEd))
                i.remove();
            }
            if (endpointEventHolders.size() == 0)
              bundleEndpointEventListenerMap.remove(this.bundle);
View Full Code Here

   
    assertTrue(exportRef != null);
    // remoteServiceAdminEvents should have the Export registration
    assertTrue(remoteServiceAdminEvents.size() > 0);
    // Get ExportReference
    EndpointDescription oldED = exportRef.getExportedEndpoint();
    assertNotNull(oldED);
    Map<String,?> oldEDProperties = oldED.getProperties();
    assertNotNull(oldEDProperties);
    assertTrue("1".equals(oldEDProperties.get("testonekey")));
    assertTrue(oldEDProperties.get("testtwokey")==null);

    // Change testonekey value to "two" and set a new property "testtwokey" to "2"
    props.put("testonekey", "two");
    props.put("testtwokey", "2");
    // Set/update the properties on the registration
    this.registration.setProperties(props);
   
    // Now get new EndpointDescription and test that new properties have been changed in EndpointDescription
    EndpointDescription updatedED = exportRef.getExportedEndpoint();
    assertNotNull(updatedED);
    Map<String,?> updatedEDProperties = updatedED.getProperties();
    assertNotNull(updatedEDProperties);
    assertTrue("two".equals(updatedEDProperties.get("testonekey")));
    assertTrue("2".equals(updatedEDProperties.get("testtwokey")));
   
    Thread.sleep(15000);
View Full Code Here

TOP

Related Classes of org.osgi.service.remoteserviceadmin.EndpointDescription

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.