Examples of EndpointDescription


Examples of org.apache.karaf.cellar.dosgi.EndpointDescription

            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
            Map<String, EndpointDescription> remoteEndpoints = clusterManager.getMap(Constants.REMOTE_ENDPOINTS);
            if (remoteEndpoints != null && !remoteEndpoints.isEmpty()) {
                System.out.println(String.format(LIST_FORMAT, "Service Class", "Provider Node"));
                for (Map.Entry<String, EndpointDescription> entry : remoteEndpoints.entrySet()) {
                    EndpointDescription endpointDescription = entry.getValue();
                    String serviceClass = endpointDescription.getServiceClass();
                    Set<Node> nodes = endpointDescription.getNodes();
                    for (Node node : nodes) {
                        System.out.println(String.format(LIST_FORMAT, serviceClass, node.getId()));
                        serviceClass = "";
                    }
                }
View Full Code Here

Examples of org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription

    if (!(event instanceof RemoteServiceAdmin.RemoteServiceAdminEvent))
      return;
    RemoteServiceAdmin.RemoteServiceAdminEvent rsaEvent = (RemoteServiceAdmin.RemoteServiceAdminEvent) event;

    int eventType = event.getType();
    EndpointDescription endpointDescription = rsaEvent
        .getEndpointDescription();

    switch (eventType) {
    case RemoteServiceAdminEvent.EXPORT_REGISTRATION:
      advertiseEndpointDescription(endpointDescription);
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.EndpointDescription

            .andReturn("*").anyTimes();
        Bundle srefBundle = c.createMock(Bundle.class);
        EasyMock.expect(sref.getBundle()).andReturn(srefBundle).anyTimes();
       
       
        EndpointDescription endpoint = c.createMock(EndpointDescription.class);
        {
            Map props = new HashMap();
            String[] objs = new String[1];
            objs[0] = "abc";
            props.put("objectClass", objs);
            EasyMock.expect(endpoint.getProperties()).andReturn(props).anyTimes();
        }

        ExportRegistration exportRegistration = c.createMock(ExportRegistration.class);
        ExportReference exportReference = c.createMock(ExportReference.class);

View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.EndpointDescription

        BundleContext bc = c.createMock(BundleContext.class);
        ServiceRegistration sreg = c.createMock(ServiceRegistration.class);
        EasyMock.expect(bc.registerService((String)EasyMock.anyObject(), EasyMock.anyObject(), (Dictionary)EasyMock.anyObject())).andReturn(sreg).anyTimes();
        
       
        EndpointDescription epd = c.createMock(EndpointDescription.class);
        RemoteServiceAdmin rsa  = c.createMock(RemoteServiceAdmin.class);
        final ImportRegistration ireg = c.createMock(ImportRegistration.class);
        ImportReference iref = c.createMock(ImportReference.class);
       
        EasyMock.expect(rsa.importService(EasyMock.eq(epd))).andAnswer(new IAnswer<ImportRegistration>( ) {
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.EndpointDescription

        BundleContext bc = c.createMock(BundleContext.class);
        ServiceReference sref = c.createMock(ServiceReference.class);
        ExportRegistration exReg = c.createMock(ExportRegistration.class);
        ExportRegistration exReg2 = c.createMock(ExportRegistration.class);
        EndpointListener epl = EasyMock.createMock(EndpointListener.class);
        EndpointDescription epd = c.createMock(EndpointDescription.class);
        EndpointDescription epd2 = c.createMock(EndpointDescription.class);
        ExportReference exRef = c.createMock(ExportReference.class);
        ExportReference exRef2 = c.createMock(ExportReference.class);
       
       
        Map props = new HashMap();
        String[] oc = new String[1];
        oc[0] = "myClass";
        props.put("objectClass", oc);
       
        Map props2 = new HashMap();
        oc = new String[1];
        oc[0] = "notMyClass";
        props2.put("objectClass", oc);
       
       
        EasyMock.expect(bc.getService(EasyMock.eq(sref))).andReturn(epl).anyTimes();
        EasyMock.expect(bc.createFilter((String)EasyMock.anyObject())).andAnswer(new IAnswer<Filter>() {
            public Filter answer() throws Throwable {
                return FrameworkUtil.createFilter((String)EasyMock.getCurrentArguments()[0]);
            }
        }).anyTimes();
        EasyMock.expect(sref.getProperty(EasyMock.eq(EndpointListener.ENDPOINT_LISTENER_SCOPE)))
            .andReturn("(objectClass=myClass)").anyTimes();

       
        EasyMock.expect(exReg.getExportReference()).andReturn(exRef).anyTimes();
        EasyMock.expect(exRef.getExportedEndpoint()).andReturn(epd).anyTimes();
        EasyMock.expect(epd.getProperties()).andReturn(props).anyTimes();
       
        EasyMock.expect(exReg2.getExportReference()).andReturn(exRef2).anyTimes();
        EasyMock.expect(exRef2.getExportedEndpoint()).andReturn(epd2).anyTimes();
        EasyMock.expect(epd2.getProperties()).andReturn(props2).anyTimes();
       
        // must only be called for the first EndpointDestription !
        epl.endpointRemoved(EasyMock.eq(epd), EasyMock.eq("(objectClass=myClass)"));
        EasyMock.expectLastCall().once();
       
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.