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 Details

  • Constructor Details

    • AbstractResponderServlet

      protected AbstractResponderServlet()
    • AbstractResponderServlet

      protected AbstractResponderServlet(String requestTopic, String responseTopic)
    • AbstractResponderServlet

      protected AbstractResponderServlet(String requestTopic, String responseTopic, String broker)
  • Method Details

    • connect

      @PostConstruct public void connect() throws EventException, URISyntaxException
      Description copied from interface: IConnectable
      Should called to start the servlet.
      Specified by:
      connect in interface IConnectable
      Throws:
      EventException
      URISyntaxException
    • createResponseCreator

      protected IResponseCreator<B> createResponseCreator()
      Override to change the behaviour of the IResponseCreator
      Returns:
    • isConnected

      public boolean isConnected()
      Description copied from interface: IConnection
      Returns whether this connection is connected. This method returns true until disconnect is called, even if the connection is created lazily.
      Specified by:
      isConnected in interface IConnection
      Returns:
      true if connected, false otherwise
    • disconnect

      @PreDestroy public void disconnect() throws EventException
      Description copied from interface: IConnection
      Call 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 method IConnection.close(), inherited from AutoCloseable calls this method, which means that if an object of a class implementing IConnection is used with a try-with-resources block this method will be called automatically when exiting that block.
      Specified by:
      disconnect in interface IConnection
      Throws:
      EventException - if resource could not be disconnected.
    • getBroker

      public String getBroker()
    • setBroker

      public void setBroker(String uri)
    • getRequestTopic

      public String getRequestTopic()
    • setRequestTopic

      public void setRequestTopic(String requestTopic)
    • getResponseTopic

      public String getResponseTopic()
    • setResponseTopic

      public void setResponseTopic(String responseTopic)
    • toString

      public String toString()
      Overrides:
      toString in class Object