Package org.jboss.modcluster.container
Interface Context
- All Known Implementing Classes:
TomcatContext
public interface Context
SPI for a web application context.
- Author:
- Paul Ferraro, Radoslav Husar
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequestListener
(ServletRequestListener requestListener) Registers the specified request listener with this context.void
addSessionListener
(HttpSessionListener sessionListener) Adds the specified session listener to this context.int
Returns the number of active sessions for this context.getHost()
Returns host associated with this context.getPath()
Returns the context path.boolean
Indicates whether this context is distributable.boolean
Returns whether this context is started and ready to accept requests.void
removeRequestListener
(ServletRequestListener requestListener) Removes the specified previously registered request listener.void
removeSessionListener
(HttpSessionListener sessionListener) Removes the specified session listener to this context.
-
Method Details
-
getHost
Host getHost()Returns host associated with this context.- Returns:
- host associated with this context
-
getPath
String getPath()Returns the context path. The root context needs to be represented as an empty string ("").- Returns:
- context path; empty string if it's a root context
-
isStarted
boolean isStarted()Returns whether this context is started and ready to accept requests.- Returns:
- whether this context is started and ready to accept requests
-
addRequestListener
Registers the specified request listener with this context. Used for request draining.- Parameters:
requestListener
- request listener to register
-
removeRequestListener
Removes the specified previously registered request listener.- Parameters:
requestListener
- request listener to remove
-
addSessionListener
Adds the specified session listener to this context.- Parameters:
sessionListener
- a session listener to register
-
removeSessionListener
Removes the specified session listener to this context.- Parameters:
sessionListener
- a session listener to remove
-
getActiveSessionCount
int getActiveSessionCount()Returns the number of active sessions for this context.- Returns:
- the active session count
-
isDistributable
boolean isDistributable()Indicates whether this context is distributable.- Returns:
- true, if this context distributes sessions, false otherwise
-