atg.adc
Class ADCEventMonitor

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.adc.ADCEventMonitor
All Implemented Interfaces:
MessageSink, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class ADCEventMonitor
extends GenericService
implements MessageSink

This class is listens for events sent while processing the request, and stores them in a request-scoped ADCRequestData object. This class also triggers the pipeline that produces the auto-tagging output.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.util.Map mBodyDataReporterMap
          Map of bodyDataReporters keyed by ADC client name
protected  java.util.Map mHeadDataReporterMap
          Map of headDataReporters keyed by ADC client name
protected static java.util.ResourceBundle sResourceBundle
          Resource Bundle
 
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
ADCEventMonitor()
           
 
Method Summary
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
protected  ADCDataReporter[] findDataReporter(java.util.Map pDataReporters, java.lang.String pClientName)
          Locate the ADCDataReporter with the specified client name.
protected  java.util.Map generateDataReporterMap(ADCDataReporter[] pDataReporters)
          Construct a map version of an ADCDataReporter array using the data reporters' client names as keys.
 ADCDataReporter[] getBodyDataReporters()
           
 ADCRequestData getCurrentRequestData()
          Return the EventHolder associated with the current request.
 ADCDataReporter[] getHeadDataReporters()
           
 java.lang.String getRequestDataPath()
           
 java.lang.String processADCData(ADCDataReporter[] pDataReporters)
          Generate page content for the current request using the specified array of ADCDataReporters.
 java.lang.String processBodyData()
          Generate page content for the current request using the configured bodyDataReporters.
 java.lang.String processBodyData(java.lang.String pClientName)
          Generate page content for the current request using the bodyDataReporter configured for to specified ADC client.
 java.lang.String processHeadData()
          Generate page content for the current request using the configured headDataReporters.
 java.lang.String processHeadData(java.lang.String pClientName)
          Generate page content for the current request using the headDataReporter configured for to specified ADC client.
 void receiveMessage(java.lang.String pPortName, javax.jms.Message pMessage)
          For every event we receive, store it in the requestData component.
 void setBodyDataReporters(ADCDataReporter[] pBodyDataReporters)
          The components responsible for generating client-specific auto-tagging data (e.g., javascript) just before the </body> tag.
 void setHeadDataReporters(ADCDataReporter[] pHeadDataReporters)
          The components responsible for generating client-specific auto-tagging data (e.g., javascript) just before the </head> tag.
 void setRequestDataPath(java.lang.String pRequestDataPath)
          The path to the request-scoped Nucleus component that holds the events for the current request.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, 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, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

sResourceBundle

protected static java.util.ResourceBundle sResourceBundle
Resource Bundle


mHeadDataReporterMap

protected java.util.Map mHeadDataReporterMap
Map of headDataReporters keyed by ADC client name


mBodyDataReporterMap

protected java.util.Map mBodyDataReporterMap
Map of bodyDataReporters keyed by ADC client name

Constructor Detail

ADCEventMonitor

public ADCEventMonitor()
Method Detail

setRequestDataPath

public void setRequestDataPath(java.lang.String pRequestDataPath)
The path to the request-scoped Nucleus component that holds the events for the current request.

Parameters:
pRequestDataPath - the path to the request-scoped Nucleus component that holds the events for the current request.

getRequestDataPath

public java.lang.String getRequestDataPath()
Returns:
The path to the request scoped Nucleus component that holds the events for the current request

setHeadDataReporters

public void setHeadDataReporters(ADCDataReporter[] pHeadDataReporters)
The components responsible for generating client-specific auto-tagging data (e.g., javascript) just before the </head> tag.

Parameters:
pADCDataReporter - the class responsible for generating the client-specific auto-tagging data.

getHeadDataReporters

public ADCDataReporter[] getHeadDataReporters()
Returns:
The components responsible for generating client-specific auto-tagging data (e.g., javascript) just before the </head> tag.

setBodyDataReporters

public void setBodyDataReporters(ADCDataReporter[] pBodyDataReporters)
The components responsible for generating client-specific auto-tagging data (e.g., javascript) just before the </body> tag.

Parameters:
pADCDataReporter - the class responsible for generating the client-specific auto-tagging data.

getBodyDataReporters

public ADCDataReporter[] getBodyDataReporters()
Returns:
The components responsible for generating client-specific auto-tagging data (e.g., javascript) just before the </body> tag.

doStartService

public void doStartService()
                    throws ServiceException
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. The Service should override this method to start any processes it requires.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

receiveMessage

public void receiveMessage(java.lang.String pPortName,
                           javax.jms.Message pMessage)
                    throws javax.jms.JMSException
For every event we receive, store it in the requestData component.

Specified by:
receiveMessage in interface MessageSink
Parameters:
pPortName - the name of the port on which the message was received
pMessage - the JMS message received.
Throws:
javax.jms.JMSException
See Also:
MessageSink.receiveMessage(java.lang.String, javax.jms.Message)

processADCData

public java.lang.String processADCData(ADCDataReporter[] pDataReporters)
Generate page content for the current request using the specified array of ADCDataReporters. If there is an exception, the empty string is returned.

Parameters:
pDataReporters - the array of ADCDataReporters to invoke
Returns:
the generated page content for the current request

processBodyData

public java.lang.String processBodyData()
Generate page content for the current request using the configured bodyDataReporters.

Returns:
the generated page content for the current request

processBodyData

public java.lang.String processBodyData(java.lang.String pClientName)
Generate page content for the current request using the bodyDataReporter configured for to specified ADC client.

Parameters:
pClientName - the name of the ADC client or null to process all clients
Returns:
the generated page content for the current request

processHeadData

public java.lang.String processHeadData()
Generate page content for the current request using the configured headDataReporters.

Returns:
the generated page content for the current request

processHeadData

public java.lang.String processHeadData(java.lang.String pClientName)
Generate page content for the current request using the headDataReporter configured for to specified ADC client.

Parameters:
pClientName - the name of the ADC client or null to process all clients
Returns:
the generated page content for the current request

getCurrentRequestData

public ADCRequestData getCurrentRequestData()
Return the EventHolder associated with the current request.

Returns:
The EventHolder associated with the current request.

findDataReporter

protected ADCDataReporter[] findDataReporter(java.util.Map pDataReporters,
                                             java.lang.String pClientName)
Locate the ADCDataReporter with the specified client name.

Parameters:
pDataReporters - the Map of candidate ADCDataReporters
pClientName - the name to locate in the Map
Returns:
An array containing the named ADCDataReporter

generateDataReporterMap

protected java.util.Map generateDataReporterMap(ADCDataReporter[] pDataReporters)
Construct a map version of an ADCDataReporter array using the data reporters' client names as keys.

Returns:
The Map of ADCDataReporters keyed by client name