atg.commerce.messaging
Class MessageSender

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.messaging.SourceSinkTemplate
              extended by atg.commerce.messaging.MessageSender
All Implemented Interfaces:
MessageSink, MessageSource, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
ScheduledOrderTools

public class MessageSender
extends SourceSinkTemplate

This class is a generci MessageSender. It can be configured to send over a specific port through patchbay. It is a convenient way to send messages from request scoped comnponents. Just create a nucleus instance of this component, configure it in patchbay (/atg/dynamo/messaging/dynamoMessageSystem.xml) and reference it from the request scoped component. Use sendCommerceMessage to send the message.

See Also:
MessageSource

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String DEFAULT_MESSAGE_SOURCE_NAME
           
 
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
MessageSender()
           
 
Method Summary
 IdGenerator getMessageIdGenerator()
          The service that generates Ids for all messages.
 java.lang.String getMessageIdSpaceName()
          The name of the idspace to get our message ids from
 MessageSourceContext getMessageSourceContext()
          Return the message source context for this source.
 java.lang.String getMessageSourceName()
          The string used as the source of messages.
 java.lang.String getNextMessageId()
          Uses the id generator to get the next message id.
 java.lang.String getPortName()
          The name of the PortName to send messages out of.
 boolean isAllowMessageSending()
          This class cannot send messages if this is false.
 void sendCommerceMessage(CommerceMessage pMessage)
          Uses the SourceSinkTemplate to send a commerce message over portName
 void setAllowMessageSending(boolean pAllowMessageSending)
           
 void setMessageIdGenerator(IdGenerator pMessageIdGenerator)
           
 void setMessageIdSpaceName(java.lang.String pMessageIdSpaceName)
           
 void setMessageSourceContext(MessageSourceContext pMessageSourceContext)
          Set the message source context for this source.
 void setMessageSourceName(java.lang.String pMessageSourceName)
           
 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.commerce.messaging.SourceSinkTemplate
getDelayOnSendRetry, getTransactionManager, receiveMessage, sendCommerceMessage, sendObjectMessage, setDelayOnSendRetry, setTransactionManager
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
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
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


DEFAULT_MESSAGE_SOURCE_NAME

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

MessageSender

public MessageSender()
Method Detail

setPortName

public void setPortName(java.lang.String pPortName)

getPortName

public java.lang.String getPortName()
The name of the PortName to send messages out of.


setMessageSourceName

public void setMessageSourceName(java.lang.String pMessageSourceName)
Overrides:
setMessageSourceName in class SourceSinkTemplate

getMessageSourceName

public java.lang.String getMessageSourceName()
The string used as the source of messages.

Overrides:
getMessageSourceName in class SourceSinkTemplate

setMessageSourceContext

public void setMessageSourceContext(MessageSourceContext pMessageSourceContext)
Description copied from class: SourceSinkTemplate
Set the message source context for this source.

Specified by:
setMessageSourceContext in interface MessageSource
Overrides:
setMessageSourceContext in class SourceSinkTemplate
See Also:
MessageSource

getMessageSourceContext

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

Overrides:
getMessageSourceContext in class SourceSinkTemplate

setMessageIdGenerator

public void setMessageIdGenerator(IdGenerator pMessageIdGenerator)

getMessageIdGenerator

public IdGenerator getMessageIdGenerator()
The service that generates Ids for all messages.


setMessageIdSpaceName

public void setMessageIdSpaceName(java.lang.String pMessageIdSpaceName)

getMessageIdSpaceName

public java.lang.String getMessageIdSpaceName()
The name of the idspace to get our message ids from


setAllowMessageSending

public void setAllowMessageSending(boolean pAllowMessageSending)
Overrides:
setAllowMessageSending in class SourceSinkTemplate

isAllowMessageSending

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

Overrides:
isAllowMessageSending in class SourceSinkTemplate

startMessageSource

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

Specified by:
startMessageSource in interface MessageSource
Overrides:
startMessageSource in class SourceSinkTemplate

stopMessageSource

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

Specified by:
stopMessageSource in interface MessageSource
Overrides:
stopMessageSource in class SourceSinkTemplate

sendCommerceMessage

public void sendCommerceMessage(CommerceMessage pMessage)
                         throws javax.jms.JMSException
Uses the SourceSinkTemplate to send a commerce message over portName

Parameters:
pMessage - The message to be sent
Throws:
javax.jms.JMSException

getNextMessageId

public java.lang.String getNextMessageId()
Uses the id generator to get the next message id.