jrun.servlet.session
Interface Session

All Superinterfaces:
ConfigurableServicePartitionMBean, java.io.Serializable, Service, ServiceMBean, ServicePartitionMBean, SessionServiceMBean
All Known Implementing Classes:
SessionService

public interface Session
extends SessionServiceMBean

The functional interface for the JRun session service.

Author:
Karl Moss

Fields inherited from interface jrunx.kernel.Service
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED
 
Method Summary
 void addSession(JRunSession session)
           
 javax.servlet.http.HttpSession createSession(java.lang.String id)
          Create and register a new session
 java.lang.String encodeURL(java.lang.String url, java.lang.String id)
           
 javax.servlet.http.HttpSession findSession(java.lang.String sessionId)
          Returns the Session bound to the specified session id, or null if the specified session id does not refer to a valid Session.
 void fireSessionCreatedEvent(javax.servlet.http.HttpSession session)
          Fire a sessionCreated event to all of the HttpSessionListener instances
 void fireSessionDestroyedEvent(javax.servlet.http.HttpSession session)
          Fire a sessionDestroyed event to all of the HttpSessionListener instances
 javax.servlet.http.Cookie getCookie(java.lang.String id)
          Return a cookie for tracking this session id
 java.lang.String getCookieSessionID(javax.servlet.http.HttpServletRequest request)
          Attempt to get the session ID from a cookie
 java.util.ArrayList getSessions()
           
 java.lang.String getUrlSessionID(javax.servlet.http.HttpServletRequest request)
          Attempt to get the session ID from the URL
 WebApplication getWebApplication()
          Returns the owning WebApplication
 void invalidateSession(java.lang.String id)
          Invalidates the given session ID
 boolean isReplicationServicePresent()
          Determine if a replication service is present.
 void replicate(javax.servlet.http.HttpSession session)
          If possible, replicates the session to all replication buddies.
 JRunSession retrieve(SessionHolder h)
          Retrieve a session from persistent storage
 void scheduleRunnable(java.lang.Runnable runnable, long msFromNow)
          Schedule a runnable to execute using the standard SchedulerService
 void setClassLoader(java.lang.ClassLoader loader)
          Tells the session persistence mechanism that a new classloader is being used
 void setMostRecentlyUsed(int id)
          Marks the given session ID as most recently used
 void unscheduleRunnable(java.lang.Runnable runnable)
          Unschedule a runnable to execute using the standard SchedulerService
 void updateInMemoryCount(int n)
          Updates the in memory count metric
 
Methods inherited from interface jrun.servlet.session.SessionServiceMBean
getCookieActive, getMaxInactiveInterval, getSessionService, setMaxInactiveInterval
 
Methods inherited from interface jrunx.kernel.ConfigurableServicePartitionMBean
setChildElements
 
Methods inherited from interface jrunx.kernel.ServicePartitionMBean
addService, addService, iterator, removeService, removeService
 
Methods inherited from interface jrunx.kernel.ServiceMBean
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind
 
Methods inherited from interface jrunx.kernel.Service
destroy, getStatus, init, start, stop, updateStatus
 

Method Detail

scheduleRunnable

public void scheduleRunnable(java.lang.Runnable runnable,
                             long msFromNow)
Schedule a runnable to execute using the standard SchedulerService
Parameters:
runnable - The runnable
msFromNow - The number of ms from now to run, or 0 for immediate

unscheduleRunnable

public void unscheduleRunnable(java.lang.Runnable runnable)
Unschedule a runnable to execute using the standard SchedulerService
Parameters:
runnable - The runnable

invalidateSession

public void invalidateSession(java.lang.String id)
Invalidates the given session ID
Parameters:
sessionID - The session ID

retrieve

public JRunSession retrieve(SessionHolder h)
Retrieve a session from persistent storage
Parameters:
holder - The SessionHolder
Returns:
The session object or null if not found

updateInMemoryCount

public void updateInMemoryCount(int n)
Updates the in memory count metric
Parameters:
n - The number to increment/decrement

setMostRecentlyUsed

public void setMostRecentlyUsed(int id)
Marks the given session ID as most recently used
Parameters:
id - The session ID

findSession

public javax.servlet.http.HttpSession findSession(java.lang.String sessionId)
Returns the Session bound to the specified session id, or null if the specified session id does not refer to a valid Session.

createSession

public javax.servlet.http.HttpSession createSession(java.lang.String id)
Create and register a new session

getUrlSessionID

public java.lang.String getUrlSessionID(javax.servlet.http.HttpServletRequest request)
Attempt to get the session ID from the URL

getCookieSessionID

public java.lang.String getCookieSessionID(javax.servlet.http.HttpServletRequest request)
Attempt to get the session ID from a cookie

encodeURL

public java.lang.String encodeURL(java.lang.String url,
                                  java.lang.String id)

getCookie

public javax.servlet.http.Cookie getCookie(java.lang.String id)
Return a cookie for tracking this session id

getWebApplication

public WebApplication getWebApplication()
Returns the owning WebApplication

fireSessionCreatedEvent

public void fireSessionCreatedEvent(javax.servlet.http.HttpSession session)
Fire a sessionCreated event to all of the HttpSessionListener instances

fireSessionDestroyedEvent

public void fireSessionDestroyedEvent(javax.servlet.http.HttpSession session)
Fire a sessionDestroyed event to all of the HttpSessionListener instances

setClassLoader

public void setClassLoader(java.lang.ClassLoader loader)
Tells the session persistence mechanism that a new classloader is being used

isReplicationServicePresent

public boolean isReplicationServicePresent()
Determine if a replication service is present.
Returns:
true if a replication service is present

replicate

public void replicate(javax.servlet.http.HttpSession session)
If possible, replicates the session to all replication buddies.

addSession

public void addSession(JRunSession session)

getSessions

public java.util.ArrayList getSessions()
                                throws java.io.IOException


Copyright � 2002 Macromedia Corporation. All Rights Reserved.