Class DummyMessageHandler
- java.lang.Object
-
- org.certificateservices.messages.csmessages.manager.DummyMessageHandler
-
- All Implemented Interfaces:
MessageHandler
public class DummyMessageHandler extends java.lang.Object implements MessageHandler
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]base64CertbooleanrevokeMessageRecievedstatic java.lang.StringSETTING_WAITTIME
-
Constructor Summary
Constructors Constructor Description DummyMessageHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(MessageListener listener)Method to add a listener to this Message Handler, this method should be called before a connection.voidaddSender(MessageSender sender)Method to add a sender to this Message Handler, this method should be called before a connection.voidclose()Method called by service if the MessageHandler should disconnect from the MessageQueue server.voidconnect()Method called by service if the MessageHandler should connect to the MessageQueue server and start processing incoming calls.java.lang.ObjectgetConnectionFactory()Method returning the connection factory used to set-up the message queues.MessageListenergetMessageListener(java.lang.String name)Method to retrieved a message listener given it's name.MessageSendergetMessageSender(java.lang.String name)Method to retrieved a message sender given it's name.voidinit(java.util.Properties config)Method called after instantiation and should check configuration and prepare everything for connection with the message queue server.booleanisConnected()Method returning if the handler is currently connected to the JMS broker.voidsendMessage(java.lang.String componentName, java.lang.String messageId, byte[] messageData, java.util.Map<java.lang.String,java.lang.String> messageAttributes)Method to send a message to the MQ server out queue.
-
-
-
Field Detail
-
revokeMessageRecieved
public boolean revokeMessageRecieved
-
SETTING_WAITTIME
public static final java.lang.String SETTING_WAITTIME
- See Also:
- Constant Field Values
-
base64Cert
public static byte[] base64Cert
-
-
Method Detail
-
init
public void init(java.util.Properties config) throws MessageProcessingExceptionDescription copied from interface:MessageHandlerMethod called after instantiation and should check configuration and prepare everything for connection with the message queue server.- Specified by:
initin interfaceMessageHandler- Parameters:
config- the configuration.- Throws:
MessageProcessingException- if configuration problems or other internal problems occurred.
-
connect
public void connect() throws MessageProcessingException, java.io.IOExceptionDescription copied from interface:MessageHandlerMethod called by service if the MessageHandler should connect to the MessageQueue server and start processing incoming calls.- Specified by:
connectin interfaceMessageHandler- Throws:
MessageProcessingException- if configuration problems or other internal problems occurred connecting to the MQ server.java.io.IOException- if communication problems occurred connecting from the message server.
-
sendMessage
public void sendMessage(java.lang.String componentName, java.lang.String messageId, byte[] messageData, java.util.Map<java.lang.String,java.lang.String> messageAttributes) throws MessageProcessingException, java.io.IOExceptionDescription copied from interface:MessageHandlerMethod to send a message to the MQ server out queue.- Specified by:
sendMessagein interfaceMessageHandler- Parameters:
componentName- the componentName to use for sending.messageId- the id of the messagemessageData- the message data to sendmessageAttributes- meta data related to the message such as reply-to queues or correlation id etc if underlying implementation supports it. use null if no related message attributes exists.- Throws:
MessageProcessingException- if configuration problems or other internal problems occurred connecting to the MQ server.java.io.IOException- if communication problems occurred connecting and sending to the message server.
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:MessageHandlerMethod called by service if the MessageHandler should disconnect from the MessageQueue server.- Specified by:
closein interfaceMessageHandler- Throws:
java.io.IOException- if communication problems occurred disconnecting from the message server.
-
getConnectionFactory
public java.lang.Object getConnectionFactory() throws MessageProcessingException, java.io.IOExceptionDescription copied from interface:MessageHandlerMethod returning the connection factory used to set-up the message queues. Used only for special purposes when not extending the implementing class. Required method for extending classes to provide the connection factory to use when connecting to the message server.- Specified by:
getConnectionFactoryin interfaceMessageHandler- Returns:
- a connection factory to use to set up the message processing environment, never null.
- Throws:
MessageProcessingException- if internal error or configuration problems occurred.java.io.IOException- if communication problems occurred with the message service.
-
isConnected
public boolean isConnected()
Description copied from interface:MessageHandlerMethod returning if the handler is currently connected to the JMS broker.- Specified by:
isConnectedin interfaceMessageHandler- Returns:
- true if connected.
-
addSender
public void addSender(MessageSender sender)
Description copied from interface:MessageHandlerMethod to add a sender to this Message Handler, this method should be called before a connection.- Specified by:
addSenderin interfaceMessageHandler- Parameters:
sender- a MessageSender implementation.
-
addListener
public void addListener(MessageListener listener)
Description copied from interface:MessageHandlerMethod to add a listener to this Message Handler, this method should be called before a connection.- Specified by:
addListenerin interfaceMessageHandler- Parameters:
listener- a MessageListener implementation.
-
getMessageSender
public MessageSender getMessageSender(java.lang.String name) throws MessageProcessingException
Description copied from interface:MessageHandlerMethod to retrieved a message sender given it's name.- Specified by:
getMessageSenderin interfaceMessageHandler- Parameters:
name- the unique name of the sender.- Throws:
MessageProcessingException- if given name didn't exist or didn't correspond to a MessageSender.
-
getMessageListener
public MessageListener getMessageListener(java.lang.String name) throws MessageProcessingException
Description copied from interface:MessageHandlerMethod to retrieved a message listener given it's name.- Specified by:
getMessageListenerin interfaceMessageHandler- Parameters:
name- the unique name of the listener.- Throws:
MessageProcessingException- if given name didn't exist or didn't correspond to a MessageListener.
-
-