congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EventProcessingConfiguration.registerHandlerInterceptor
Code IndexAdd Tabnine to your IDE (free)

How to use
registerHandlerInterceptor
method
in
org.axonframework.config.EventProcessingConfiguration

Best Java code snippets using org.axonframework.config.EventProcessingConfiguration.registerHandlerInterceptor (Showing top 3 results out of 315)

origin: org.axonframework/axon-core

/**
 * Registers the handler interceptor provided by the given {@code handlerInterceptorBuilder} function with
 * the processor defined in this configuration.
 *
 * @param handlerInterceptorBuilder The function to create the interceptor based on the current configuration
 * @return this SagaConfiguration instance, ready for further configuration
 *
 * @deprecated use {@link EventProcessingConfiguration#registerHandlerInterceptor(String, Function)} instead
 */
@Deprecated
public SagaConfiguration<S> registerHandlerInterceptor(
    Function<Configuration, MessageHandlerInterceptor<? super EventMessage<?>>> handlerInterceptorBuilder) {
  if (config != null) {
    eventProcessingConfiguration().registerHandlerInterceptor(processorInfo.getProcessingGroup(), handlerInterceptorBuilder);
  } else {
    handlerInterceptors.add(handlerInterceptorBuilder);
  }
  return this;
}
origin: org.axonframework/axon-core

@Override
public void initialize(Configuration config) {
  selectors.sort(comparing(ProcessorSelector::getPriority).reversed());
  this.config = config;
  Map<String, List<Object>> assignments = new HashMap<>();
  eventHandlers.stream().map(Component::get).forEach(handler -> {
    String processor =
        selectors.stream().map(s -> s.select(handler)).filter(Optional::isPresent).map(Optional::get)
             .findFirst()
             .orElseGet(() -> defaultSelector.select(handler).orElseThrow(IllegalStateException::new));
    assignments.computeIfAbsent(processor, k -> new ArrayList<>()).add(handler);
  });
  onInit.forEach(h -> h.accept(config));
  assignments.forEach((name, handlers) -> {
    config.eventProcessingConfiguration().registerHandlerInvoker(name, c ->
        new SimpleEventHandlerInvoker(handlers,
                       c.parameterResolverFactory(),
                       getListenerInvocationErrorHandler(c, name),
                       getSequencingPolicy(c, name)));
    if (eventProcessorBuilders.containsKey(name)) {
      eventProcessorBuilders.get(name).accept(config, handlers);
    }
    interceptorsFor(config, name).forEach(i -> config.eventProcessingConfiguration()
                             .registerHandlerInterceptor(name, c -> i));
  });
}
origin: org.axonframework/axon-core

@Override
public void initialize(Configuration config) {
  this.config = config;
  eventProcessingConfiguration().registerHandlerInvoker(processorInfo.getProcessingGroup(), c -> sagaManager.get());
  eventProcessingConfiguration().registerTokenStore(processorInfo.getProcessingGroup(), c -> tokenStore.get());
  eventProcessingConfiguration().configureMessageMonitor(processorInfo.getProcessingGroup(),
                           c -> (MessageMonitor<Message<?>>) messageMonitor.get());
  eventProcessingConfiguration().configureErrorHandler(processorInfo.getProcessingGroup(), c -> errorHandler.get());
  eventProcessingConfiguration().configureRollbackConfiguration(processorInfo.getProcessingGroup(),
                              c -> rollbackConfiguration.get());
  eventProcessingConfiguration().configureTransactionManager(processorInfo.getProcessingGroup(), c -> transactionManager.get());
  handlerInterceptors.forEach(i -> eventProcessingConfiguration()
      .registerHandlerInterceptor(processorInfo.getProcessingGroup(), i));
  if (processorInfo.isCreateNewProcessor()) {
    switch (processorInfo.getType()) {
      case TRACKING:
        eventProcessingConfiguration().registerEventProcessor(processorInfo.getProcessingGroup(),
                                   this::buildTrackingEventProcessor);
        break;
      case SUBSCRIBING:
        eventProcessingConfiguration().registerEventProcessor(processorInfo.getProcessingGroup(),
                                   this::buildSubscribingEventProcessor);
        break;
      default:
        throw new IllegalStateException("Unsupported event processor type.");
    }
  }
}
org.axonframework.configEventProcessingConfigurationregisterHandlerInterceptor

Javadoc

Register the given interceptorBuilder to build an Message Handling Interceptor for the Event Processor with given processorName.

The interceptorBuilder may return null, in which case the return value is ignored.

Popular methods of EventProcessingConfiguration

  • eventProcessor
    Returns the Event Processor with the given name, if present and of the given expectedType.
  • eventProcessors
    Obtains all registered event processors. This method is to be called after Event Processor Registry
  • eventProcessorByProcessingGroup
    Returns the Event Processor by the given processingGroup, if present and of the given expectedType.
  • registerSubscribingEventProcessor
    Register a subscribing event processor with given name that subscribes to the given messageSource. T
  • <init>
  • buildEventProcessor
  • configureErrorHandler
    Configures the default org.axonframework.eventhandling.ErrorHandler for any org.axonframework.eventh
  • configureMessageMonitor
    Configures the factory to create the Message Monitor for the EventProcessor of the given name. This
  • configureRollbackConfiguration
    Configures a RollbackConfiguration for the EventProcessor of the given name. This overrides the defa
  • configureTransactionManager
    Configures a TransactionManager for the EventProcessor of the given name. This overrides the default
  • getErrorHandler
  • getMessageMonitor
  • getErrorHandler,
  • getMessageMonitor,
  • getRollbackConfiguration,
  • getTransactionManager,
  • listenerInvocationErrorHandler,
  • processorNameForProcessingGroup,
  • registerEventProcessor,
  • registerEventProcessorFactory,
  • registerHandlerInvoker

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • setContentView (Activity)
  • findViewById (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now