Package org.apache.camel.spi
Interface EventFactory
-
public interface EventFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CamelEventcreateCamelContextInitializedEvent(CamelContext context)Creates anCamelEventfor Camel has been initialized successfully.CamelEventcreateCamelContextInitializingEvent(CamelContext context)Creates anCamelEventfor Camel is initializing.CamelEventcreateCamelContextReloaded(CamelContext context, Object source)Creates anCamelEventforCamelContexthas been reloaded successfully.CamelEventcreateCamelContextReloadFailure(CamelContext context, Object source, Throwable cause)Creates anCamelEventforCamelContextfailed reload.CamelEventcreateCamelContextReloading(CamelContext context, Object source)Creates anCamelEventforCamelContextbeing reloaded.CamelEventcreateCamelContextResumedEvent(CamelContext context)Creates anCamelEventfor Camel has been resumed successfully.CamelEventcreateCamelContextResumeFailureEvent(CamelContext context, Throwable cause)Creates anCamelEventfor Camel failing to resumeCamelEventcreateCamelContextResumingEvent(CamelContext context)Creates anCamelEventfor Camel is resuming.CamelEventcreateCamelContextRoutesStartedEvent(CamelContext context)Creates anCamelEventfor Camel routes started.CamelEventcreateCamelContextRoutesStartingEvent(CamelContext context)Creates anCamelEventfor Camel routes starting.CamelEventcreateCamelContextRoutesStoppedEvent(CamelContext context)Creates anCamelEventfor Camel routes stopped.CamelEventcreateCamelContextRoutesStoppingEvent(CamelContext context)Creates anCamelEventfor Camel routes stopping.CamelEventcreateCamelContextStartedEvent(CamelContext context)Creates anCamelEventfor Camel has been started successfully.CamelEventcreateCamelContextStartingEvent(CamelContext context)Creates anCamelEventfor Camel is starting.CamelEventcreateCamelContextStartupFailureEvent(CamelContext context, Throwable cause)Creates anCamelEventfor Camel failing to startCamelEventcreateCamelContextStopFailureEvent(CamelContext context, Throwable cause)Creates anCamelEventfor Camel failing to stop cleanlyCamelEventcreateCamelContextStoppedEvent(CamelContext context)Creates anCamelEventfor Camel has been stopped successfully.CamelEventcreateCamelContextStoppingEvent(CamelContext context)Creates anCamelEventfor Camel is stopping.CamelEventcreateCamelContextSuspendedEvent(CamelContext context)Creates anCamelEventfor Camel has been suspended successfully.CamelEventcreateCamelContextSuspendingEvent(CamelContext context)Creates anCamelEventfor Camel is suspending.CamelEventcreateCamelExchangeAsyncProcessingStartedEvent(Exchange exchange)Creates anCamelEventwhen anExchangeasynchronous processing has been started.CamelEventcreateExchangeCompletedEvent(Exchange exchange)Creates anCamelEventwhen anExchangehas been completed successfullyCamelEventcreateExchangeCreatedEvent(Exchange exchange)Creates anCamelEventwhen anExchangehas been createdCamelEventcreateExchangeFailedEvent(Exchange exchange)Creates anCamelEventwhen anExchangehas failedCamelEventcreateExchangeFailureHandledEvent(Exchange exchange, Processor failureHandler, boolean deadLetterChannel, String deadLetterUri)Creates anCamelEventwhen anExchangehas failed but was handled by the Camel error handlers such as an dead letter channel, or a doTry ..CamelEventcreateExchangeFailureHandlingEvent(Exchange exchange, Processor failureHandler, boolean deadLetterChannel, String deadLetterUri)Creates anCamelEventwhen anExchangehas failed but is being handled by the Camel error handlers such as an dead letter channel, or a doTry ..CamelEventcreateExchangeRedeliveryEvent(Exchange exchange, int attempt)Creates anCamelEventwhen anExchangeis about to be redeliveredCamelEventcreateExchangeSendingEvent(Exchange exchange, Endpoint endpoint)Creates anCamelEventwhen anExchangeis about to be sent to the endpoint (eg before).CamelEventcreateExchangeSentEvent(Exchange exchange, Endpoint endpoint, long timeTaken)Creates anCamelEventwhen anExchangehas completely been sent to the endpoint (eg after).CamelEventcreateRouteAddedEvent(Route route)Creates anCamelEventforRoutehas been added successfully.CamelEventcreateRouteReloaded(Route route, int index, int total)Creates anCamelEventforRoutehas been reloaded successfully.CamelEventcreateRouteRemovedEvent(Route route)Creates anCamelEventforRoutehas been removed successfully.CamelEventcreateRouteStartedEvent(Route route)Creates anCamelEventforRoutehas been started successfully.CamelEventcreateRouteStartingEvent(Route route)Creates anCamelEventforRouteis starting.CamelEventcreateRouteStoppedEvent(Route route)Creates anCamelEventforRoutehas been stopped successfully.CamelEventcreateRouteStoppingEvent(Route route)Creates anCamelEventforRouteis stopping.CamelEventcreateServiceStartupFailureEvent(CamelContext context, Object service, Throwable cause)Creates anCamelEventfor a Service failed to start cleanlyCamelEventcreateServiceStopFailureEvent(CamelContext context, Object service, Throwable cause)Creates anCamelEventfor a Service failed to stop cleanlyCamelEventcreateStepCompletedEvent(Exchange exchange, String stepId)Creates anCamelEventwhen a step has been completed successfullyCamelEventcreateStepFailedEvent(Exchange exchange, String stepId)Creates anCamelEventwhen a step has failedCamelEventcreateStepStartedEvent(Exchange exchange, String stepId)Creates anCamelEventwhen a step has been startedbooleanisTimestampEnabled()Whether to include timestamp for each event, when the event occurred.voidsetTimestampEnabled(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 anCamelEventfor Camel is initializing.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextInitializedEvent
CamelEvent createCamelContextInitializedEvent(CamelContext context)
Creates anCamelEventfor Camel has been initialized successfully.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextStartingEvent
CamelEvent createCamelContextStartingEvent(CamelContext context)
Creates anCamelEventfor Camel is starting.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextStartedEvent
CamelEvent createCamelContextStartedEvent(CamelContext context)
Creates anCamelEventfor Camel has been started successfully.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextStartupFailureEvent
CamelEvent createCamelContextStartupFailureEvent(CamelContext context, Throwable cause)
Creates anCamelEventfor Camel failing to start- Parameters:
context- camel contextcause- the cause exception- Returns:
- the created event
-
createCamelContextStopFailureEvent
CamelEvent createCamelContextStopFailureEvent(CamelContext context, Throwable cause)
Creates anCamelEventfor Camel failing to stop cleanly- Parameters:
context- camel contextcause- the cause exception- Returns:
- the created event
-
createCamelContextStoppingEvent
CamelEvent createCamelContextStoppingEvent(CamelContext context)
Creates anCamelEventfor Camel is stopping.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextStoppedEvent
CamelEvent createCamelContextStoppedEvent(CamelContext context)
Creates anCamelEventfor Camel has been stopped successfully.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextRoutesStartingEvent
CamelEvent createCamelContextRoutesStartingEvent(CamelContext context)
Creates anCamelEventfor Camel routes starting.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextRoutesStartedEvent
CamelEvent createCamelContextRoutesStartedEvent(CamelContext context)
Creates anCamelEventfor Camel routes started.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextRoutesStoppingEvent
CamelEvent createCamelContextRoutesStoppingEvent(CamelContext context)
Creates anCamelEventfor Camel routes stopping.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextRoutesStoppedEvent
CamelEvent createCamelContextRoutesStoppedEvent(CamelContext context)
Creates anCamelEventfor Camel routes stopped.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextReloading
CamelEvent createCamelContextReloading(CamelContext context, Object source)
Creates anCamelEventforCamelContextbeing reloaded.- Parameters:
context- camel contextsource- the source triggered reload- Returns:
- the reloading event
-
createCamelContextReloaded
CamelEvent createCamelContextReloaded(CamelContext context, Object source)
Creates anCamelEventforCamelContexthas 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 anCamelEventforCamelContextfailed 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 anCamelEventfor 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 anCamelEventfor 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 anCamelEventforRouteis starting.- Parameters:
route- the route- Returns:
- the created event
-
createRouteStartedEvent
CamelEvent createRouteStartedEvent(Route route)
Creates anCamelEventforRoutehas been started successfully.- Parameters:
route- the route- Returns:
- the created event
-
createRouteStoppingEvent
CamelEvent createRouteStoppingEvent(Route route)
Creates anCamelEventforRouteis stopping.- Parameters:
route- the route- Returns:
- the created event
-
createRouteStoppedEvent
CamelEvent createRouteStoppedEvent(Route route)
Creates anCamelEventforRoutehas been stopped successfully.- Parameters:
route- the route- Returns:
- the created event
-
createRouteAddedEvent
CamelEvent createRouteAddedEvent(Route route)
Creates anCamelEventforRoutehas been added successfully.- Parameters:
route- the route- Returns:
- the created event
-
createRouteRemovedEvent
CamelEvent createRouteRemovedEvent(Route route)
Creates anCamelEventforRoutehas been removed successfully.- Parameters:
route- the route- Returns:
- the created event
-
createRouteReloaded
CamelEvent createRouteReloaded(Route route, int index, int total)
Creates anCamelEventforRoutehas 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 anCamelEventwhen anExchangehas been created- Parameters:
exchange- the exchange- Returns:
- the created event
-
createExchangeCompletedEvent
CamelEvent createExchangeCompletedEvent(Exchange exchange)
Creates anCamelEventwhen anExchangehas been completed successfully- Parameters:
exchange- the exchange- Returns:
- the created event
-
createExchangeFailedEvent
CamelEvent createExchangeFailedEvent(Exchange exchange)
Creates anCamelEventwhen anExchangehas failed- Parameters:
exchange- the exchange- Returns:
- the created event
-
createExchangeFailureHandlingEvent
CamelEvent createExchangeFailureHandlingEvent(Exchange exchange, Processor failureHandler, boolean deadLetterChannel, String deadLetterUri)
Creates anCamelEventwhen anExchangehas 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 anCamelEventwhen anExchangehas 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 anCamelEventwhen anExchangeis 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 anCamelEventwhen anExchangeis 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 anCamelEventwhen anExchangeasynchronous processing has been started. This is guaranteed to run on the same thread on whichRoutePolicySupport.onExchangeBeginwas called and/orExchangeSendingEventwas 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 anCamelEventwhen anExchangehas 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 anCamelEventwhen a step has been started- Parameters:
exchange- the exchangestepId- the step id- Returns:
- the created event
-
createStepCompletedEvent
CamelEvent createStepCompletedEvent(Exchange exchange, String stepId)
Creates anCamelEventwhen 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 anCamelEventwhen a step has failed- Parameters:
exchange- the exchangestepId- the step id- Returns:
- the created event
-
createCamelContextSuspendingEvent
CamelEvent createCamelContextSuspendingEvent(CamelContext context)
Creates anCamelEventfor Camel is suspending.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextSuspendedEvent
CamelEvent createCamelContextSuspendedEvent(CamelContext context)
Creates anCamelEventfor Camel has been suspended successfully.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextResumingEvent
CamelEvent createCamelContextResumingEvent(CamelContext context)
Creates anCamelEventfor Camel is resuming.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextResumedEvent
CamelEvent createCamelContextResumedEvent(CamelContext context)
Creates anCamelEventfor Camel has been resumed successfully.- Parameters:
context- camel context- Returns:
- the created event
-
createCamelContextResumeFailureEvent
CamelEvent createCamelContextResumeFailureEvent(CamelContext context, Throwable cause)
Creates anCamelEventfor Camel failing to resume- Parameters:
context- camel contextcause- the cause exception- Returns:
- the created event
-
-