Package jakarta.resource.spi.work
Interface WorkContextLifecycleListener
-
public interface WorkContextLifecycleListener
This class models the various events that occur during the processing of theWorkContext
s associated with aWork
instance. This interface may be implemented by aWorkContext
instance to receive notifications from theWorkManager
when theWorkContext
is set as the execution context of theWork
instance it is associated with.When a
WorkManager
sets up the execution context of aWork
instance that implementsWorkContextProvider
, theWorkManager
must make the relevant lifecycle notifications if anWorkContext
instance implements this interface.When a
Work
instance is submitted to the ConnectorWorkManager
using one of the methods that passes in aWorkListener
as a parameter, theWorkManager
must sendWork
related notifications to theWorkListener
andWorkContext
setup related notifications to this interface.The possible error conditions that might occur during associating an
WorkContext
with aWork
instance is captured inWorkContextErrorCodes
.- Since:
- 1.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
contextSetupComplete()
Invoked when theWorkContext
instance was successfully set as the execution context for theWork
instance.void
contextSetupFailed(java.lang.String errorCode)
Invoked when theWorkContext
instance was set as the execution context for theWork
instance it was associated with.
-
-
-
Method Detail
-
contextSetupComplete
void contextSetupComplete()
Invoked when theWorkContext
instance was successfully set as the execution context for theWork
instance.- Since:
- 1.6
-
contextSetupFailed
void contextSetupFailed(java.lang.String errorCode)
Invoked when theWorkContext
instance was set as the execution context for theWork
instance it was associated with.- Parameters:
errorCode
- One of the error-codes defined in or subclasses ofWorkContextErrorCodes
- Since:
- 1.6
- See Also:
WorkContextErrorCodes
-
-