Interface EventFactory


  • public interface EventFactory
    Factory to create events that are emitted when such an event occur.

    For example when an Exchange is being created and then later when its done.

    • Method Detail

      • createCamelContextInitializingEvent

        CamelEvent createCamelContextInitializingEvent​(CamelContext context)
        Creates an CamelEvent for Camel is initializing.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextInitializedEvent

        CamelEvent createCamelContextInitializedEvent​(CamelContext context)
        Creates an CamelEvent for Camel has been initialized successfully.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextStartingEvent

        CamelEvent createCamelContextStartingEvent​(CamelContext context)
        Creates an CamelEvent for Camel is starting.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextStartedEvent

        CamelEvent createCamelContextStartedEvent​(CamelContext context)
        Creates an CamelEvent for Camel has been started successfully.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextStartupFailureEvent

        CamelEvent createCamelContextStartupFailureEvent​(CamelContext context,
                                                         Throwable cause)
        Creates an CamelEvent for Camel failing to start
        Parameters:
        context - camel context
        cause - the cause exception
        Returns:
        the created event
      • createCamelContextStopFailureEvent

        CamelEvent createCamelContextStopFailureEvent​(CamelContext context,
                                                      Throwable cause)
        Creates an CamelEvent for Camel failing to stop cleanly
        Parameters:
        context - camel context
        cause - the cause exception
        Returns:
        the created event
      • createCamelContextStoppingEvent

        CamelEvent createCamelContextStoppingEvent​(CamelContext context)
        Creates an CamelEvent for Camel is stopping.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextStoppedEvent

        CamelEvent createCamelContextStoppedEvent​(CamelContext context)
        Creates an CamelEvent for Camel has been stopped successfully.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextRoutesStartingEvent

        CamelEvent createCamelContextRoutesStartingEvent​(CamelContext context)
        Creates an CamelEvent for Camel routes starting.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextRoutesStartedEvent

        CamelEvent createCamelContextRoutesStartedEvent​(CamelContext context)
        Creates an CamelEvent for Camel routes started.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextRoutesStoppingEvent

        CamelEvent createCamelContextRoutesStoppingEvent​(CamelContext context)
        Creates an CamelEvent for Camel routes stopping.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextRoutesStoppedEvent

        CamelEvent createCamelContextRoutesStoppedEvent​(CamelContext context)
        Creates an CamelEvent for Camel routes stopped.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createServiceStartupFailureEvent

        CamelEvent createServiceStartupFailureEvent​(CamelContext context,
                                                    Object service,
                                                    Throwable cause)
        Creates an CamelEvent for a Service failed to start cleanly
        Parameters:
        context - camel context
        service - the service
        cause - the cause exception
        Returns:
        the created event
      • createServiceStopFailureEvent

        CamelEvent createServiceStopFailureEvent​(CamelContext context,
                                                 Object service,
                                                 Throwable cause)
        Creates an CamelEvent for a Service failed to stop cleanly
        Parameters:
        context - camel context
        service - the service
        cause - the cause exception
        Returns:
        the created event
      • createRouteStartingEvent

        CamelEvent createRouteStartingEvent​(Route route)
        Creates an CamelEvent for Route is starting.
        Parameters:
        route - the route
        Returns:
        the created event
      • createRouteStartedEvent

        CamelEvent createRouteStartedEvent​(Route route)
        Creates an CamelEvent for Route has been started successfully.
        Parameters:
        route - the route
        Returns:
        the created event
      • createRouteStoppingEvent

        CamelEvent createRouteStoppingEvent​(Route route)
        Creates an CamelEvent for Route is stopping.
        Parameters:
        route - the route
        Returns:
        the created event
      • createRouteStoppedEvent

        CamelEvent createRouteStoppedEvent​(Route route)
        Creates an CamelEvent for Route has been stopped successfully.
        Parameters:
        route - the route
        Returns:
        the created event
      • createRouteAddedEvent

        CamelEvent createRouteAddedEvent​(Route route)
        Creates an CamelEvent for Route has been added successfully.
        Parameters:
        route - the route
        Returns:
        the created event
      • createRouteRemovedEvent

        CamelEvent createRouteRemovedEvent​(Route route)
        Creates an CamelEvent for Route has been removed successfully.
        Parameters:
        route - the route
        Returns:
        the created event
      • createRouteReloaded

        CamelEvent createRouteReloaded​(Route route,
                                       int index,
                                       int total)
        Creates an CamelEvent for Route has been reloaded successfully.
        Parameters:
        route - the route
        index - the route index in this batch
        total - total number of routes being reloaded in this batch
        Returns:
        the reloaded event
      • createExchangeCreatedEvent

        CamelEvent createExchangeCreatedEvent​(Exchange exchange)
        Creates an CamelEvent when an Exchange has been created
        Parameters:
        exchange - the exchange
        Returns:
        the created event
      • createExchangeCompletedEvent

        CamelEvent createExchangeCompletedEvent​(Exchange exchange)
        Creates an CamelEvent when an Exchange has been completed successfully
        Parameters:
        exchange - the exchange
        Returns:
        the created event
      • createExchangeFailedEvent

        CamelEvent createExchangeFailedEvent​(Exchange exchange)
        Creates an CamelEvent when an Exchange has failed
        Parameters:
        exchange - the exchange
        Returns:
        the created event
      • createExchangeFailureHandlingEvent

        CamelEvent createExchangeFailureHandlingEvent​(Exchange exchange,
                                                      Processor failureHandler,
                                                      boolean deadLetterChannel,
                                                      String deadLetterUri)
        Creates an CamelEvent when an Exchange has failed but is being handled by the Camel error handlers such as an dead letter channel, or a doTry .. doCatch block.

        This event is triggered before sending the failure handler, where as createExchangeFailureHandledEvent if the event after.

        Parameters:
        exchange - the exchange
        failureHandler - the failure handler such as moving the message to a dead letter queue
        deadLetterChannel - whether it was a dead letter channel or not handling the failure
        deadLetterUri - the dead letter uri, if its a dead letter channel
        Returns:
        the created event
      • createExchangeFailureHandledEvent

        CamelEvent createExchangeFailureHandledEvent​(Exchange exchange,
                                                     Processor failureHandler,
                                                     boolean deadLetterChannel,
                                                     String deadLetterUri)
        Creates an CamelEvent when an Exchange has failed but was handled by the Camel error handlers such as an dead letter channel, or a doTry .. doCatch block.

        This event is triggered after the exchange was sent to failure handler, where as createExchangeFailureHandlingEvent if the event before.

        Parameters:
        exchange - the exchange
        failureHandler - the failure handler such as moving the message to a dead letter queue
        deadLetterChannel - whether it was a dead letter channel or not handling the failure
        deadLetterUri - the dead letter uri, if its a dead letter channel
        Returns:
        the created event
      • createExchangeRedeliveryEvent

        CamelEvent createExchangeRedeliveryEvent​(Exchange exchange,
                                                 int attempt)
        Creates an CamelEvent when an Exchange is about to be redelivered
        Parameters:
        exchange - the exchange
        attempt - the current redelivery attempt (starts from 1)
        Returns:
        the created event
      • createExchangeSendingEvent

        CamelEvent createExchangeSendingEvent​(Exchange exchange,
                                              Endpoint endpoint)
        Creates an CamelEvent when an Exchange is about to be sent to the endpoint (eg before).
        Parameters:
        exchange - the exchange
        endpoint - the destination
        Returns:
        the created event
      • createExchangeSentEvent

        CamelEvent createExchangeSentEvent​(Exchange exchange,
                                           Endpoint endpoint,
                                           long timeTaken)
        Creates an CamelEvent when an Exchange has completely been sent to the endpoint (eg after).
        Parameters:
        exchange - the exchange
        endpoint - the destination
        timeTaken - time in millis taken
        Returns:
        the created event
      • createStepStartedEvent

        CamelEvent createStepStartedEvent​(Exchange exchange,
                                          String stepId)
        Creates an CamelEvent when a step has been started
        Parameters:
        exchange - the exchange
        stepId - the step id
        Returns:
        the created event
      • createStepCompletedEvent

        CamelEvent createStepCompletedEvent​(Exchange exchange,
                                            String stepId)
        Creates an CamelEvent when a step has been completed successfully
        Parameters:
        exchange - the exchange
        stepId - the step id
        Returns:
        the created event
      • createStepFailedEvent

        CamelEvent createStepFailedEvent​(Exchange exchange,
                                         String stepId)
        Creates an CamelEvent when a step has failed
        Parameters:
        exchange - the exchange
        stepId - the step id
        Returns:
        the created event
      • createCamelContextSuspendingEvent

        CamelEvent createCamelContextSuspendingEvent​(CamelContext context)
        Creates an CamelEvent for Camel is suspending.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextSuspendedEvent

        CamelEvent createCamelContextSuspendedEvent​(CamelContext context)
        Creates an CamelEvent for Camel has been suspended successfully.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextResumingEvent

        CamelEvent createCamelContextResumingEvent​(CamelContext context)
        Creates an CamelEvent for Camel is resuming.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextResumedEvent

        CamelEvent createCamelContextResumedEvent​(CamelContext context)
        Creates an CamelEvent for Camel has been resumed successfully.
        Parameters:
        context - camel context
        Returns:
        the created event
      • createCamelContextResumeFailureEvent

        CamelEvent createCamelContextResumeFailureEvent​(CamelContext context,
                                                        Throwable cause)
        Creates an CamelEvent for Camel failing to resume
        Parameters:
        context - camel context
        cause - the cause exception
        Returns:
        the created event