All Downloads are FREE. Search and download functionalities are using the official Maven repository.

forklift.consumer.ActiveMQMessageConsumer Maven / Gradle / Ivy

package forklift.consumer;

import forklift.consumer.ForkliftConsumerI;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.Session;

public class ActiveMQMessageConsumer implements ForkliftConsumerI {
	private MessageConsumer consumer;
	private Session s;

	public ActiveMQMessageConsumer(MessageConsumer consumer, Session s) {
		this.consumer = consumer;
		this.s = s;
	}

	public Message receive(long timeout) throws JMSException {
		return consumer.receive(timeout);
	}

	public void close() throws JMSException {
		if (consumer != null)
			consumer.close();

		if (s != null)
			s.close();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy