Interface Emulator
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
JettyEmulator
public interface Emulator extends Closeable
The application server emulator interface.- Author:
- Hawk
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()StringgetAddress()get the URL address.StringgetContextPath()get the context path of the applicationStringgetHost()get the host address the emulator bound.intgetPort()get the port number the emulator bound.Map<String,Object>getRequestAttributes()get the attributes of last request.Map<String,String[]>getRequestParameters()get the parameters of last request.javax.servlet.ServletContextgetServletContext()get the reference of servlet context in the emulator.Map<String,Object>getSessionAttributes()get the session's attributes of last request.StringgetSessionId()get the session ID of last request.
-
-
-
Method Detail
-
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
javax.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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-