Skip to content
This repository was archived by the owner on Mar 27, 2018. It is now read-only.

Commit a7efea6

Browse files
authored
Merge branch 'master' into spg_update
2 parents 6901dd3 + e83b0fd commit a7efea6

File tree

26 files changed

+1363
-1112
lines changed

26 files changed

+1363
-1112
lines changed

org.eclipse.scanning.api/src/org/eclipse/scanning/api/device/models/MalcolmModel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
*/
2222
public class MalcolmModel extends AbstractDetectorModel implements IMalcolmModel {
2323

24+
public MalcolmModel() {
25+
setTimeout(60*24); // 1 Day
26+
}
2427
/**
2528
* The folder for malcolm to create its HDF5 files in. This is set by the scan, any value
2629
* set by the user will be overwritten.

org.eclipse.scanning.api/src/org/eclipse/scanning/api/event/core/IConsumer.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ public interface IConsumer<T> extends IQueueConnection<T> {
8787
*/
8888
void stop() throws EventException;
8989

90+
/**
91+
* Awaits the start of the consumer. There are occasions
92+
* when the consumer should start in its own thread but
93+
* still provide the ability to await the startup process.
94+
*
95+
* @throws Exception
96+
*/
97+
void awaitStart() throws InterruptedException;
9098

9199
/**
92100
* Starts the consumer and block. Similar to Thread.run()
@@ -141,6 +149,36 @@ default ConsumerStatus getConsumerStatus() {
141149
*/
142150
public boolean isActive();
143151

152+
/**
153+
* Durable consumers try to keep going when there are exceptions.
154+
* @return
155+
*/
144156
public boolean isDurable();
157+
158+
/**
159+
* Durable consumers try to keep going when there are exceptions.
160+
* @param durable
161+
*/
145162
public void setDurable(boolean durable);
163+
164+
/**
165+
* If the consumer should pause when it is started with
166+
* jobs in the queue and wait until the user requires it to unpause.
167+
*
168+
* NOTE: setPauseOnStartup(...) must be called before the consumer is started!
169+
*
170+
* @return
171+
*/
172+
boolean isPauseOnStart();
173+
174+
/**
175+
* If the consumer should pause when it is started with
176+
* jobs in the queue and wait until the user requires it to unpause.
177+
*
178+
* NOTE: setPauseOnStartup(...) must be called before the consumer is started!
179+
*
180+
* @param pauseOnStart
181+
*/
182+
void setPauseOnStart(boolean pauseOnStart);
183+
146184
}

org.eclipse.scanning.api/src/org/eclipse/scanning/api/event/core/IDisconnectable.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @author Matthew Gerring
2121
*
2222
*/
23+
@FunctionalInterface
2324
public interface IDisconnectable {
2425

2526
/**
@@ -34,5 +35,7 @@ public interface IDisconnectable {
3435
/**
3536
*
3637
*/
37-
public boolean isDisconnected();
38+
default boolean isDisconnected() {
39+
return false;
40+
}
3841
}

org.eclipse.scanning.api/src/org/eclipse/scanning/api/event/servlet/IConnectable.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,12 @@
1414
import java.net.URISyntaxException;
1515

1616
import org.eclipse.scanning.api.event.EventException;
17+
import org.eclipse.scanning.api.event.core.IDisconnectable;
1718

18-
public interface IConnectable {
19+
public interface IConnectable extends IDisconnectable {
1920
/**
2021
* Should called to start the servlet.
2122
* @param uri, a string representation of the activemq uri.
2223
*/
2324
public void connect() throws EventException, URISyntaxException;
24-
25-
/**
26-
* Should called to stop the servlet but if it is not called
27-
* the servlet will run the lifetime of the server.
28-
*
29-
* This is acceptable if it is a service client(s) may demand at
30-
* any time.
31-
*/
32-
public void disconnect() throws EventException;
33-
3425
}

0 commit comments

Comments
 (0)