]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcExecutionNotifier.java
Make jms more robust
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.activemq / src / main / java / org / argeo / slc / jms / JmsSlcExecutionNotifier.java
1 package org.argeo.slc.jms;
2
3 import java.util.List;
4
5 import javax.jms.Destination;
6
7 import org.argeo.slc.SlcException;
8 import org.argeo.slc.UnsupportedException;
9 import org.argeo.slc.msg.process.SlcExecutionStatusRequest;
10 import org.argeo.slc.process.SlcExecution;
11 import org.argeo.slc.process.SlcExecutionNotifier;
12 import org.argeo.slc.process.SlcExecutionStep;
13 import org.springframework.jms.core.JmsTemplate;
14
15 public class JmsSlcExecutionNotifier implements SlcExecutionNotifier {
16
17 private JmsTemplate jmsTemplate;
18
19 private Destination updateStatusDestination;
20
21 public void updateStatus(SlcExecution slcExecution, String oldStatus,
22 String newStatus) {
23 SlcExecutionStatusRequest req = new SlcExecutionStatusRequest(
24 slcExecution.getUuid(), newStatus);
25 jmsTemplate.convertAndSend(updateStatusDestination, req);
26 }
27
28 public void addSteps(SlcExecution slcExecution,
29 List<SlcExecutionStep> additionalSteps) {
30 throw new UnsupportedException();
31 }
32
33 public void newExecution(SlcExecution slcExecution) {
34 throw new UnsupportedException();
35 }
36
37 public void updateExecution(SlcExecution slcExecution) {
38 throw new UnsupportedException();
39 }
40
41 public void setJmsTemplate(JmsTemplate jmsTemplate) {
42 this.jmsTemplate = jmsTemplate;
43 }
44
45 public void setUpdateStatusDestination(Destination updateStatusDestination) {
46 this.updateStatusDestination = updateStatusDestination;
47 }
48
49 }