Class JettyEmulator
- java.lang.Object
-
- org.zkoss.zats.mimic.impl.emulator.JettyEmulator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Emulator
public class JettyEmulator extends Object implements Emulator
The emulator implementation in Jetty Server.- Author:
- pao
-
-
Constructor Summary
Constructors Constructor Description JettyEmulator(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
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
JettyEmulator
public JettyEmulator(org.eclipse.jetty.util.resource.Resource contentRoot, String descriptor, String contextPath)
-
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 Detail
-
close
public void close()
-
getHost
public String 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
public String getContextPath()
Description copied from interface:Emulatorget the context path of the application- Specified by:
getContextPathin interfaceEmulator- Returns:
- the context path
-
getAddress
public String 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
public Map<String,Object> getRequestAttributes()
Description copied from interface:Emulatorget the attributes of last request.- Specified by:
getRequestAttributesin interfaceEmulator- Returns:
- attributes.
-
getRequestParameters
public Map<String,String[]> getRequestParameters()
Description copied from interface:Emulatorget the parameters of last request.- Specified by:
getRequestParametersin interfaceEmulator- Returns:
- parameters.
-
getSessionAttributes
public Map<String,Object> getSessionAttributes()
Description copied from interface:Emulatorget the session's attributes of last request.- Specified by:
getSessionAttributesin interfaceEmulator- Returns:
- attributes.
-
getSessionId
public String getSessionId()
Description copied from interface:Emulatorget the session ID of last request.- Specified by:
getSessionIdin interfaceEmulator- Returns:
- ID or null if no session created.
-
-