Package gda.util

Class MultiTypedJsonMessageListener

java.lang.Object
gda.util.MultiTypedJsonMessageListener
Direct Known Subclasses:
MultiTypedJsonAMQPMessageListener

public class MultiTypedJsonMessageListener extends Object
This class is similar to JsonMessageListener but maintains a list of types to attempt to deserialize to.
  • Constructor Details

    • MultiTypedJsonMessageListener

      public MultiTypedJsonMessageListener()
  • Method Details

    • configure

      public void configure() throws javax.jms.JMSException
      Create 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.JMSException
      Close the connection and stop processing messages
      Throws:
      javax.jms.JMSException
    • getTopic

      public String getTopic()
      Get the currently configure activeMQ topic
    • setTopic

      public void setTopic(String topic) throws javax.jms.JMSException
      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

      protected javax.jms.Destination getTopic(String topicName) throws IOException, TimeoutException
      Throws:
      IOException
      TimeoutException
    • setHandler

      public <T> void setHandler(Class<T> cls, Consumer<T> handler)