|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.nucleus.TimedOperationService atg.servlet.pipeline.PipelineableServletImpl atg.servlet.pipeline.InsertableServletImpl atg.userprofiling.SessionEventTrigger
public class SessionEventTrigger
This class fires off SessionEvents for new sessions and expired sessions.
It implements the request pipeline interface so that whenever a new session is created for a request, a SessionEvent can be fired.
Additionally it implements the NameContextBindingListener interface so it can listen to the SessionManager as it unbinds session objects (i.e. expires sessions) and thus fire a SessionEvent.
Why doesn't it also listen for the binding of session objects instead of sitting in the pipeline? If that was done, we could not get a handle to the request object or the profile object to pass along with the SessionEvent.
At this point you should note that SessionEvents for session expiration do not contain the request object.
This class must be inserted into the request pipeline (probably best to insert it after DynamoServlet) in order for it to watch for new sessions.
This class must be added to the SessionManager's list of nameContextBindingListeners in order for it to know when sessions are destroyed.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
SessionEventTrigger()
Empty constructor. |
Method Summary | |
---|---|
void |
doStartService()
Starts the service. |
atg.service.event.EventDistributor |
getDistributor()
The EventDistributor to send fired events to. |
atg.userprofiling.dms.DPSMessageSource |
getMessageSource()
Returns property messageSource |
long |
getNumEndSessionEvents()
Returns property NumEndSessionEvents |
long |
getNumNewSessionEvents()
Returns property NumNewSessionEvents |
long |
getNumReferrerEvents()
Returns property NumReferrerEvents |
java.lang.String |
getProfilePath()
The full name of the Profile component for every request. |
java.lang.String |
getSessionManagerPath()
The component name and path for the SessionManager. |
boolean |
isBroadcastExpiredSessionEvents()
Returns property BroadcastExpiredSessionEvents |
boolean |
isBroadcastNewSessionEvents()
Returns property BroadcastNewSessionEvents |
boolean |
isBroadcastReferrerEvents()
Returns property BroadcastReferrerEvents |
void |
nameContextElementPreBound(NameContextBindingEvent pEvent)
Called when a new session is created. |
void |
nameContextElementPreUnbound(NameContextBindingEvent pEvent)
Called just before a session is destroyed. |
void |
nameContextElementUnbound(NameContextBindingEvent pEvent)
Called just after a session is removed from its name context. |
void |
service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Method called by the pipline to service the request. |
void |
setBroadcastExpiredSessionEvents(boolean pBroadcastExpiredSessionEvents)
Sets property BroadcastExpiredSessionEvents |
void |
setBroadcastNewSessionEvents(boolean pBroadcastNewSessionEvents)
Sets property BroadcastNewSessionEvents |
void |
setBroadcastReferrerEvents(boolean pBroadcastReferrerEvents)
Sets property BroadcastReferrerEvents |
void |
setDistributor(atg.service.event.EventDistributor pValue)
The EventDistributor to send fired events to. |
void |
setMessageSource(atg.userprofiling.dms.DPSMessageSource pMessageSource)
Sets property messageSource |
void |
setProfilePath(java.lang.String pValue)
The full name of the Profile component for every request. |
void |
setSessionManagerPath(java.lang.String pValue)
The component name and path for the SessionManager. |
Methods inherited from class atg.servlet.pipeline.InsertableServletImpl |
---|
getInsertAfterServlet, setInsertAfterServlet |
Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl |
---|
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo |
Methods inherited from class atg.nucleus.TimedOperationService |
---|
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface atg.naming.NameContextBindingListener |
---|
nameContextElementBound |
Methods inherited from interface atg.servlet.pipeline.PipelineableServlet |
---|
getNextServlet, passRequest, setNextServlet |
Methods inherited from interface javax.servlet.Servlet |
---|
destroy, getServletConfig, getServletInfo, init, service |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public SessionEventTrigger()
Method Detail |
---|
public void setDistributor(atg.service.event.EventDistributor pValue)
public atg.service.event.EventDistributor getDistributor()
public void setSessionManagerPath(java.lang.String pValue)
public java.lang.String getSessionManagerPath()
public void setProfilePath(java.lang.String pValue)
public java.lang.String getProfilePath()
public long getNumNewSessionEvents()
public long getNumEndSessionEvents()
public long getNumReferrerEvents()
public void setBroadcastReferrerEvents(boolean pBroadcastReferrerEvents)
public boolean isBroadcastReferrerEvents()
public void setBroadcastNewSessionEvents(boolean pBroadcastNewSessionEvents)
public boolean isBroadcastNewSessionEvents()
public void setBroadcastExpiredSessionEvents(boolean pBroadcastExpiredSessionEvents)
public boolean isBroadcastExpiredSessionEvents()
public void setMessageSource(atg.userprofiling.dms.DPSMessageSource pMessageSource)
public atg.userprofiling.dms.DPSMessageSource getMessageSource()
public void doStartService() throws ServiceException
doStartService
in class InsertableServletImpl
ServiceException
- if the Service had a problem starting uppublic void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
service
in class PipelineableServletImpl
java.io.IOException
- if an error occurred while reading or writing
the servlet request
javax.servlet.ServletException
- if an error occurred while processing
the servlet requestpublic void nameContextElementPreBound(NameContextBindingEvent pEvent)
nameContextElementPreBound
in interface atg.naming.NameContextPreBindingListener
public void nameContextElementUnbound(NameContextBindingEvent pEvent)
nameContextElementUnbound
in interface NameContextBindingListener
nameContextElementUnbound
in class GenericService
public void nameContextElementPreUnbound(NameContextBindingEvent pEvent)
nameContextElementPreUnbound
in interface atg.naming.NameContextPreBindingListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |