Search in sources :

Example 1 with ServiceStatusProvider

use of org.opendaylight.infrautils.diagstatus.ServiceStatusProvider in project infrautils by opendaylight.

the class DiagStatusTestModule method configureBindings.

@Override
protected void configureBindings() throws UnknownHostException {
    bind(DiagStatusService.class).to(DiagStatusServiceImpl.class);
    bind(new TypeLiteral<List<ServiceStatusProvider>>() {
    }).toInstance(Collections.emptyList());
    bind(SystemReadyMonitor.class).annotatedWith(OsgiService.class).toInstance(new SystemReadyMonitor() {

        @Override
        public void registerListener(SystemReadyListener listener) {
        // NOOP
        }

        @Override
        public SystemState getSystemState() {
            return SystemState.ACTIVE;
        }
    });
    bind(DiagStatusServiceMBean.class).to(DiagStatusServiceMBeanImpl.class);
}
Also used : ServiceStatusProvider(org.opendaylight.infrautils.diagstatus.ServiceStatusProvider) SystemState(org.opendaylight.infrautils.ready.SystemState) TypeLiteral(com.google.inject.TypeLiteral) SystemReadyListener(org.opendaylight.infrautils.ready.SystemReadyListener) DiagStatusServiceMBean(org.opendaylight.infrautils.diagstatus.DiagStatusServiceMBean) DiagStatusService(org.opendaylight.infrautils.diagstatus.DiagStatusService) SystemReadyMonitor(org.opendaylight.infrautils.ready.SystemReadyMonitor) OsgiService(org.ops4j.pax.cdi.api.OsgiService)

Example 2 with ServiceStatusProvider

use of org.opendaylight.infrautils.diagstatus.ServiceStatusProvider in project infrautils by opendaylight.

the class DiagStatusServiceImpl method updateServiceStatusMap.

private void updateServiceStatusMap() {
    for (ServiceStatusProvider serviceReference : serviceStatusProviders) {
        ServiceDescriptor serviceDescriptor = serviceReference.getServiceDescriptor();
        statusMap.put(serviceDescriptor.getModuleServiceName(), serviceDescriptor);
    }
}
Also used : ServiceStatusProvider(org.opendaylight.infrautils.diagstatus.ServiceStatusProvider) ServiceDescriptor(org.opendaylight.infrautils.diagstatus.ServiceDescriptor)

Aggregations

ServiceStatusProvider (org.opendaylight.infrautils.diagstatus.ServiceStatusProvider)2 TypeLiteral (com.google.inject.TypeLiteral)1 DiagStatusService (org.opendaylight.infrautils.diagstatus.DiagStatusService)1 DiagStatusServiceMBean (org.opendaylight.infrautils.diagstatus.DiagStatusServiceMBean)1 ServiceDescriptor (org.opendaylight.infrautils.diagstatus.ServiceDescriptor)1 SystemReadyListener (org.opendaylight.infrautils.ready.SystemReadyListener)1 SystemReadyMonitor (org.opendaylight.infrautils.ready.SystemReadyMonitor)1 SystemState (org.opendaylight.infrautils.ready.SystemState)1 OsgiService (org.ops4j.pax.cdi.api.OsgiService)1