public class JMSJobExecutionContext extends Object implements JobExecutionContext, com.levigo.jadice.server.shared.watchdog.internal.WatchdogListener, com.levigo.jadice.server.jms.shared.internal.MessageProcessor
JMSJobExecutionContext
Constructor and Description |
---|
JMSJobExecutionContext(com.levigo.jadice.server.client.internal.DefaultJobInternalImpl clientJob,
JobScheduler scheduler,
JMSRequestEndpoint requestEndpoint,
StreamTransportFactory transport,
javax.jms.Message initMessage,
javax.jms.QueueConnection queueConnection,
javax.jms.QueueSession session,
com.levigo.jadice.server.jms.shared.internal.MessageDispatcher messageDispatcher,
javax.jms.Queue rxQueue,
javax.jms.Queue txQueue,
String correlationId) |
Modifier and Type | Method and Description |
---|---|
void |
announceSubPipelineCreation(Node parent,
Set<? extends Node> createdNodes)
Notify the client that a
SubPipeline has been created on the server side |
boolean |
bark(long delay,
TimeUnit unit,
String watchdogID)
A
WatchdogTimer barks. |
Job |
getClientJob() |
String |
getCorrelationId() |
javax.jms.Message |
getInitMessage() |
com.levigo.jadice.server.jms.shared.internal.MessageDispatcher |
getMessageDispatcher() |
javax.jms.QueueSender |
getQueueSender() |
javax.jms.Queue |
getRxQueue() |
ServerJob |
getServerJob() |
javax.jms.QueueSession |
getSession() |
javax.jms.Queue |
getTxQueue() |
void |
init(ServerJob serverJob)
|
void |
messageReceived(javax.jms.Message message,
com.levigo.jadice.server.jms.shared.internal.ServerMessage.MessageType type)
Receive notification about a message of the given type.
|
void |
notifyJobLaunchFailed(com.levigo.util.log.qualified.MessageID messageID,
Throwable cause)
Notify the client that an error occurred while launching this job
|
void |
sendLogMessage(NodeWorker<?> worker,
com.levigo.util.log.qualified.QualifiedLogEvent event)
Send a log message to the client.
|
void |
sendLogMessage(NodeWorker<?> worker,
com.levigo.util.log.qualified.QualifiedLogEvent event,
com.levigo.util.log.Level level)
Send a log message to the client with a specific log
Level |
void |
sendStateUpdate(Job.State state)
|
void |
shutdown()
Shuts down this context and close the connection to the client.
|
public JMSJobExecutionContext(com.levigo.jadice.server.client.internal.DefaultJobInternalImpl clientJob, JobScheduler scheduler, JMSRequestEndpoint requestEndpoint, StreamTransportFactory transport, javax.jms.Message initMessage, javax.jms.QueueConnection queueConnection, javax.jms.QueueSession session, com.levigo.jadice.server.jms.shared.internal.MessageDispatcher messageDispatcher, javax.jms.Queue rxQueue, javax.jms.Queue txQueue, String correlationId) throws javax.jms.JMSException
javax.jms.JMSException
public Job getClientJob()
getClientJob
in interface JobExecutionContext
Job
which is being executed in this context.public ServerJob getServerJob() throws IllegalStateException
getServerJob
in interface JobExecutionContext
ServerJob
which is being executed in this context.IllegalStateException
- if this method is called before init.public com.levigo.jadice.server.jms.shared.internal.MessageDispatcher getMessageDispatcher()
public javax.jms.Queue getRxQueue()
public javax.jms.Queue getTxQueue()
public String getCorrelationId()
public javax.jms.Message getInitMessage()
public javax.jms.QueueSession getSession()
public void init(ServerJob serverJob) throws JobException
JobExecutionContext
init
in interface JobExecutionContext
serverJob
- The ServerJob
that will perform the workJobException
- if an error occurred while initializing this context.public void sendLogMessage(NodeWorker<?> worker, com.levigo.util.log.qualified.QualifiedLogEvent event, com.levigo.util.log.Level level)
JobExecutionContext
Level
sendLogMessage
in interface JobExecutionContext
worker
- The NodeWorker
that caused that eventevent
- The event itselflevel
- The Level
of that eventpublic void sendLogMessage(NodeWorker<?> worker, com.levigo.util.log.qualified.QualifiedLogEvent event)
JobExecutionContext
sendLogMessage
in interface JobExecutionContext
worker
- The NodeWorker
that caused that eventevent
- The event itselfpublic javax.jms.QueueSender getQueueSender()
public void sendStateUpdate(Job.State state)
JobExecutionContext
sendStateUpdate
in interface JobExecutionContext
state
- the new stateJob.getState()
public void announceSubPipelineCreation(Node parent, Set<? extends Node> createdNodes)
JobExecutionContext
SubPipeline
has been created on the server sideannounceSubPipelineCreation
in interface JobExecutionContext
parent
- The Node
that is responsible for the new sub pipelinecreatedNodes
- The Node
s which build the sub pipelinepublic void shutdown()
JobExecutionContext
shutdown
in interface JobExecutionContext
public boolean bark(long delay, TimeUnit unit, String watchdogID)
com.levigo.jadice.server.shared.watchdog.internal.WatchdogListener
WatchdogTimer
barks.bark
in interface com.levigo.jadice.server.shared.watchdog.internal.WatchdogListener
watchdogID
- TODOtrue
, to instruct the watchdog to bark again (after
the prescribed delay) as if nothing had happened,
false
to make it stop barking.public void messageReceived(javax.jms.Message message, com.levigo.jadice.server.jms.shared.internal.ServerMessage.MessageType type)
com.levigo.jadice.server.jms.shared.internal.MessageProcessor
messageReceived
in interface com.levigo.jadice.server.jms.shared.internal.MessageProcessor
public void notifyJobLaunchFailed(com.levigo.util.log.qualified.MessageID messageID, Throwable cause)
JobExecutionContext
notifyJobLaunchFailed
in interface JobExecutionContext
messageID
- The MessageID
of the error that prevents the successful job launchingcause
- (optional) The Exception that has occurredCopyright © 2017 levigo holding gmbh. All rights reserved.