Class JettyEmulator
java.lang.Object
org.zkoss.zats.mimic.impl.emulator.JettyEmulator
- All Implemented Interfaces:
Closeable,AutoCloseable,Emulator
The emulator implementation in Jetty Server.
- Author:
- pao
-
Constructor Summary
ConstructorsConstructorDescriptionJettyEmulator(org.eclipse.jetty.util.resource.Resource[] contentRoots, String descriptor, String contextPath) new a jetty emulatorJettyEmulator(org.eclipse.jetty.util.resource.Resource contentRoot, String descriptor, String contextPath) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()get the URL address.get the context path of the applicationgetHost()get the host address the emulator bound.intgetPort()get the port number the emulator bound.get the attributes of last request.get the parameters of last request.javax.servlet.ServletContextget the reference of servlet context in the emulator.get the session's attributes of last request.get the session ID of last request.
-
Constructor Details
-
JettyEmulator
-
JettyEmulator
public JettyEmulator(org.eclipse.jetty.util.resource.Resource[] contentRoots, String descriptor, String contextPath) new a jetty emulator- Parameters:
contentRoots- the content roots.descriptor- specify the web.xml, if null then use /WEB-INF/web.xml that in contentRootscontextPath- specify the context, if null then use "/"
-
-
Method Details
-
close
public void close() -
getHost
Description copied from interface:Emulatorget the host address the emulator bound. normally, it should be "127.0.0.1". -
getPort
public int getPort()Description copied from interface:Emulatorget the port number the emulator bound. -
getContextPath
Description copied from interface:Emulatorget the context path of the application- Specified by:
getContextPathin interfaceEmulator- Returns:
- the context path
-
getAddress
Description copied from interface:Emulatorget the URL address.- Specified by:
getAddressin interfaceEmulator- Returns:
- URL.
-
getServletContext
public javax.servlet.ServletContext getServletContext()Description copied from interface:Emulatorget the reference of servlet context in the emulator.- Specified by:
getServletContextin interfaceEmulator- Returns:
- servlet context
-
getRequestAttributes
Description copied from interface:Emulatorget the attributes of last request.- Specified by:
getRequestAttributesin interfaceEmulator- Returns:
- attributes.
-
getRequestParameters
Description copied from interface:Emulatorget the parameters of last request.- Specified by:
getRequestParametersin interfaceEmulator- Returns:
- parameters.
-
getSessionAttributes
Description copied from interface:Emulatorget the session's attributes of last request.- Specified by:
getSessionAttributesin interfaceEmulator- Returns:
- attributes.
-
getSessionId
Description copied from interface:Emulatorget the session ID of last request.- Specified by:
getSessionIdin interfaceEmulator- Returns:
- ID or null if no session created.
-