Package jakarta.resource.spi.work
Interface WorkContextLifecycleListener
public interface WorkContextLifecycleListener
This class models the various events that occur during the processing of the
WorkContexts associated with a Work instance. This
interface may be implemented by a WorkContext instance to
receive notifications from the WorkManager when the
WorkContext is set as the execution context of the
Work instance it is associated with.
When a WorkManager sets up the execution context of a
Work instance that implements WorkContextProvider,
the WorkManager must make the relevant lifecycle notifications
if an WorkContext instance implements this interface.
When a Work instance is submitted to the Connector
WorkManager using one of the methods that passes in a
WorkListener as a parameter, the WorkManager must
send Work related notifications to the WorkListener
and WorkContext setup related notifications to this interface.
The possible error conditions that might occur during associating an
WorkContext with a Work instance is captured in
WorkContextErrorCodes.
- Since:
- 1.6
-
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked when theWorkContextinstance was successfully set as the execution context for theWorkinstance.voidcontextSetupFailed(String errorCode) Invoked when theWorkContextinstance was set as the execution context for theWorkinstance it was associated with.
-
Method Details
-
contextSetupComplete
void contextSetupComplete()Invoked when theWorkContextinstance was successfully set as the execution context for theWorkinstance.- Since:
- 1.6
-
contextSetupFailed
Invoked when theWorkContextinstance was set as the execution context for theWorkinstance it was associated with.- Parameters:
errorCode- One of the error-codes defined in or subclasses ofWorkContextErrorCodes- Since:
- 1.6
- See Also:
-