Package org.osgi.service.remoteserviceadmin

Examples of org.osgi.service.remoteserviceadmin.EndpointDescription


        final Set<String> actualEndpoints = new HashSet<String>();
        el.endpointAdded((EndpointDescription) EasyMock.anyObject(),
                EasyMock.eq("(|(objectClass=org.example.ClassA)(objectClass=org.example.ClassB))"));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                EndpointDescription ed = (EndpointDescription) EasyMock.getCurrentArguments()[0];
                actualEndpoints.addAll(ed.getInterfaces());
                return null;
            }
        }).times(2);
        EasyMock.replay(el);
View Full Code Here


        if (irs.size() > 0) { // remove old services that are not available anymore
            List<EndpointDescription> ips = importPossibilities.get(filter);
            Iterator<ImportRegistration> it = irs.iterator();
            while (it.hasNext()) {
                ImportRegistration ir = it.next();
                EndpointDescription ep = ir.getImportReference().getImportedEndpoint();

                // if service is already imported, check if endpoint is still in the list of
                // possible imports
                if ((ips != null && !ips.contains(ep)) || ips == null) {
                    // unexport service
View Full Code Here

            List<EndpointDescription> ips = importPossibilities.get(filter);

            Iterator<ImportRegistration> it = irs.iterator();
            while (it.hasNext()) {
                ImportRegistration ir = it.next();
                EndpointDescription ep = ir.getImportReference().getImportedEndpoint();

                // if service is already imported, check if endpoint is still in the list of
                // possible imports
                if ((ips != null && !ips.contains(ep)) || ips == null) {
                    // unexport service
View Full Code Here

        if (sref != null) {
            synchronized (exportedServices) {

                HashMap<RemoteServiceAdmin, Collection<ExportRegistration>> ex = exportedServices.get(sref);
                if (ex != null) {
                    EndpointDescription ep = exportRegistration.getExportReference().getExportedEndpoint();
                    for (Map.Entry<RemoteServiceAdmin, Collection<ExportRegistration>> export : ex.entrySet()) {
                        export.getValue().contains(exportRegistration);
                    }
                }
            }
View Full Code Here

            // The properties for the EndpointDescription
            Map<String, Object> endpointProps = createEndpointProps(sd, iClass, new String[] {
                Constants.WS_CONFIG_TYPE
            }, address,intents);
            EndpointDescription endpdDesc = null;
           
            Thread.currentThread().setContextClassLoader(ServerFactoryBean.class.getClassLoader());
            Server server = factory.create();
           
            // TODO: does this still make sense ?!?
            registerStopHook(bus, httpService, server, contextRoot, Constants.WS_HTTP_SERVICE_CONTEXT);
           
            endpdDesc = new EndpointDescription(endpointProps);
            exportRegistration.setServer(server);
    
            // add the information on the new Endpoint to the export registration
            exportRegistration.setEndpointdescription(endpdDesc);
        } catch (IntentUnsatifiedException iue) {
View Full Code Here

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(RemoteConstants.ENDPOINT_ID, "http://google.de/");
        props.put(org.osgi.framework.Constants.OBJECTCLASS, new String[] { "my.class" });
        props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, new String[] { "my.config" });
        EndpointDescription endpoint = new EndpointDescription(props);

        cpfb.setAddress((String) EasyMock.eq(props.get(RemoteConstants.ENDPOINT_ID)));
        EasyMock.expectLastCall().atLeastOnce();

        cpfb.setServiceClass(EasyMock.eq(CharSequence.class));
View Full Code Here

        return rsaCore.getImportedEndpoints();
    }

    public ImportRegistration importService(EndpointDescription endpoint) {

        final EndpointDescription epd = endpoint;

        SecurityManager sm = System.getSecurityManager();
        EndpointPermission epp = new EndpointPermission(epd, OsgiUtils.getUUID(bctx),
                                                        EndpointPermission.IMPORT);
        if (sm != null) {
View Full Code Here

           
            // The properties for the EndpointDescription
            Map<String, Object> endpointProps = createEndpointProps(sd, iClass, new String[] {
                Constants.RS_CONFIG_TYPE
            }, address,intents);
            EndpointDescription endpdDesc = null;
           
           
            Thread.currentThread().setContextClassLoader(JAXRSServerFactoryBean.class.getClassLoader());
            Server server = factory.create();
            registerStopHook(bus, httpService, server, contextRoot, Constants.RS_HTTP_SERVICE_CONTEXT);

            endpdDesc = new EndpointDescription(endpointProps);
            exportRegistration.setServer(server);
           
            // add the information on the new Endpoint to the export registration
            exportRegistration.setEndpointdescription(endpdDesc);
        } catch (IntentUnsatifiedException iue) {
View Full Code Here

        LOG.fine("processChildren done nodes that are missing now and need to be removed: "
                 + prevNodes.values());

        for (Map<String, Object> props : prevNodes.values()) {
            // whatever's left in prevNodes now has been removed from Discovery
            EndpointDescription epd = new EndpointDescription(props);

            //notifyListeners(epd, true);

            for (ServiceReference sref : discoveredServiceTracker.relatedServiceListeners) {
                if (bctx.getService(sref) instanceof EndpointListener) {
View Full Code Here

            }
            byte[] data = zookeeper.getData(node, false, null);
            LOG.info("Child: " + node);

            List<Element> elements = LocalDiscoveryUtils.getElements(new ByteArrayInputStream(data));
            EndpointDescription epd = null;
            if (elements.size() > 0)
                epd = LocalDiscoveryUtils.getEndpointDescription(elements.get(0));
            else {
                LOG.warning("No Discovery information found for node: " + node);
                return null;
            }

            LOG.finest("Properties: " + epd.getProperties());

            if (prevVal == null) {
                // This guy is new
                 notifyListeners(epd, false);

            } else if (!prevVal.equals(epd.getProperties())) {
                // TODO
            }

            return epd.getProperties();
        } catch (Exception e) {
            LOG.log(Level.SEVERE, "Problem processing Zookeeper callback: " + e.getMessage(), e);
        }

        return null;
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.