/** * Obtains an {@link EventProcessor} through the given {@code name}. * * @param name a {@link String} specifying the name of an {@link EventProcessor} * @param <T> the type of the expected {@link EventProcessor} * @return an {@link Optional} specifying whether an {@link EventProcessor} with the given {@code name} exists */ @SuppressWarnings("unchecked") default <T extends EventProcessor> Optional<T> eventProcessor(String name) { return (Optional<T>) Optional.ofNullable(eventProcessors().get(name)); }
@Override public Iterator<EventProcessor> iterator() { return eventProcessingConfiguration.eventProcessors().values().iterator(); } }
/** * Obtains Event Processor by name. This method is to be called after Event Processor Registry is initialized. * * @param name The name of the event processor * @param <T> The type of processor expected * @return optional whether event processor with given name exists */ @SuppressWarnings("unchecked") public <T extends EventProcessor> Optional<T> eventProcessor(String name) { return (Optional<T>) Optional.ofNullable(eventProcessors().get(name)); }
/** * Obtains an {@link EventProcessor} through the given {@code name}. * * @param name a {@link String} specifying the name of an {@link EventProcessor} * @param <T> the type of the expected {@link EventProcessor} * @return an {@link Optional} specifying whether an {@link EventProcessor} with the given {@code name} exists */ @SuppressWarnings("unchecked") default <T extends EventProcessor> Optional<T> eventProcessor(String name) { return (Optional<T>) Optional.ofNullable(eventProcessors().get(name)); }
@Override public Iterator<EventProcessor> iterator() { return eventProcessingConfiguration.eventProcessors().values().iterator(); } }
/** * Obtains Event Processor by processing group name. This method is to be called after Event Processor Registry is * initialized. * * @param processingGroup The name of the processing group * @param <T> The type of processor expected * @return an Optional referencing the processor */ @SuppressWarnings("unchecked") public <T extends EventProcessor> Optional<T> eventProcessorByProcessingGroup(String processingGroup) { return (Optional<T>) Optional.ofNullable(eventProcessors() .get(processorNameForProcessingGroup(processingGroup))); }
/** * Returns a list of Event Processors that have been initialized. Note that an empty list may be returned if this * configuration hasn't been {@link #initialize(Configuration) initialized} yet. * * @return a read-only list of processors initialized in this configuration. * @deprecated use {@link EventProcessingConfiguration#eventProcessors()} instead */ @Deprecated public List<EventProcessor> getProcessors() { Assert.state(config != null, () -> "Configuration is not initialized yet"); return new ArrayList<>(config.eventProcessingConfiguration().eventProcessors().values()); }