Package gda.util
Class MultiTypedJsonMessageListener
java.lang.Object
gda.util.MultiTypedJsonMessageListener
- Direct Known Subclasses:
MultiTypedJsonAMQPMessageListener
This class is similar to
JsonMessageListener but maintains a list of types
to attempt to deserialize to.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCreate a consumer to listen for activeMQ messages.getTopic()Get the currently configure activeMQ topicprotected javax.jms.Destination<T> voidsetHandler(Class<T> cls, Consumer<T> handler) voidSet the topic this listener listens to.voidshutdown()Close the connection and stop processing messages
-
Constructor Details
-
MultiTypedJsonMessageListener
public MultiTypedJsonMessageListener()
-
-
Method Details
-
configure
public void configure() throws javax.jms.JMSExceptionCreate a consumer to listen for activeMQ messages. If a consumer already exists, close existing connection- Throws:
javax.jms.JMSException
-
shutdown
public void shutdown() throws javax.jms.JMSExceptionClose the connection and stop processing messages- Throws:
javax.jms.JMSException
-
getTopic
Get the currently configure activeMQ topic -
setTopic
Set the topic this listener listens to. If this listener is already configured, shutdown existing consumer and reconfigure with new topic.- Throws:
javax.jms.JMSException- if either shutdown or configuration fail
-
getTopic
- Throws:
IOExceptionTimeoutException
-
setHandler
-