Package org.eclipse.jetty.server.session
Class SessionContext
- java.lang.Object
-
- org.eclipse.jetty.server.session.SessionContext
-
public class SessionContext extends java.lang.Object
SessionContext Information about the context to which sessions belong: the Context, the SessionHandler of the context, and the unique name of the node. A SessionHandler is 1:1 with a SessionContext.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
_canonicalContextPath
private ContextHandler.Context
_context
private SessionHandler
_sessionHandler
private java.lang.String
_vhost
private java.lang.String
_workerName
static java.lang.String
NULL_VHOST
-
Constructor Summary
Constructors Constructor Description SessionContext(java.lang.String workerName, ContextHandler.Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
canonicalize(java.lang.String path)
Make an acceptable name from a context path.private java.lang.String
canonicalizeContextPath(ContextHandler.Context context)
private java.lang.String
canonicalizeVHost(ContextHandler.Context context)
Get the first virtual host for the context.java.lang.String
getCanonicalContextPath()
ContextHandler.Context
getContext()
SessionHandler
getSessionHandler()
java.lang.String
getVhost()
java.lang.String
getWorkerName()
void
run(java.lang.Runnable r)
Run a runnable in the context (with context classloader set) if there is one, otherwise just run it.java.lang.String
toString()
-
-
-
Field Detail
-
NULL_VHOST
public static final java.lang.String NULL_VHOST
- See Also:
- Constant Field Values
-
_context
private ContextHandler.Context _context
-
_sessionHandler
private SessionHandler _sessionHandler
-
_workerName
private java.lang.String _workerName
-
_canonicalContextPath
private java.lang.String _canonicalContextPath
-
_vhost
private java.lang.String _vhost
-
-
Constructor Detail
-
SessionContext
public SessionContext(java.lang.String workerName, ContextHandler.Context context)
-
-
Method Detail
-
getWorkerName
public java.lang.String getWorkerName()
-
getSessionHandler
public SessionHandler getSessionHandler()
-
getContext
public ContextHandler.Context getContext()
-
getCanonicalContextPath
public java.lang.String getCanonicalContextPath()
-
getVhost
public java.lang.String getVhost()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
run
public void run(java.lang.Runnable r)
Run a runnable in the context (with context classloader set) if there is one, otherwise just run it.- Parameters:
r
- the runnable
-
canonicalizeContextPath
private java.lang.String canonicalizeContextPath(ContextHandler.Context context)
-
canonicalizeVHost
private java.lang.String canonicalizeVHost(ContextHandler.Context context)
Get the first virtual host for the context. Used to help identify the exact session/contextPath.- Returns:
- 0.0.0.0 if no virtual host is defined
-
canonicalize
private java.lang.String canonicalize(java.lang.String path)
Make an acceptable name from a context path.- Parameters:
path
- the path to normalize/fix- Returns:
- the clean/acceptable form of the path
-
-