Package org.osgi.service.remoteserviceadmin

Examples of org.osgi.service.remoteserviceadmin.EndpointDescription


            "myClass"
        });
        props.put(RemoteConstants.ENDPOINT_ID, "http://google.de:80/test");
        props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "myConfig");

        EndpointDescription ed = new EndpointDescription(props);

        eli.endpointAdded(ed, null);
        eli.endpointAdded(ed, null)// should do nothing

        eli.endpointRemoved(ed, null);
View Full Code Here


            "myClass"
        });
        props.put(RemoteConstants.ENDPOINT_ID, "http://google.de:80/test");
        props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "myConfig");

        EndpointDescription ed = new EndpointDescription(props);

        eli.endpointAdded(ed, null);

        eli.close(); // should result in zk.delete(...)
       
View Full Code Here

        }
        if (!props.containsKey(ENDPOINT_ID)) {
            props.put(ENDPOINT_ID, UUID.randomUUID().toString());
        }

        EndpointDescription sed = new EndpointDescription(props);
        return sed;
    }
View Full Code Here

        this.extenders.add(extender);

        // Notify
        for (ServiceDescriptions sds : extender.getRemoteServiceDescriptions()) {
            for (ServiceDescription sd : sds) {
                EndpointDescription sed = createEndpointDescription(sd);
                endpointDescriptions.put(sed, bundle);
                serviceDescriptionAdded(sed);
            }
        }
View Full Code Here

            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

public class EndpointHelper {
    private EndpointHelper() {
    }

    public static EndpointDescription createEndpointDescription(BundleContext bundleContext, Endpoint endpoint) {
        return new EndpointDescription(getProperties(bundleContext, endpoint));
    }
View Full Code Here

            }

            Map<String, Object> props = new HashMap<String, Object>(endpoint.getProperties());
            props.put(Bundle.class.getName(), bundle);
            props.put(Constants.OBJECTCLASS, new String[] {interfaceClass.getName()});
            EndpointDescription description = new EndpointDescription(props);

            if (admins != null) {
                for (Object ra : admins) {
                    RemoteServiceAdmin remoteAdmin = (RemoteServiceAdmin)ra;
                    ImportRegistration importRegistration = remoteAdmin.importService(description);
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

                // FIXME: Configure the domain and node URI
                NodeImpl node = new NodeImpl(nodeFactory, configuration, Collections.singletonList(contribution));
                node.start();
                List<ExportRegistration> exportedServices = new ArrayList<ExportRegistration>();
                for (Endpoint endpoint : service.getEndpoints()) {
                    EndpointDescription endpointDescription = createEndpointDescription(context, endpoint);
                    synchronized (this) {
                        ExportReferenceImpl exportReference = exportReferences.get(endpointDescription);
                        if (exportReference == null) {
                            exportReference = new ExportReferenceImpl(node, reference, endpointDescription);
                        }
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.