@Override public Configurer configureMessageMonitor(Class<?> componentType, MessageMonitorFactory messageMonitorFactory) { messageMonitorFactoryBuilder.add(componentType, messageMonitorFactory); return this; }
BiFunction<Class<?>, String, MessageMonitor<Message<?>>> build(Configuration configuration) { assertNotBuilt(); built = true; return (type, name) -> { MessageMonitorFactory factory = getFactoryForType(forNameFactories.get(name), type); if (factory == null) { factory = getFactoryForType(forTypeFactories, type); } if (factory == null) { factory = defaultFactory; } return factory.create(configuration, type, name); }; }
MessageMonitorFactoryBuilder add(MessageMonitorFactory defaultFactory) { assertNotBuilt(); Assert.notNull(defaultFactory, () -> "defaultFactory may not be null"); this.defaultFactory = defaultFactory; return this; }
MessageMonitorFactoryBuilder add(Class<?> componentType, MessageMonitorFactory messageMonitorFactory) { assertNotBuilt(); Assert.notNull(componentType, () -> "componentType may not be null"); Assert.notNull(messageMonitorFactory, () -> "messageMonitorFactory may not be null"); forTypeFactories.put(componentType, messageMonitorFactory); return this; }
BiFunction<Class<?>, String, MessageMonitor<Message<?>>> build(Configuration configuration) { assertNotBuilt(); built = true; return (type, name) -> { MessageMonitorFactory factory = getFactoryForType(forNameFactories.get(name), type); if (factory == null) { factory = getFactoryForType(forTypeFactories, type); } if (factory == null) { factory = defaultFactory; } return factory.create(configuration, type, name); }; }
MessageMonitorFactoryBuilder add(Class<?> componentType, String componentName, MessageMonitorFactory messageMonitorFactory) { assertNotBuilt(); Assert.notNull(componentType, () -> "componentType may not be null"); Assert.notNull(componentName, () -> "componentName may not be null"); Assert.notNull(messageMonitorFactory, () -> "messageMonitorFactory may not be null"); Map<Class<?>, MessageMonitorFactory> mapByType = forNameFactories.computeIfAbsent(componentName, (name) -> new TreeMap<>(classComparator)); mapByType.put(componentType, messageMonitorFactory); return this; }
@Override public Configurer configureMessageMonitor(Class<?> componentType, String componentName, MessageMonitorFactory messageMonitorFactory) { messageMonitorFactoryBuilder.add(componentType, componentName, messageMonitorFactory); return this; }
BiFunction<Class<?>, String, MessageMonitor<Message<?>>> build(Configuration configuration) { assertNotBuilt(); built = true; return (type, name) -> { MessageMonitorFactory factory = getFactoryForType(forNameFactories.get(name), type); if (factory == null) { factory = getFactoryForType(forTypeFactories, type); } if (factory == null) { factory = defaultFactory; } return factory.create(configuration, type, name); }; }
MessageMonitorFactoryBuilder add(MessageMonitorFactory defaultFactory) { assertNotBuilt(); Assert.notNull(defaultFactory, () -> "defaultFactory may not be null"); this.defaultFactory = defaultFactory; return this; }
@Override public Configurer configureMessageMonitor( Function<Configuration, BiFunction<Class<?>, String, MessageMonitor<Message<?>>>> builder) { messageMonitorFactoryBuilder.add((conf, type, name) -> builder.apply(conf).apply(type, name)); return this; }
MessageMonitorFactoryBuilder add(MessageMonitorFactory defaultFactory) { assertNotBuilt(); Assert.notNull(defaultFactory, () -> "defaultFactory may not be null"); this.defaultFactory = defaultFactory; return this; }
@Override public Configurer configureMessageMonitor(Class<?> componentType, String componentName, MessageMonitorFactory messageMonitorFactory) { messageMonitorFactoryBuilder.add(componentType, componentName, messageMonitorFactory); return this; }
MessageMonitorFactoryBuilder add(Class<?> componentType, MessageMonitorFactory messageMonitorFactory) { assertNotBuilt(); Assert.notNull(componentType, () -> "componentType may not be null"); Assert.notNull(messageMonitorFactory, () -> "messageMonitorFactory may not be null"); forTypeFactories.put(componentType, messageMonitorFactory); return this; }
@Override public Configurer configureMessageMonitor(Class<?> componentType, String componentName, MessageMonitorFactory messageMonitorFactory) { messageMonitorFactoryBuilder.add(componentType, componentName, messageMonitorFactory); return this; }
MessageMonitorFactoryBuilder add(Class<?> componentType, MessageMonitorFactory messageMonitorFactory) { assertNotBuilt(); Assert.notNull(componentType, () -> "componentType may not be null"); Assert.notNull(messageMonitorFactory, () -> "messageMonitorFactory may not be null"); forTypeFactories.put(componentType, messageMonitorFactory); return this; }
@Override public Configurer configureMessageMonitor(Class<?> componentType, MessageMonitorFactory messageMonitorFactory) { messageMonitorFactoryBuilder.add(componentType, messageMonitorFactory); return this; }
MessageMonitorFactoryBuilder add(Class<?> componentType, String componentName, MessageMonitorFactory messageMonitorFactory) { assertNotBuilt(); Assert.notNull(componentType, () -> "componentType may not be null"); Assert.notNull(componentName, () -> "componentName may not be null"); Assert.notNull(messageMonitorFactory, () -> "messageMonitorFactory may not be null"); Map<Class<?>, MessageMonitorFactory> mapByType = forNameFactories.computeIfAbsent(componentName, (name) -> new TreeMap<>(classComparator)); mapByType.put(componentType, messageMonitorFactory); return this; }
@Override public Configurer configureMessageMonitor(Class<?> componentType, MessageMonitorFactory messageMonitorFactory) { messageMonitorFactoryBuilder.add(componentType, messageMonitorFactory); return this; }
MessageMonitorFactoryBuilder add(Class<?> componentType, String componentName, MessageMonitorFactory messageMonitorFactory) { assertNotBuilt(); Assert.notNull(componentType, () -> "componentType may not be null"); Assert.notNull(componentName, () -> "componentName may not be null"); Assert.notNull(messageMonitorFactory, () -> "messageMonitorFactory may not be null"); Map<Class<?>, MessageMonitorFactory> mapByType = forNameFactories.computeIfAbsent(componentName, (name) -> new TreeMap<>(classComparator)); mapByType.put(componentType, messageMonitorFactory); return this; }
@Override public Configurer configureMessageMonitor( Function<Configuration, BiFunction<Class<?>, String, MessageMonitor<Message<?>>>> builder) { messageMonitorFactoryBuilder.add((conf, type, name) -> builder.apply(conf).apply(type, name)); return this; }