Package org.apache.camel.spi
Interface EventFactory
-
public interface EventFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CamelEvent
createCamelContextInitializedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been initialized successfully.CamelEvent
createCamelContextInitializingEvent(CamelContext context)
Creates anCamelEvent
for Camel is initializing.CamelEvent
createCamelContextReloaded(CamelContext context, Object source)
Creates anCamelEvent
forCamelContext
has been reloaded successfully.CamelEvent
createCamelContextReloadFailure(CamelContext context, Object source, Throwable cause)
Creates anCamelEvent
forCamelContext
failed reload.CamelEvent
createCamelContextReloading(CamelContext context, Object source)
Creates anCamelEvent
forCamelContext
being reloaded.CamelEvent
createCamelContextResumedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been resumed successfully.CamelEvent
createCamelContextResumeFailureEvent(CamelContext context, Throwable cause)
Creates anCamelEvent
for Camel failing to resumeCamelEvent
createCamelContextResumingEvent(CamelContext context)
Creates anCamelEvent
for Camel is resuming.CamelEvent
createCamelContextRoutesStartedEvent(CamelContext context)
Creates anCamelEvent
for Camel routes started.CamelEvent
createCamelContextRoutesStartingEvent(CamelContext context)
Creates anCamelEvent
for Camel routes starting.CamelEvent
createCamelContextRoutesStoppedEvent(CamelContext context)
Creates anCamelEvent
for Camel routes stopped.CamelEvent
createCamelContextRoutesStoppingEvent(CamelContext context)
Creates anCamelEvent
for Camel routes stopping.CamelEvent
createCamelContextStartedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been started successfully.CamelEvent
createCamelContextStartingEvent(CamelContext context)
Creates anCamelEvent
for Camel is starting.CamelEvent
createCamelContextStartupFailureEvent(CamelContext context, Throwable cause)
Creates anCamelEvent
for Camel failing to startCamelEvent
createCamelContextStopFailureEvent(CamelContext context, Throwable cause)
Creates anCamelEvent
for Camel failing to stop cleanlyCamelEvent
createCamelContextStoppedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been stopped successfully.CamelEvent
createCamelContextStoppingEvent(CamelContext context)
Creates anCamelEvent
for Camel is stopping.CamelEvent
createCamelContextSuspendedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been suspended successfully.CamelEvent
createCamelContextSuspendingEvent(CamelContext context)
Creates anCamelEvent
for Camel is suspending.CamelEvent
createCamelExchangeAsyncProcessingStartedEvent(Exchange exchange)
Creates anCamelEvent
when anExchange
asynchronous processing has been started.CamelEvent
createExchangeCompletedEvent(Exchange exchange)
Creates anCamelEvent
when anExchange
has been completed successfullyCamelEvent
createExchangeCreatedEvent(Exchange exchange)
Creates anCamelEvent
when anExchange
has been createdCamelEvent
createExchangeFailedEvent(Exchange exchange)
Creates anCamelEvent
when anExchange
has failedCamelEvent
createExchangeFailureHandledEvent(Exchange exchange, Processor failureHandler, boolean deadLetterChannel, String deadLetterUri)
Creates anCamelEvent
when anExchange
has failed but was handled by the Camel error handlers such as an dead letter channel, or a doTry ..CamelEvent
createExchangeFailureHandlingEvent(Exchange exchange, Processor failureHandler, boolean deadLetterChannel, String deadLetterUri)
Creates anCamelEvent
when anExchange
has failed but is being handled by the Camel error handlers such as an dead letter channel, or a doTry ..CamelEvent
createExchangeRedeliveryEvent(Exchange exchange, int attempt)
Creates anCamelEvent
when anExchange
is about to be redeliveredCamelEvent
createExchangeSendingEvent(Exchange exchange, Endpoint endpoint)
Creates anCamelEvent
when anExchange
is about to be sent to the endpoint (eg before).CamelEvent
createExchangeSentEvent(Exchange exchange, Endpoint endpoint, long timeTaken)
Creates anCamelEvent
when anExchange
has completely been sent to the endpoint (eg after).CamelEvent
createRouteAddedEvent(Route route)
Creates anCamelEvent
forRoute
has been added successfully.CamelEvent
createRouteReloaded(Route route, int index, int total)
Creates anCamelEvent
forRoute
has been reloaded successfully.CamelEvent
createRouteRemovedEvent(Route route)
Creates anCamelEvent
forRoute
has been removed successfully.CamelEvent
createRouteStartedEvent(Route route)
Creates anCamelEvent
forRoute
has been started successfully.CamelEvent
createRouteStartingEvent(Route route)
Creates anCamelEvent
forRoute
is starting.CamelEvent
createRouteStoppedEvent(Route route)
Creates anCamelEvent
forRoute
has been stopped successfully.CamelEvent
createRouteStoppingEvent(Route route)
Creates anCamelEvent
forRoute
is stopping.CamelEvent
createServiceStartupFailureEvent(CamelContext context, Object service, Throwable cause)
Creates anCamelEvent
for a Service failed to start cleanlyCamelEvent
createServiceStopFailureEvent(CamelContext context, Object service, Throwable cause)
Creates anCamelEvent
for a Service failed to stop cleanlyCamelEvent
createStepCompletedEvent(Exchange exchange, String stepId)
Creates anCamelEvent
when a step has been completed successfullyCamelEvent
createStepFailedEvent(Exchange exchange, String stepId)
Creates anCamelEvent
when a step has failedCamelEvent
createStepStartedEvent(Exchange exchange, String stepId)
Creates anCamelEvent
when a step has been startedboolean
isTimestampEnabled()
Whether to include timestamp for each event, when the event occurred.void
setTimestampEnabled(boolean timestampEnabled)
Whether to include timestamp for each event, when the event occurred.
-
-
-
Method Detail
-
isTimestampEnabled
boolean isTimestampEnabled()
Whether to include timestamp for each event, when the event occurred. This is by default false.
-
setTimestampEnabled
void setTimestampEnabled(boolean timestampEnabled)
Whether to include timestamp for each event, when the event occurred.
-
createCamelContextInitializingEvent
CamelEvent createCamelContextInitializingEvent(CamelContext context)
Creates anCamelEvent
for Camel is initializing.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextInitializedEvent
CamelEvent createCamelContextInitializedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been initialized successfully.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextStartingEvent
CamelEvent createCamelContextStartingEvent(CamelContext context)
Creates anCamelEvent
for Camel is starting.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextStartedEvent
CamelEvent createCamelContextStartedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been started successfully.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextStartupFailureEvent
CamelEvent createCamelContextStartupFailureEvent(CamelContext context, Throwable cause)
Creates anCamelEvent
for Camel failing to start- Parameters:
context
- camel contextcause
- the cause exception- Returns:
- the created event
-
createCamelContextStopFailureEvent
CamelEvent createCamelContextStopFailureEvent(CamelContext context, Throwable cause)
Creates anCamelEvent
for Camel failing to stop cleanly- Parameters:
context
- camel contextcause
- the cause exception- Returns:
- the created event
-
createCamelContextStoppingEvent
CamelEvent createCamelContextStoppingEvent(CamelContext context)
Creates anCamelEvent
for Camel is stopping.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextStoppedEvent
CamelEvent createCamelContextStoppedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been stopped successfully.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextRoutesStartingEvent
CamelEvent createCamelContextRoutesStartingEvent(CamelContext context)
Creates anCamelEvent
for Camel routes starting.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextRoutesStartedEvent
CamelEvent createCamelContextRoutesStartedEvent(CamelContext context)
Creates anCamelEvent
for Camel routes started.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextRoutesStoppingEvent
CamelEvent createCamelContextRoutesStoppingEvent(CamelContext context)
Creates anCamelEvent
for Camel routes stopping.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextRoutesStoppedEvent
CamelEvent createCamelContextRoutesStoppedEvent(CamelContext context)
Creates anCamelEvent
for Camel routes stopped.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextReloading
CamelEvent createCamelContextReloading(CamelContext context, Object source)
Creates anCamelEvent
forCamelContext
being reloaded.- Parameters:
context
- camel contextsource
- the source triggered reload- Returns:
- the reloading event
-
createCamelContextReloaded
CamelEvent createCamelContextReloaded(CamelContext context, Object source)
Creates anCamelEvent
forCamelContext
has been reloaded successfully.- Parameters:
context
- camel contextsource
- the source triggered reload- Returns:
- the reloaded event
-
createCamelContextReloadFailure
CamelEvent createCamelContextReloadFailure(CamelContext context, Object source, Throwable cause)
Creates anCamelEvent
forCamelContext
failed reload.- Parameters:
context
- camel contextsource
- the source triggered reloadcause
- the caused of the failure- Returns:
- the reloaded failed event
-
createServiceStartupFailureEvent
CamelEvent createServiceStartupFailureEvent(CamelContext context, Object service, Throwable cause)
Creates anCamelEvent
for a Service failed to start cleanly- Parameters:
context
- camel contextservice
- the servicecause
- the cause exception- Returns:
- the created event
-
createServiceStopFailureEvent
CamelEvent createServiceStopFailureEvent(CamelContext context, Object service, Throwable cause)
Creates anCamelEvent
for a Service failed to stop cleanly- Parameters:
context
- camel contextservice
- the servicecause
- the cause exception- Returns:
- the created event
-
createRouteStartingEvent
CamelEvent createRouteStartingEvent(Route route)
Creates anCamelEvent
forRoute
is starting.- Parameters:
route
- the route- Returns:
- the created event
-
createRouteStartedEvent
CamelEvent createRouteStartedEvent(Route route)
Creates anCamelEvent
forRoute
has been started successfully.- Parameters:
route
- the route- Returns:
- the created event
-
createRouteStoppingEvent
CamelEvent createRouteStoppingEvent(Route route)
Creates anCamelEvent
forRoute
is stopping.- Parameters:
route
- the route- Returns:
- the created event
-
createRouteStoppedEvent
CamelEvent createRouteStoppedEvent(Route route)
Creates anCamelEvent
forRoute
has been stopped successfully.- Parameters:
route
- the route- Returns:
- the created event
-
createRouteAddedEvent
CamelEvent createRouteAddedEvent(Route route)
Creates anCamelEvent
forRoute
has been added successfully.- Parameters:
route
- the route- Returns:
- the created event
-
createRouteRemovedEvent
CamelEvent createRouteRemovedEvent(Route route)
Creates anCamelEvent
forRoute
has been removed successfully.- Parameters:
route
- the route- Returns:
- the created event
-
createRouteReloaded
CamelEvent createRouteReloaded(Route route, int index, int total)
Creates anCamelEvent
forRoute
has been reloaded successfully.- Parameters:
route
- the routeindex
- the route index in this batchtotal
- total number of routes being reloaded in this batch- Returns:
- the reloaded event
-
createExchangeCreatedEvent
CamelEvent createExchangeCreatedEvent(Exchange exchange)
Creates anCamelEvent
when anExchange
has been created- Parameters:
exchange
- the exchange- Returns:
- the created event
-
createExchangeCompletedEvent
CamelEvent createExchangeCompletedEvent(Exchange exchange)
Creates anCamelEvent
when anExchange
has been completed successfully- Parameters:
exchange
- the exchange- Returns:
- the created event
-
createExchangeFailedEvent
CamelEvent createExchangeFailedEvent(Exchange exchange)
Creates anCamelEvent
when anExchange
has failed- Parameters:
exchange
- the exchange- Returns:
- the created event
-
createExchangeFailureHandlingEvent
CamelEvent createExchangeFailureHandlingEvent(Exchange exchange, Processor failureHandler, boolean deadLetterChannel, String deadLetterUri)
Creates anCamelEvent
when anExchange
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 exchangefailureHandler
- the failure handler such as moving the message to a dead letter queuedeadLetterChannel
- whether it was a dead letter channel or not handling the failuredeadLetterUri
- 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 anCamelEvent
when anExchange
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 exchangefailureHandler
- the failure handler such as moving the message to a dead letter queuedeadLetterChannel
- whether it was a dead letter channel or not handling the failuredeadLetterUri
- the dead letter uri, if its a dead letter channel- Returns:
- the created event
-
createExchangeRedeliveryEvent
CamelEvent createExchangeRedeliveryEvent(Exchange exchange, int attempt)
Creates anCamelEvent
when anExchange
is about to be redelivered- Parameters:
exchange
- the exchangeattempt
- the current redelivery attempt (starts from 1)- Returns:
- the created event
-
createExchangeSendingEvent
CamelEvent createExchangeSendingEvent(Exchange exchange, Endpoint endpoint)
Creates anCamelEvent
when anExchange
is about to be sent to the endpoint (eg before).- Parameters:
exchange
- the exchangeendpoint
- the destination- Returns:
- the created event
-
createCamelExchangeAsyncProcessingStartedEvent
CamelEvent createCamelExchangeAsyncProcessingStartedEvent(Exchange exchange)
Creates anCamelEvent
when anExchange
asynchronous processing has been started. This is guaranteed to run on the same thread on whichRoutePolicySupport.onExchangeBegin
was called and/orExchangeSendingEvent
was fired. Special event only in use for camel-tracing / camel-opentelemtry. This event is NOT (by default) in use.- Parameters:
exchange
- the exchange- Returns:
- the created event
-
createExchangeSentEvent
CamelEvent createExchangeSentEvent(Exchange exchange, Endpoint endpoint, long timeTaken)
Creates anCamelEvent
when anExchange
has completely been sent to the endpoint (eg after).- Parameters:
exchange
- the exchangeendpoint
- the destinationtimeTaken
- time in millis taken- Returns:
- the created event
-
createStepStartedEvent
CamelEvent createStepStartedEvent(Exchange exchange, String stepId)
Creates anCamelEvent
when a step has been started- Parameters:
exchange
- the exchangestepId
- the step id- Returns:
- the created event
-
createStepCompletedEvent
CamelEvent createStepCompletedEvent(Exchange exchange, String stepId)
Creates anCamelEvent
when a step has been completed successfully- Parameters:
exchange
- the exchangestepId
- the step id- Returns:
- the created event
-
createStepFailedEvent
CamelEvent createStepFailedEvent(Exchange exchange, String stepId)
Creates anCamelEvent
when a step has failed- Parameters:
exchange
- the exchangestepId
- the step id- Returns:
- the created event
-
createCamelContextSuspendingEvent
CamelEvent createCamelContextSuspendingEvent(CamelContext context)
Creates anCamelEvent
for Camel is suspending.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextSuspendedEvent
CamelEvent createCamelContextSuspendedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been suspended successfully.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextResumingEvent
CamelEvent createCamelContextResumingEvent(CamelContext context)
Creates anCamelEvent
for Camel is resuming.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextResumedEvent
CamelEvent createCamelContextResumedEvent(CamelContext context)
Creates anCamelEvent
for Camel has been resumed successfully.- Parameters:
context
- camel context- Returns:
- the created event
-
createCamelContextResumeFailureEvent
CamelEvent createCamelContextResumeFailureEvent(CamelContext context, Throwable cause)
Creates anCamelEvent
for Camel failing to resume- Parameters:
context
- camel contextcause
- the cause exception- Returns:
- the created event
-
-