|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tuscany.sca.host.webapp.WebAppServletHost
public class WebAppServletHost
ServletHost implementation for use in a webapp environment. FIXME: using a static singleton seems a big hack but how should it be shared? Need some way for TuscanyServlet to pull it out.
Field Summary | |
---|---|
static java.lang.String |
SCA_DOMAIN_ATTRIBUTE
|
Method Summary | |
---|---|
void |
addServletMapping(java.lang.String suri,
Servlet servlet)
Add a mapping for an instance of a Servlet. |
java.lang.String |
getContextPath()
Returns the portion of the request URI that indicates the context of the request |
java.lang.String |
getContributionRoot()
|
protected java.lang.String |
getContributionRoot(ServletContext servletContext)
|
int |
getDefaultPort()
Returns the default port for the server. |
static WebAppServletHost |
getInstance()
|
RequestDispatcher |
getRequestDispatcher(java.lang.String suri)
Returns a Servlet request dispatcher for the Servlet mapped to the specified URI. |
Servlet |
getServletMapping(java.lang.String suri)
Returns the Servlet mapped to the given URI. |
java.net.URL |
getURLMapping(java.lang.String suri)
Returns the complete URL mapped to the specified URI. |
void |
init(ServletConfig config)
|
void |
initContextPath(ServletConfig config)
Initializes the contextPath The 2.5 Servlet API has a getter for this, for pre 2.5 Servlet containers use an init parameter. |
Servlet |
removeServletMapping(java.lang.String suri)
Remove a Servlet mapping. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setContextPath(java.lang.String path)
Sets the portion of the request URI that indicates the context of the request |
void |
setContextPath2(java.lang.String path)
TODO: How context paths work is still up in the air so for now this hacks in a path that gets some samples working can't use setContextPath as NodeImpl calls that later |
void |
setDefaultPort(int port)
Sets the default port for the server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SCA_DOMAIN_ATTRIBUTE
Method Detail |
---|
public void setDefaultPort(int port)
ServletHost
setDefaultPort
in interface ServletHost
port
- the default portpublic int getDefaultPort()
ServletHost
getDefaultPort
in interface ServletHost
public void addServletMapping(java.lang.String suri, Servlet servlet) throws ServletMappingException
ServletHost
addServletMapping
in interface ServletHost
suri
- the URI-mapping for the Servletservlet
- the Servlet that should be invoked
ServletMappingException
public Servlet removeServletMapping(java.lang.String suri) throws ServletMappingException
ServletHost
removeServletMapping
in interface ServletHost
suri
- the URI-mapping for the Servlet
ServletMappingException
public Servlet getServletMapping(java.lang.String suri) throws ServletMappingException
ServletHost
getServletMapping
in interface ServletHost
suri
- the URI-mapping for the Servlet
ServletMappingException
public java.net.URL getURLMapping(java.lang.String suri) throws ServletMappingException
ServletHost
getURLMapping
in interface ServletHost
ServletMappingException
public RequestDispatcher getRequestDispatcher(java.lang.String suri) throws ServletMappingException
ServletHost
getRequestDispatcher
in interface ServletHost
suri
- the URI mapped to a Servlet
ServletMappingException
public static WebAppServletHost getInstance()
public void init(ServletConfig config) throws ServletException
ServletException
protected java.lang.String getContributionRoot(ServletContext servletContext)
public void initContextPath(ServletConfig config)
public java.lang.String getContextPath()
ServletHost
getContextPath
in interface ServletHost
public void setContextPath(java.lang.String path)
ServletHost
setContextPath
in interface ServletHost
path
- the context pathpublic void setContextPath2(java.lang.String path)
public java.lang.String getContributionRoot()
public void setAttribute(java.lang.String name, java.lang.Object value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |