Interface Emulator

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
JettyEmulator

public interface Emulator extends Closeable
The application server emulator interface.
Author:
Hawk
  • Method Details

    • getHost

      String getHost()
      get the host address the emulator bound. normally, it should be "127.0.0.1".
      Returns:
      host address
    • getPort

      int getPort()
      get the port number the emulator bound.
      Returns:
      port number
    • getAddress

      String getAddress()
      get the URL address.
      Returns:
      URL.
    • getContextPath

      String getContextPath()
      get the context path of the application
      Returns:
      the context path
    • getServletContext

      jakarta.servlet.ServletContext getServletContext()
      get the reference of servlet context in the emulator.
      Returns:
      servlet context
    • getRequestAttributes

      Map<String,Object> getRequestAttributes()
      get the attributes of last request.
      Returns:
      attributes.
    • getRequestParameters

      Map<String,String[]> getRequestParameters()
      get the parameters of last request.
      Returns:
      parameters.
    • getSessionAttributes

      Map<String,Object> getSessionAttributes()
      get the session's attributes of last request.
      Returns:
      attributes.
    • getSessionId

      String getSessionId()
      get the session ID of last request.
      Returns:
      ID or null if no session created.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable