@Test void createMonitorForUnknownComponent() { MessageMonitor<? extends Message<?>> actual = subject.registerComponent(String.class, "test"); assertSame(NoOpMessageMonitor.instance(), actual); }
public MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName) { if (EventProcessor.class.isAssignableFrom(componentType)) { return registerEventProcessor(componentName); } if (CommandBus.class.isAssignableFrom(componentType)) { return registerCommandBus(componentName); } if (EventBus.class.isAssignableFrom(componentType)) { return registerEventBus(componentName); } if (QueryBus.class.isAssignableFrom(componentType)) { return registerQueryBus(componentName); } if (QueryUpdateEmitter.class.isAssignableFrom(componentType)) { return registerQueryUpdateEmitter(componentName); } logger.warn("Cannot provide MessageMonitor for component [{}] of type [{}]. Returning No-Op instance.", componentName, componentType.getSimpleName()); return NoOpMessageMonitor.instance(); }
GlobalMetricRegistry { public MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName) { if (EventProcessor.class.isAssignableFrom(componentType)) { return registerEventProcessor(componentName); } if (CommandBus.class.isAssignableFrom(componentType)) { return registerCommandBus(componentName); } if (EventBus.class.isAssignableFrom(componentType)) { return registerEventBus(componentName); } if (QueryBus.class.isAssignableFrom(componentType)) { return registerQueryBus(componentName); } if (QueryUpdateEmitter.class.isAssignableFrom(componentType)) { return registerQueryUpdateEmitter(componentName); } logger.warn("Cannot provide MessageMonitor for component [{}] of type [{}]. Returning No-Op instance.", componentName, componentType.getSimpleName()); return NoOpMessageMonitor.instance(); } }
GlobalMetricRegistry { public MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName) { if (EventProcessor.class.isAssignableFrom(componentType)) { return registerEventProcessor(componentName); } if (CommandBus.class.isAssignableFrom(componentType)) { return registerCommandBus(componentName); } if (EventBus.class.isAssignableFrom(componentType)) { return registerEventBus(componentName); } if (QueryBus.class.isAssignableFrom(componentType)) { return registerQueryBus(componentName); } if (QueryUpdateEmitter.class.isAssignableFrom(componentType)) { return registerQueryUpdateEmitter(componentName); } logger.warn("Cannot provide MessageMonitor for component [{}] of type [{}]. Returning No-Op instance.", componentName, componentType.getSimpleName()); return NoOpMessageMonitor.instance(); } GlobalMetricRegistry();  GlobalMetricRegistry(MetricRegistry metricRegistry); }
GlobalMetricRegistry { public MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName) { if (EventProcessor.class.isAssignableFrom(componentType)) { return registerEventProcessor(componentName); } if (CommandBus.class.isAssignableFrom(componentType)) { return registerCommandBus(componentName); } if (EventBus.class.isAssignableFrom(componentType)) { return registerEventBus(componentName); } if (QueryBus.class.isAssignableFrom(componentType)) { return registerQueryBus(componentName); } if (QueryUpdateEmitter.class.isAssignableFrom(componentType)) { return registerQueryUpdateEmitter(componentName); } logger.warn("Cannot provide MessageMonitor for component [{}] of type [{}]. Returning No-Op instance.", componentName, componentType.getSimpleName()); return NoOpMessageMonitor.instance(); } GlobalMetricRegistry();  GlobalMetricRegistry(MetricRegistry metricRegistry); @SuppressWarnings("unchecked") Configurer registerWithConfigurer(Configurer configurer); MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName); MessageMonitor<? super EventMessage<?>> registerEventProcessor(String eventProcessorName); MessageMonitor<? super CommandMessage<?>> registerCommandBus(String commandBusName); MessageMonitor<? super EventMessage<?>> registerEventBus(String eventBusName); MessageMonitor<? super QueryMessage<?, ?>> registerQueryBus(String queryBusName); MetricRegistry getRegistry(); }
GlobalMetricRegistry { public MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName) { if (EventProcessor.class.isAssignableFrom(componentType)) { return registerEventProcessor(componentName); } if (CommandBus.class.isAssignableFrom(componentType)) { return registerCommandBus(componentName); } if (EventBus.class.isAssignableFrom(componentType)) { return registerEventBus(componentName); } if (QueryBus.class.isAssignableFrom(componentType)) { return registerQueryBus(componentName); } if (QueryUpdateEmitter.class.isAssignableFrom(componentType)) { return registerQueryUpdateEmitter(componentName); } logger.warn("Cannot provide MessageMonitor for component [{}] of type [{}]. Returning No-Op instance.", componentName, componentType.getSimpleName()); return NoOpMessageMonitor.instance(); } GlobalMetricRegistry();  GlobalMetricRegistry(MetricRegistry metricRegistry); @SuppressWarnings("unchecked") Configurer registerWithConfigurer(Configurer configurer); MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName); MessageMonitor<? super EventMessage<?>> registerEventProcessor(String eventProcessorName); MessageMonitor<? super CommandMessage<?>> registerCommandBus(String commandBusName); MessageMonitor<? super EventMessage<?>> registerEventBus(String eventBusName); MessageMonitor<? super QueryMessage<?, ?>> registerQueryBus(String queryBusName); MetricRegistry getRegistry();  }