public class JMSTopicPublisher extends Object
Modifier and Type | Field and Description |
---|---|
protected javax.jms.Connection |
connection |
protected org.apache.activemq.ActiveMQConnectionFactory |
connectionFactory |
protected com.google.common.eventbus.EventBus |
eventBus |
protected JMSEventMessageFactory |
eventFactory |
protected javax.jms.Session |
jmsSession |
protected static org.slf4j.Logger |
LOGGER |
protected javax.jms.MessageProducer |
producer |
Constructor and Description |
---|
JMSTopicPublisher()
Create a JMS Topic with the default name of "fedora"
|
JMSTopicPublisher(String topicName)
Create a JMS Topic with a configurable name
|
Modifier and Type | Method and Description |
---|---|
void |
acquireConnections()
Connect to JCR Repostory and JMS queue
|
protected javax.jms.Destination |
createDestination() |
void |
publishJCREvent(FedoraEvent fedoraEvent)
When an EventBus mesage is received, map it to our JMS
message payload and push it onto the queue.
|
void |
releaseConnections()
Close external connections
|
@Inject protected com.google.common.eventbus.EventBus eventBus
@Inject protected org.apache.activemq.ActiveMQConnectionFactory connectionFactory
@Inject protected JMSEventMessageFactory eventFactory
protected javax.jms.Connection connection
protected javax.jms.Session jmsSession
protected javax.jms.MessageProducer producer
protected static final org.slf4j.Logger LOGGER
public JMSTopicPublisher()
public JMSTopicPublisher(String topicName)
topicName
- the name of the topicprotected javax.jms.Destination createDestination() throws javax.jms.JMSException
javax.jms.JMSException
public void publishJCREvent(FedoraEvent fedoraEvent) throws javax.jms.JMSException, IOException
fedoraEvent
- the fedora eventjavax.jms.JMSException
- if JMS exception occurredIOException
- if IO exception occurred@PostConstruct public void acquireConnections() throws javax.jms.JMSException
javax.jms.JMSException
- if JMS Exception occurred@PreDestroy public void releaseConnections() throws javax.jms.JMSException
javax.jms.JMSException
- if JMS exception occurredCopyright © 2013–2017 DuraSpace, Inc.. All rights reserved.