Interface ISubmitter<T>
- Type Parameters:
T- Bean type which will be submitted.
- All Superinterfaces:
AutoCloseable,IConnection,IURIConnection
A submitter is a queue connection which may receive a submission on to the queue.
-
Method Summary
Modifier and TypeMethodDescriptionvoidblockingSubmit(T bean) Send a submission on to the queue.longintThe status topic, if any, that after submission, the job queue will publish events from.voidsetLifeTime(long lifetime) Sets the lifetime of messages.voidsetPriority(int priority) Sets the priority of messages submitted by this submitter.voidsetStatusTopicName(String name) The status topic, if any, that after submission, the job queue will publish events from.voidSend a submission on to the queue.Methods inherited from interface org.eclipse.scanning.api.event.core.IConnection
close, disconnect, isConnectedMethods inherited from interface org.eclipse.scanning.api.event.core.IURIConnection
getConnectorService, getUri
-
Method Details
-
submit
Send a submission on to the queue.- Parameters:
bean-- Throws:
EventException
-
blockingSubmit
void blockingSubmit(T bean) throws EventException, InterruptedException, IllegalStateException, ScanningException Send a submission on to the queue. Blocks until bean is updated with "final" status. This method depends on this.setStatusTopicName() already having been called with the appropriate status queue name by the user of this ISubmitter, because this method's implementation listens to the said status topic to determine when to return.- Parameters:
bean-- Throws:
EventExceptionInterruptedExceptionIllegalStateException- if this.getStatusTopicName() returns null.ScanningException- if the scan finishes withStatus.FAILED.
-
getStatusTopicName
String getStatusTopicName()The status topic, if any, that after submission, the job queue will publish events from. May be left unset.- Returns:
-
setStatusTopicName
The status topic, if any, that after submission, the job queue will publish events from. May be left unset.- Parameters:
name-
-
getPriority
int getPriority()- Returns:
- the priority of messages submitted by this submitter.
-
setPriority
void setPriority(int priority) Sets the priority of messages submitted by this submitter. From the Javadoc from the underlying JMS implementation (javax.jms.MessageProducer#setPriority):The JMS API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. Clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority. Priority is set to 4 by default.
- Parameters:
priority-
-
getLifeTime
long getLifeTime()- Returns:
- the lifetime of messages
-
setLifeTime
void setLifeTime(long lifetime) Sets the lifetime of messages.- Parameters:
lifetime-
-