Package com.levigo.jadice.server.core
Interface JobExecutionContext
-
- All Known Implementing Classes:
JMSJobExecutionContext
public interface JobExecutionContext
TheJobExecutionContext
is the abstraction layer which bundles all actions that the server can trigger on the client side part of aJob
and 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 void
announceSubPipelineCreation(Node parent, Set<? extends Node> createdNodes)
Notify the client that aSubPipeline
has been created on the server sideJob
getClientJob()
ServerJob
getServerJob()
void
init(ServerJob serverJob)
void
notifyJobLaunchFailed(org.jadice.util.log.qualified.MessageID message, Throwable th)
Notify the client that an error occurred while launching this jobvoid
sendLogMessage(NodeWorker<?> worker, org.jadice.util.log.qualified.QualifiedLogEvent event)
Send a log message to the client.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
void
sendStateUpdate(Job.State state)
void
shutdown()
Shuts down this context and close the connection to the client.
-
-
-
Method Detail
-
getServerJob
ServerJob getServerJob() throws IllegalStateException
- Returns:
- the
ServerJob
which is being executed in this context. - Throws:
IllegalStateException
- if this method is called before init.
-
init
void init(ServerJob serverJob) throws JobException
- Parameters:
serverJob
- TheServerJob
that 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
- TheMessageID
of 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
- TheNodeWorker
that 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
- TheNodeWorker
that caused that eventevent
- The event itselflevel
- TheLevel
of that event
-
announceSubPipelineCreation
void announceSubPipelineCreation(Node parent, Set<? extends Node> createdNodes)
Notify the client that aSubPipeline
has been created on the server side
-
shutdown
void shutdown()
Shuts down this context and close the connection to the client.
-
-