Class TomcatContext
java.lang.Object
org.jboss.modcluster.container.tomcat.TomcatContext
- All Implemented Interfaces:
Context
Context
implementation that wraps a Context
.- Author:
- Paul Ferraro, Radoslav Husar
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.apache.catalina.Context
protected final Host
protected final TomcatRegistry
-
Constructor Summary
ConstructorDescriptionTomcatContext
(TomcatRegistry registry, org.apache.catalina.Context context) TomcatContext
(TomcatRegistry registry, org.apache.catalina.Context context, RequestListenerValveFactory valveFactory) -
Method Summary
Modifier and TypeMethodDescriptionadaptSessionListener
(HttpSessionListener sessionListener) void
addRequestListener
(ServletRequestListener requestListener) Registers the specified request listener with this context.void
addSessionListener
(HttpSessionListener sessionListener) Adds the specified session listener to this context.boolean
int
Returns the number of active sessions for this context.getHost()
Returns host associated with this context.getPath()
Returns the context path.int
hashCode()
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.toString()
-
Field Details
-
context
protected final org.apache.catalina.Context context -
host
-
registry
-
-
Constructor Details
-
TomcatContext
public TomcatContext(TomcatRegistry registry, org.apache.catalina.Context context, RequestListenerValveFactory valveFactory) -
TomcatContext
-
-
Method Details
-
getHost
Description copied from interface:Context
Returns host associated with this context. -
getPath
Description copied from interface:Context
Returns the context path. The root context needs to be represented as an empty string (""). -
isStarted
public boolean isStarted()Description copied from interface:Context
Returns whether this context is started and ready to accept requests. -
addRequestListener
Description copied from interface:Context
Registers the specified request listener with this context. Used for request draining.- Specified by:
addRequestListener
in interfaceContext
- Parameters:
requestListener
- request listener to register
-
removeRequestListener
Description copied from interface:Context
Removes the specified previously registered request listener.- Specified by:
removeRequestListener
in interfaceContext
- Parameters:
requestListener
- request listener to remove
-
getActiveSessionCount
public int getActiveSessionCount()Description copied from interface:Context
Returns the number of active sessions for this context.- Specified by:
getActiveSessionCount
in interfaceContext
- Returns:
- the active session count
-
isDistributable
public boolean isDistributable()Description copied from interface:Context
Indicates whether this context is distributable.- Specified by:
isDistributable
in interfaceContext
- Returns:
- true, if this context distributes sessions, false otherwise
-
addSessionListener
Description copied from interface:Context
Adds the specified session listener to this context.- Specified by:
addSessionListener
in interfaceContext
- Parameters:
sessionListener
- a session listener to register
-
removeSessionListener
Description copied from interface:Context
Removes the specified session listener to this context.- Specified by:
removeSessionListener
in interfaceContext
- Parameters:
sessionListener
- a session listener to remove
-
adaptSessionListener
-
equals
-
hashCode
public int hashCode() -
toString
-