atg.commerce.messaging
Class MessageForwardFilter

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.MessageForwardFilter
All Implemented Interfaces:
MessageSink, 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, java.util.EventListener

public class MessageForwardFilter
extends SourceSinkTemplate

The MessageForwardFilter can be used to take messages from one message source and forward it to one or more message sinks. It is a convenient way of taking messages that were sent through localdms and forwarding them to message sinks that are listening on sqldms. It can also be used for taking messages sent to one topic and forwarding them to another topic.

See Also:
MessageSource, MessageSink

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
MessageForwardFilter()
           
 
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.util.Properties getMessageTypes()
          A mapping of message types to port names.
 java.util.HashMap getMessageTypesToPorts()
           
 java.lang.String getNextMessageId()
          Uses the id generator to get the next message id.
protected  CommerceMessage getUpdatedCommerceMessage(javax.jms.ObjectMessage pObjectMessage)
           
 boolean isAllowMessageSending()
          This class cannot send messages if this is false.
 void receiveMessage(java.lang.String pPortName, javax.jms.Message pMessage)
          Takes a message, and if it is configured to forward it, sends it on to other message sinks.
 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 setMessageTypes(java.util.Properties pMessageTypes)
           
 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, sendCommerceMessage, sendObjectMessage, setDelayOnSendRetry, setTransactionManager
 
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


DEFAULT_MESSAGE_SOURCE_NAME

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

MessageForwardFilter

public MessageForwardFilter()
Method Detail

setMessageTypes

public void setMessageTypes(java.util.Properties pMessageTypes)

getMessageTypes

public java.util.Properties getMessageTypes()
A mapping of message types to port names.


getMessageTypesToPorts

public java.util.HashMap getMessageTypesToPorts()

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

receiveMessage

public void receiveMessage(java.lang.String pPortName,
                           javax.jms.Message pMessage)
                    throws javax.jms.JMSException
Takes a message, and if it is configured to forward it, sends it on to other message sinks.

Specified by:
receiveMessage in interface MessageSink
Overrides:
receiveMessage in class SourceSinkTemplate
Throws:
javax.jms.JMSException

getUpdatedCommerceMessage

protected CommerceMessage getUpdatedCommerceMessage(javax.jms.ObjectMessage pObjectMessage)
                                             throws CommerceException,
                                                    javax.jms.JMSException
Throws:
CommerceException
javax.jms.JMSException

getNextMessageId

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