Class JMSJobExecutionContext

  • All Implemented Interfaces:
    JobExecutionContext, com.levigo.jadice.server.jms.shared.internal.MessageProcessor, com.levigo.jadice.server.shared.watchdog.internal.WatchdogListener

    public class JMSJobExecutionContext
    extends Object
    implements JobExecutionContext, com.levigo.jadice.server.shared.watchdog.internal.WatchdogListener, com.levigo.jadice.server.jms.shared.internal.MessageProcessor
    The JMS specific implementation of a JMSJobExecutionContext
    Since:
    jadice server 5.5.0.0
    • Constructor Detail

      • JMSJobExecutionContext

        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
        Throws:
        javax.jms.JMSException
    • Method Detail

      • getMessageDispatcher

        public com.levigo.jadice.server.jms.shared.internal.MessageDispatcher getMessageDispatcher()
      • getRxQueue

        public javax.jms.Queue getRxQueue()
      • getTxQueue

        public javax.jms.Queue getTxQueue()
      • getCorrelationId

        public String getCorrelationId()
      • getInitMessage

        public javax.jms.Message getInitMessage()
      • getSession

        public javax.jms.QueueSession getSession()
      • sendLogMessage

        public void sendLogMessage​(NodeWorker<?> worker,
                                   org.jadice.util.log.qualified.QualifiedLogEvent event,
                                   org.jadice.util.log.Level level)
        Description copied from interface: JobExecutionContext
        Send a log message to the client with a specific log Level
        Specified by:
        sendLogMessage in interface JobExecutionContext
        Parameters:
        worker - The NodeWorker that caused that event
        event - The event itself
        level - The Level of that event
      • sendLogMessage

        public void sendLogMessage​(NodeWorker<?> worker,
                                   org.jadice.util.log.qualified.QualifiedLogEvent event)
        Description copied from interface: JobExecutionContext
        Send a log message to the client.
        Specified by:
        sendLogMessage in interface JobExecutionContext
        Parameters:
        worker - The NodeWorker that caused that event
        event - The event itself
      • getQueueSender

        public javax.jms.QueueSender getQueueSender()
      • bark

        public boolean bark​(long delay,
                            TimeUnit unit,
                            String watchdogID)
        Description copied from interface: com.levigo.jadice.server.shared.watchdog.internal.WatchdogListener
        A WatchdogTimer barks.
        Specified by:
        bark in interface com.levigo.jadice.server.shared.watchdog.internal.WatchdogListener
        watchdogID - TODO
        Returns:
        true, to instruct the watchdog to bark again (after the prescribed delay) as if nothing had happened, false to make it stop barking.
      • messageReceived

        public void messageReceived​(javax.jms.Message message,
                                    com.levigo.jadice.server.jms.shared.internal.ServerMessage.MessageType type)
        Description copied from interface: com.levigo.jadice.server.jms.shared.internal.MessageProcessor
        Receive notification about a message of the given type.
        Specified by:
        messageReceived in interface com.levigo.jadice.server.jms.shared.internal.MessageProcessor
      • notifyJobLaunchFailed

        public void notifyJobLaunchFailed​(org.jadice.util.log.qualified.MessageID messageID,
                                          Throwable cause)
        Description copied from interface: JobExecutionContext
        Notify the client that an error occurred while launching this job
        Specified by:
        notifyJobLaunchFailed in interface JobExecutionContext
        Parameters:
        messageID - The MessageID of the error that prevents the successful job launching
        cause - (optional) The Exception that has occurred