Class AbstractResponderServlet<B extends IdBean>
java.lang.Object
org.eclipse.scanning.server.servlet.AbstractResponderServlet<B>
- Type Parameters:
T-
- All Implemented Interfaces:
AutoCloseable,IConnection,IConnectable,IResponderServlet<B>
- Direct Known Subclasses:
AcquireServlet,DeviceServlet,NodeInsertionRequestResponder,PositionerServlet
public abstract class AbstractResponderServlet<B extends IdBean>
extends Object
implements IResponderServlet<B>
Class used to register a servlet
S
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected IEventServiceprotected Stringprotected IResponder<B> protected String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractResponderServlet(String requestTopic, String responseTopic) protectedAbstractResponderServlet(String requestTopic, String responseTopic, String broker) -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Should called to start the servlet.protected IResponseCreator<B> Override to change the behaviour of the IResponseCreatorvoidCall to disconnect any resources which we no longer need.booleanReturns whether this connection is connected.voidvoidsetRequestTopic(String requestTopic) voidsetResponseTopic(String responseTopic) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.scanning.api.event.core.IConnection
closeMethods inherited from interface org.eclipse.scanning.api.event.servlet.IResponderServlet
createResponder
-
Field Details
-
eventService
-
broker
-
requestTopic
-
responseTopic
-
responder
-
-
Constructor Details
-
AbstractResponderServlet
protected AbstractResponderServlet() -
AbstractResponderServlet
-
AbstractResponderServlet
-
-
Method Details
-
connect
Description copied from interface:IConnectableShould called to start the servlet.- Specified by:
connectin interfaceIConnectable- Throws:
EventExceptionURISyntaxException
-
createResponseCreator
Override to change the behaviour of the IResponseCreator- Returns:
-
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
-
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.
-
getBroker
-
setBroker
-
getRequestTopic
-
setRequestTopic
-
getResponseTopic
-
setResponseTopic
-
toString
-