public class SourceSinkTemplate extends GenericService implements MessageSource, MessageSink
CommerceMessage| 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 |
|---|
SourceSinkTemplate() |
| Modifier and Type | Method and Description |
|---|---|
int |
getDelayOnSendRetry()
The number of milliseconds to wait when trying to send a message
before the DMS system tells us it is ok.
|
MessageSourceContext |
getMessageSourceContext()
Return the message source context for this source.
|
java.lang.String |
getMessageSourceName()
This defines the string that the source property of messages will
be set to.
|
javax.transaction.TransactionManager |
getTransactionManager()
The beginning and ending of transactions are handled by the
transaction manager.
|
boolean |
isAllowMessageSending()
This class cannot send messages if this is false.
|
void |
receiveMessage(java.lang.String pPortName,
javax.jms.Message pMessage)
This is called to notify the component that a Message has arrived through the given
input port.
|
void |
sendCommerceMessage(CommerceMessage pCommerceMessage,
java.lang.String pPortName)
This is a convenience method which wraps the CommerceMessage to be sent into an ObjectMessage
and sends it along the port that is specified.
|
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 |
setAllowMessageSending(boolean pAllowMessageSending) |
void |
setDelayOnSendRetry(int pDelayOnSendRetry) |
void |
setMessageSourceContext(MessageSourceContext pMessageSourceContext)
Set the message source context for this source.
|
void |
setMessageSourceName(java.lang.String pMessageSourceName) |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager) |
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.
|
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, stopServicevlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic void setMessageSourceContext(MessageSourceContext pMessageSourceContext)
setMessageSourceContext in interface MessageSourceMessageSourcepublic MessageSourceContext getMessageSourceContext()
public void setMessageSourceName(java.lang.String pMessageSourceName)
public java.lang.String getMessageSourceName()
public void setAllowMessageSending(boolean pAllowMessageSending)
public boolean isAllowMessageSending()
public void setDelayOnSendRetry(int pDelayOnSendRetry)
public int getDelayOnSendRetry()
public void startMessageSource()
startMessageSource in interface MessageSourcepublic void stopMessageSource()
stopMessageSource in interface MessageSourcepublic void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public void receiveMessage(java.lang.String pPortName,
javax.jms.Message pMessage)
throws javax.jms.JMSException
This is called to notify the component that a Message has arrived through the given input port. The MessageSink should be prepared to handle concurrent calls of this method from multiple Threads. This is left as an empty method in this class and should be overriden by the implementor.
receiveMessage can be extended to handle extra types of messages by overriding the handleNewMessageType method.
receiveMessage in interface MessageSinkjavax.jms.JMSExceptionpublic void sendCommerceMessage(CommerceMessage pCommerceMessage, java.lang.String pPortName) throws javax.jms.JMSException
pCommerceMessage - The message to be sent.pPortName - The port to send the message to.javax.jms.JMSExceptionpublic void sendObjectMessage(java.io.Serializable pObjectMessage,
java.lang.String pType,
java.lang.String pPortName)
throws javax.jms.JMSException
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.javax.jms.JMSException - is thrown when a failure to send the message occurs. This is
generally a configuration issue.