
Package ca.uhn.fhir.broker.jms
Class SpringMessagingReceiverAdapter<T>
java.lang.Object
ca.uhn.fhir.broker.jms.SpringMessagingReceiverAdapter<T>
- Type Parameters:
T- the type of payload this message consumer is expecting to receive
- All Implemented Interfaces:
IChannelConsumer<T>,AutoCloseable
Adapt a Spring Messaging (JMS) Queue to
IChannelConsumer-
Constructor Summary
ConstructorsConstructorDescriptionSpringMessagingReceiverAdapter(Class<? extends ca.uhn.fhir.rest.server.messaging.IMessage<T>> theMessageType, ISpringMessagingChannelReceiver theSpringMessagingChannelReceiver, IMessageListener<T> theMessageListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this consumer's listener and this consumer, releasing any resources.booleanisClosed()voidpause()Pause requesting new messages from the broker until resume() is called.voidresume()Resume requesting messages from the broker.voidstart()Start the thread(s) that will be consuming messagesvoidsubscribe(org.springframework.messaging.MessageHandler theMessageHandler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.fhir.broker.api.IChannelConsumer
checkState
-
Constructor Details
-
SpringMessagingReceiverAdapter
public SpringMessagingReceiverAdapter(Class<? extends ca.uhn.fhir.rest.server.messaging.IMessage<T>> theMessageType, ISpringMessagingChannelReceiver theSpringMessagingChannelReceiver, IMessageListener<T> theMessageListener)
-
-
Method Details
-
subscribe
-
close
Description copied from interface:IChannelConsumerClose this consumer's listener and this consumer, releasing any resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIChannelConsumer<T>
-
isClosed
- Specified by:
isClosedin interfaceIChannelConsumer<T>- Returns:
- true if this consumer is closed
-
getChannelName
- Specified by:
getChannelNamein interfaceIChannelConsumer<T>- Returns:
- the name of the topic or queue that this consumer is consuming from
-
start
Description copied from interface:IChannelConsumerStart the thread(s) that will be consuming messages- Specified by:
startin interfaceIChannelConsumer<T>- Throws:
ChannelConsumerStartFailureException- if the consumer fails to start (e.g. if it fails to connect to the broker)
-
getSpringMessagingChannelReceiver
-
getMessageType
- Specified by:
getMessageTypein interfaceIChannelConsumer<T>- Returns:
- the type of messages that will be delivered to this consumer
-
getMessageListener
- Specified by:
getMessageListenerin interfaceIChannelConsumer<T>- Returns:
- the
IMessageListenerthis consumer is sending messages to (i.e. the one it was created with).
-
pause
Description copied from interface:IChannelConsumerPause requesting new messages from the broker until resume() is called.- Specified by:
pausein interfaceIChannelConsumer<T>
-
resume
Description copied from interface:IChannelConsumerResume requesting messages from the broker.- Specified by:
resumein interfaceIChannelConsumer<T>
-