Examples of RemoteServiceAdminEvent


Examples of org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent

            System.out.println("Type is : " + type);
            BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
            TopologyManager tm = EasyMock.createMock(TopologyManager.class);
            TopologyManagerImport tmi = EasyMock.createMock(TopologyManagerImport.class);

            RemoteServiceAdminEvent rsae = EasyMock.createNiceMock(RemoteServiceAdminEvent.class);

            EasyMock.expect(rsae.getType()).andReturn(type).anyTimes();

            // calls to the tm must only happen in these two cases:
            if (type == RemoteServiceAdminEvent.EXPORT_UNREGISTRATION) {
                tm.removeExportReference((ExportReference)EasyMock.anyObject());
                EasyMock.expectLastCall().once();
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent

            publishNotifcation(exportRegistration);
        }
    }

    protected void publishNotifcation(ExportRegistration er) {
        RemoteServiceAdminEvent rsae = null;
        if (er.getException() != null) {
            rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.EXPORT_ERROR, bctx.getBundle(),(ExportReference)null, er
                .getException());
        } else {
            rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.EXPORT_REGISTRATION, bctx.getBundle(),
                                               er.getExportReference(), er.getException());
        }

        notifyListeners(rsae);
        eaHelper.notifyEventAdmin(rsae);
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent

            e.printStackTrace();
        }
    }

    protected void publishNotifcation(ImportRegistration ir) {
        RemoteServiceAdminEvent rsae = null;
        if (ir.getException() != null) {
            rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_ERROR, bctx.getBundle(), ir.getImportReference(), ir
                .getException());
        } else {
            rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_REGISTRATION, bctx.getBundle(),
                                               ir.getImportReference(), ir.getException());
        }

        notifyListeners(rsae);
        eaHelper.notifyEventAdmin(rsae);
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent

        notifyListeners(rsae);
        eaHelper.notifyEventAdmin(rsae);
    }

    public void notifyRemoval(ExportRegistrationImpl eri) {
        RemoteServiceAdminEvent rsae = null;
        rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.EXPORT_UNREGISTRATION, bctx.getBundle(), eri.getExportReference(), eri.getException());
       
        notifyListeners(rsae);
        eaHelper.notifyEventAdmin(rsae);
    }
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent

        eaHelper.notifyEventAdmin(rsae);
    }
    
   
    public void notifyRemoval(ImportRegistrationImpl eri) {
        RemoteServiceAdminEvent rsae = null;
        rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_UNREGISTRATION, bctx.getBundle(), eri.getImportReference(), eri.getException());
       
        notifyListeners(rsae);
        eaHelper.notifyEventAdmin(rsae);
    }
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent

        return exportRegistrations;
    }

    private void fireExportEvents(Bundle source, List<ExportRegistration> exportRegistrations) {
        for (ExportRegistration registration : exportRegistrations) {
            RemoteServiceAdminEvent rsaEvent =
                new RemoteServiceAdminEvent(RemoteServiceAdminEvent.EXPORT_REGISTRATION, source, registration
                    .getExportReference(), registration.getException());
            EventAdmin eventAdmin = getEventAdmin();
            if (eventAdmin != null) {
                eventAdmin.postEvent(wrap(rsaEvent));
            }
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent

        props.put("event", rsaEvent);
        return new Event(topic, props);
    }

    private void fireImportEvents(Bundle source, ImportRegistration registration) {
        RemoteServiceAdminEvent rsaEvent =
            new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_REGISTRATION, source, registration
                .getImportReference(), registration.getException());
        EventAdmin eventAdmin = getEventAdmin();
        if (eventAdmin != null) {
            eventAdmin.postEvent(wrap(rsaEvent));
        }
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent

        return exportRegistrations;
    }

    private void fireExportEvents(Bundle source, List<ExportRegistration> exportRegistrations) {
        for (ExportRegistration registration : exportRegistrations) {
            RemoteServiceAdminEvent rsaEvent =
                new RemoteServiceAdminEvent(RemoteServiceAdminEvent.EXPORT_REGISTRATION, source, registration
                    .getExportReference(), registration.getException());
            EventAdmin eventAdmin = getEventAdmin();
            if (eventAdmin != null) {
                eventAdmin.postEvent(wrap(rsaEvent));
            }
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent

        props.put("event", rsaEvent);
        return new Event(topic, props);
    }

    private void fireImportEvents(Bundle source, ImportRegistration registration) {
        RemoteServiceAdminEvent rsaEvent =
            new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_REGISTRATION, source, registration
                .getImportReference(), registration.getException());
        EventAdmin eventAdmin = getEventAdmin();
        if (eventAdmin != null) {
            eventAdmin.postEvent(wrap(rsaEvent));
        }
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.