Package com.levigo.jadice.server.core
Interface JobExecutionContext
-
- All Known Implementing Classes:
JMSJobExecutionContext
public interface JobExecutionContextTheJobExecutionContextis the abstraction layer which bundles all actions that the server can trigger on the client side part of aJoband the communication layer which transports these actions.This is primarily JMS but other technologies could implement this interface as well.
- Since:
- jadice server 5.5.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidannounceSubPipelineCreation(Node parent, Set<? extends Node> createdNodes)Notify the client that aSubPipelinehas been created on the server sideJobgetClientJob()ServerJobgetServerJob()voidinit(ServerJob serverJob)voidnotifyJobLaunchFailed(org.jadice.util.log.qualified.MessageID message, Throwable th)Notify the client that an error occurred while launching this jobvoidsendLogMessage(NodeWorker<?> worker, org.jadice.util.log.qualified.QualifiedLogEvent event)Send a log message to the client.voidsendLogMessage(NodeWorker<?> worker, org.jadice.util.log.qualified.QualifiedLogEvent event, org.jadice.util.log.Level level)Send a log message to the client with a specific logLevelvoidsendStateUpdate(Job.State state)voidshutdown()Shuts down this context and close the connection to the client.
-
-
-
Method Detail
-
getServerJob
ServerJob getServerJob() throws IllegalStateException
- Returns:
- the
ServerJobwhich is being executed in this context. - Throws:
IllegalStateException- if this method is called before init.
-
init
void init(ServerJob serverJob) throws JobException
- Parameters:
serverJob- TheServerJobthat will perform the work- Throws:
JobException- if an error occurred while initializing this context.
-
notifyJobLaunchFailed
void notifyJobLaunchFailed(org.jadice.util.log.qualified.MessageID message, Throwable th)Notify the client that an error occurred while launching this job- Parameters:
message- TheMessageIDof the error that prevents the successful job launchingth- (optional) The Exception that has occurred
-
sendStateUpdate
void sendStateUpdate(Job.State state)
- Parameters:
state- the new state- See Also:
Job.getState()
-
sendLogMessage
void sendLogMessage(NodeWorker<?> worker, org.jadice.util.log.qualified.QualifiedLogEvent event)
Send a log message to the client.- Parameters:
worker- TheNodeWorkerthat caused that eventevent- The event itself
-
sendLogMessage
void sendLogMessage(NodeWorker<?> worker, org.jadice.util.log.qualified.QualifiedLogEvent event, org.jadice.util.log.Level level)
Send a log message to the client with a specific logLevel- Parameters:
worker- TheNodeWorkerthat caused that eventevent- The event itselflevel- TheLevelof that event
-
announceSubPipelineCreation
void announceSubPipelineCreation(Node parent, Set<? extends Node> createdNodes)
Notify the client that aSubPipelinehas been created on the server side
-
shutdown
void shutdown()
Shuts down this context and close the connection to the client.
-
-