Package jakarta.resource.spi.work
Interface WorkContextLifecycleListener
-
public interface WorkContextLifecycleListenerThis class models the various events that occur during the processing of theWorkContexts associated with aWorkinstance. This interface may be implemented by aWorkContextinstance to receive notifications from theWorkManagerwhen theWorkContextis set as the execution context of theWorkinstance it is associated with.When a
WorkManagersets up the execution context of aWorkinstance that implementsWorkContextProvider, theWorkManagermust make the relevant lifecycle notifications if anWorkContextinstance implements this interface.When a
Workinstance is submitted to the ConnectorWorkManagerusing one of the methods that passes in aWorkListeneras a parameter, theWorkManagermust sendWorkrelated notifications to theWorkListenerandWorkContextsetup related notifications to this interface.The possible error conditions that might occur during associating an
WorkContextwith aWorkinstance is captured inWorkContextErrorCodes.- Since:
- 1.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcontextSetupComplete()Invoked 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 Detail
-
contextSetupComplete
void contextSetupComplete()
Invoked when theWorkContextinstance was successfully set as the execution context for theWorkinstance.- Since:
- 1.6
-
contextSetupFailed
void contextSetupFailed(String errorCode)
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:
WorkContextErrorCodes
-
-