Package org.osgi.service.remoteserviceadmin

Examples of org.osgi.service.remoteserviceadmin.EndpointDescription


        p.put(RemoteConstants.ENDPOINT_ID, "http://google.de");
        p.put(Constants.OBJECTCLASS, new String[] {
            "es.schaaf.my.class"
        });
        p.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "unsupportetConfiguration");
        EndpointDescription endpoint = new EndpointDescription(p);

        c.replay();

        // must be null as the endpoint doesn't contain any usable configurations
        assertNull(rsaCore.importService(endpoint));
        // must be empty ...
        assertEquals(0, rsaCore.getImportedEndpoints().size());

        p.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "org.apache.cxf.ws");
        endpoint = new EndpointDescription(p);

        ImportRegistration ireg = rsaCore.importService(endpoint);
        assertNotNull(ireg);

        assertEquals(1, rsaCore.getImportedEndpoints().size());
View Full Code Here


   
    @Test
    public void testDefaultCtor(){
       
        IMocksControl c = EasyMock.createNiceControl();
        EndpointDescription ed = c.createMock(EndpointDescription.class);
        RemoteServiceAdminCore rsac = c.createMock(RemoteServiceAdminCore.class);
       
       
        c.replay();
       
View Full Code Here

   
    @Test
    public void testCloneAndClose(){
    
        IMocksControl c = EasyMock.createControl();
        EndpointDescription ed = c.createMock(EndpointDescription.class);
        RemoteServiceAdminCore rsac = c.createMock(RemoteServiceAdminCore.class);
       
        ServiceRegistration sr = c.createMock(ServiceRegistration.class);
        ServiceReference sref = c.createMock(ServiceReference.class);
        EasyMock.expect(sr.getReference()).andReturn(sref).anyTimes();
View Full Code Here

    }
   
    @Test
    public void testCloseAll(){
        IMocksControl c = EasyMock.createControl();
        EndpointDescription ed = c.createMock(EndpointDescription.class);
        RemoteServiceAdminCore rsac = c.createMock(RemoteServiceAdminCore.class);
       
        c.replay();
       
        ImportRegistrationImpl i1 = new ImportRegistrationImpl(ed,rsac);
View Full Code Here

        p.put(RemoteConstants.ENDPOINT_ID, "http://google.de");
        p.put("notAString",new Object());
        p.put(org.osgi.framework.Constants.OBJECTCLASS, new String[]{"my.class"});
        p.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, new String[]{"my.config"});
       
        EndpointDescription ep = new EndpointDescription(p);
       
        assertNull(OsgiUtils.getProperty(ep, "unkownProp"));
        assertEquals(p.get(RemoteConstants.ENDPOINT_ID),OsgiUtils.getProperty(ep, RemoteConstants.ENDPOINT_ID));
        assertEquals(null, OsgiUtils.getProperty(ep, "notAString"));
    }
View Full Code Here

        Map props = new HashMap();
       
        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();
       
View Full Code Here

        Map<String, Object> map = new HashMap<String,Object>();
        map.put(RemoteConstants.ENDPOINT_ID, "http://google.de");
        map.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "myGreatConfiguration");
        map.put(Constants.OBJECTCLASS, new String[]{"my.class"});
       
        EndpointDescription ed = new EndpointDescription(map);
        ConfigurationTypeHandler handler = control.createMock(ConfigurationTypeHandler.class);

        ImportRegistrationImpl iri = new ImportRegistrationImpl(ed, null);
       
        BundleContext requestingContext = control.createMock(BundleContext.class);
View Full Code Here

            Server server = factory.create();

            exportRegistration.setServer(server);
           
            //  add the information on the new Endpoint to the export registration
            EndpointDescription ed = new EndpointDescription(endpointProps);
            exportRegistration.setEndpointdescription(ed);
           
        } catch (IntentUnsatifiedException iue) {
            exportRegistration.setException(iue);
        } finally {
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();
            exportRegistration.setServer(server);
            endpdDesc = new EndpointDescription(endpointProps);

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

        Properties props = new Properties();
        setIfNotNull(props, "cause", rsae.getException());

       
        EndpointDescription epd = null;
        if (rsae.getImportReference()!= null) {
            epd = ((ImportReferenceImpl)rsae.getImportReference()).getImportedEndpointAlways();
            setIfNotNull(props, "import.registration", epd);
        } else if (rsae.getExportReference() != null) {
            epd = ((ExportReferenceImpl)rsae.getExportReference()).getExportedEndpointAlways();
            setIfNotNull(props, "export.registration", epd);
        }

        if (epd != null) {
            setIfNotNull(props, "service.remote.id", epd.getServiceId());
            setIfNotNull(props, "service.remote.uuid", epd.getFrameworkUUID());
            setIfNotNull(props, "service.remote.uri", epd.getId());
            setIfNotNull(props, "objectClass", epd.getInterfaces().toArray());
            setIfNotNull(props, "service.imported.configs", epd.getConfigurationTypes());
        }
        props.put("timestamp", System.currentTimeMillis());
        props.put("event", rsae);

        Event ev = createEvent(props, topic);
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.