public class SessionEventTrigger extends InsertableServletImpl implements atg.naming.NameContextPreBindingListener, NameContextBindingListener
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.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEYDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
SessionEventTrigger()
Empty constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
getInsertAfterServlet, setInsertAfterServletcreateAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfogetAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatisticsaddLogListener, doStopService, getAbsoluteName, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopServicevlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnameContextElementBoundgetNextServlet, passRequest, setNextServletpublic 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 InsertableServletImplServiceException - if the Service had a problem starting uppublic void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
service in class PipelineableServletImpljava.io.IOException - if an error occurred while reading or writing
the servlet requestjavax.servlet.ServletException - if an error occurred while processing
the servlet requestpublic void nameContextElementPreBound(NameContextBindingEvent pEvent)
nameContextElementPreBound in interface atg.naming.NameContextPreBindingListenerpublic void nameContextElementUnbound(NameContextBindingEvent pEvent)
nameContextElementUnbound in interface NameContextBindingListenernameContextElementUnbound in class GenericServicepublic void nameContextElementPreUnbound(NameContextBindingEvent pEvent)
nameContextElementPreUnbound in interface atg.naming.NameContextPreBindingListener