Class AbstractJobQueueServlet<T extends StatusBean>
java.lang.Object
org.eclipse.scanning.server.servlet.AbstractJobQueueServlet<T>
- Type Parameters:
T- the type of bean consumed by this servlet
- All Implemented Interfaces:
AutoCloseable,IConnection,IConnectable,IJobQueueServlet<T>
- Direct Known Subclasses:
HeterogeneousScanServlet,ScanServlet
public abstract class AbstractJobQueueServlet<T extends StatusBean>
extends Object
implements IJobQueueServlet<T>
Class used to register a servlet
Spring config started servlets, for instance:
<bean id="scanPerformer" class="org.eclipse.scanning.server.servlet.ScanServlet" init-method="connect">
<property name="broker" value="tcp://p45-control:61616" />
<property name="submitQueue" value="uk.ac.diamond.p45.submitQueue" />
<property name="statusSet" value="uk.ac.diamond.p45.statusSet" />
<property name="statusTopic" value="uk.ac.diamond.p45.statusTopic" />
<property name="durable" value="true" />
</bean>
Use: property name="purgeQueue" value="false" to stop the startup phase purging old inactive jobs.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractJobQueueServlet(String submitQueue, String statusTopic) -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Should called to start the servlet.voidCall to disconnect any resources which we no longer need.protected abstract StringgetName()booleanbooleanReturns whether this connection is connected.booleanbooleanvoidsetBlocking(boolean blocking) voidvoidsetCommandTopic(String commandTopic) voidsetConsumer(IJobQueue<T> jobQueue) voidsetPauseOnStart(boolean pauseOnStart) voidsetPurgeQueue(boolean purgeQueue) voidsetQueueStatusTopic(String queueStatusTopic) voidsetStatusTopic(String statusTopic) voidsetSubmitQueue(String submitQueue) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.scanning.api.event.core.IConnection
closeMethods inherited from interface org.eclipse.scanning.api.event.servlet.IJobQueueServlet
createProcess
-
Field Details
-
eventService
-
broker
-
submitQueue
-
statusTopic
-
queueStatusTopic
-
commandTopic
-
commandAckTopic
-
jobQueue
-
-
Constructor Details
-
AbstractJobQueueServlet
protected AbstractJobQueueServlet() -
AbstractJobQueueServlet
-
-
Method Details
-
connect
Description copied from interface:IConnectableShould called to start the servlet.- Specified by:
connectin interfaceIConnectable- Throws:
EventExceptionURISyntaxException
-
getName
-
disconnect
Description copied from interface:IConnectionCall to disconnect any resources which we no longer need. The resource may have timed out so it might not be connected, in that case it silently returns. Note, that the methodIConnection.close(), inherited fromAutoCloseablecalls this method, which means that if an object of a class implementingIConnectionis used with a try-with-resources block this method will be called automatically when exiting that block.- Specified by:
disconnectin interfaceIConnection- Throws:
EventException- if resource could not be disconnected.
-
getJobQueue
-
getBroker
-
setBroker
-
getSubmitQueue
-
setSubmitQueue
-
getStatusTopic
-
setStatusTopic
-
getQueueStatusTopic
-
setQueueStatusTopic
-
getCommandTopic
-
setCommandTopic
-
getCommandAckTopic
-
isBlocking
public boolean isBlocking() -
setBlocking
public void setBlocking(boolean blocking) -
isConnected
public boolean isConnected()Description copied from interface:IConnectionReturns whether this connection is connected. This method returnstrueuntil disconnect is called, even if the connection is created lazily.- Specified by:
isConnectedin interfaceIConnection- Returns:
trueif connected,falseotherwise
-
isPurgeQueue
public boolean isPurgeQueue() -
setPurgeQueue
public void setPurgeQueue(boolean purgeQueue) -
setConsumer
-
isPauseOnStart
public boolean isPauseOnStart() -
setPauseOnStart
public void setPauseOnStart(boolean pauseOnStart)
-