atg.dms.patchbay
Class EventSenderDroplet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.dms.patchbay.EventSenderDroplet
All Implemented Interfaces:
MessageSource, 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, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class EventSenderDroplet
extends DynamoServlet
implements MessageSource

This droplet was created to allow the user to send an object message by passing it in as a parameter: eventobject. The jms type of the message can be configured along with the port name to be used for sending messages.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 java.lang.String ERROR
           
 ParameterName EVENT_OBJECT
          The parameter containing the object to be sent in the JMS message
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
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
EventSenderDroplet()
           
 
Method Summary
 java.lang.String getEventType()
          The type of the event, this should be set to such things as: atg.commerce.order.Order if that is what is being sent.
 MessageSourceContext getMessageSourceContext()
          Return the message source context for this source.
 java.lang.String getPortName()
          The port on which this message is sent.
 boolean isAllowMessageSending()
          This class cannot send messages if this is false.
 boolean isEnableSending()
          If true the messages will be sent otherwise nothing is sent.
protected  java.io.Serializable retrieveEventObject(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is responsible for retrieving or constructing the event message that needs to be sent.
 void sendObjectMessage(java.io.Serializable pObjectMessage, java.lang.String pType, java.lang.String pPortName)
          Sends an object message of type pType, out on port pPortName.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method calls @see #retrieveEventObject and attempts to send it using #see sendObjectMessage if the returned value was not null.
 void setAllowMessageSending(boolean pAllowMessageSending)
           
 void setEnableSending(boolean pEnableSending)
           
 void setEventType(java.lang.String pEventType)
           
 void setMessageSourceContext(MessageSourceContext pMessageSourceContext)
          Set the message source context for this source.
 void setPortName(java.lang.String pPortName)
           
 void startMessageSource()
          This is called to tell the MessageSource that it may begin sending messages.
 void stopMessageSource()
          This is called to tell the MessageSource that it should stop sending messages.
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, init, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, 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 java.lang.String CLASS_VERSION
Class version string


EVENT_OBJECT

public final ParameterName EVENT_OBJECT
The parameter containing the object to be sent in the JMS message


ERROR

public final java.lang.String ERROR
See Also:
Constant Field Values
Constructor Detail

EventSenderDroplet

public EventSenderDroplet()
Method Detail

retrieveEventObject

protected java.io.Serializable retrieveEventObject(DynamoHttpServletRequest pRequest,
                                                   DynamoHttpServletResponse pResponse)
This method is responsible for retrieving or constructing the event message that needs to be sent. By default this method will look for an object parameter: eventobject to contain the event that needs to be sent. This method can be overriden to construct different types of events.

Parameters:
pRequest - the request object that was passed in through the service method
pResponse - the response object that was passed in through the service method

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
This method calls @see #retrieveEventObject and attempts to send it using #see sendObjectMessage if the returned value was not null.

Overrides:
service in class DynamoServlet
Parameters:
pRequest - the request to be processed
pResponse - the response object for this request
Throws:
javax.servlet.ServletException - an application specific error occurred processing this request
java.io.IOException - an error occurred reading data from the request or writing data to the response.

sendObjectMessage

public void sendObjectMessage(java.io.Serializable pObjectMessage,
                              java.lang.String pType,
                              java.lang.String pPortName)
                       throws javax.jms.JMSException
Sends an object message of type pType, out on port pPortName. Note, that it is critical that messages being sent are in a transaction.

Parameters:
pObjectMessage - the object to be placed in the object message.
pType - the type of the message being sent.
pPortName - the port on which this message is going to be sent.
Throws:
javax.jms.JMSException - is thrown when a failure to send the message occurs. This is generally a configuration issue.

setMessageSourceContext

public void setMessageSourceContext(MessageSourceContext pMessageSourceContext)
Set the message source context for this source. @see atg.dms.patchbay.MessageSource

Specified by:
setMessageSourceContext in interface MessageSource

getMessageSourceContext

public MessageSourceContext getMessageSourceContext()
Return the message source context for this source.


setAllowMessageSending

public void setAllowMessageSending(boolean pAllowMessageSending)

isAllowMessageSending

public boolean isAllowMessageSending()
This class cannot send messages if this is false. Usually set during parsing of the configuration file.


startMessageSource

public void startMessageSource()
This is called to tell the MessageSource that it may begin sending messages.

Specified by:
startMessageSource in interface MessageSource

stopMessageSource

public void stopMessageSource()
This is called to tell the MessageSource that it should stop sending messages.

Specified by:
stopMessageSource in interface MessageSource

setEventType

public void setEventType(java.lang.String pEventType)

getEventType

public java.lang.String getEventType()
The type of the event, this should be set to such things as: atg.commerce.order.Order if that is what is being sent.


setPortName

public void setPortName(java.lang.String pPortName)

getPortName

public java.lang.String getPortName()
The port on which this message is sent.


setEnableSending

public void setEnableSending(boolean pEnableSending)

isEnableSending

public boolean isEnableSending()
If true the messages will be sent otherwise nothing is sent.