Package org.trellisldp.jms
Class JmsEventService
- java.lang.Object
-
- org.trellisldp.jms.JmsEventService
-
- All Implemented Interfaces:
EventService
public class JmsEventService extends Object implements EventService
A JMS message producer capable of publishing messages to a JMS broker such as ActiveMQ.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONFIG_JMS_PASSWORDThe configuration key controlling the JMS password.static StringCONFIG_JMS_QUEUE_NAMEThe configuration key controlling the JMS queue name.static StringCONFIG_JMS_URLThe configuration key controlling the JMS broker URL.static StringCONFIG_JMS_USE_QUEUEThe configuration key controlling whether to use a topic or queue.static StringCONFIG_JMS_USERNAMEThe configuration key controlling the JMS username.
-
Constructor Summary
Constructors Constructor Description JmsEventService()Create a new JMS Publisher.JmsEventService(EventSerializationService serializer, Connection conn)Create a new JMS Publisher.JmsEventService(EventSerializationService serializer, Session session, String queueName)Create a new JMS Publisher.JmsEventService(EventSerializationService serializer, Session session, String queueName, boolean useQueue)Create a new JMS Publisher.
-
-
-
Field Detail
-
CONFIG_JMS_QUEUE_NAME
public static final String CONFIG_JMS_QUEUE_NAME
The configuration key controlling the JMS queue name.- See Also:
- Constant Field Values
-
CONFIG_JMS_URL
public static final String CONFIG_JMS_URL
The configuration key controlling the JMS broker URL.- See Also:
- Constant Field Values
-
CONFIG_JMS_USERNAME
public static final String CONFIG_JMS_USERNAME
The configuration key controlling the JMS username.- See Also:
- Constant Field Values
-
CONFIG_JMS_PASSWORD
public static final String CONFIG_JMS_PASSWORD
The configuration key controlling the JMS password.- See Also:
- Constant Field Values
-
CONFIG_JMS_USE_QUEUE
public static final String CONFIG_JMS_USE_QUEUE
The configuration key controlling whether to use a topic or queue.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JmsEventService
public JmsEventService()
Create a new JMS Publisher.- API Note:
- This construtor is used by CDI runtimes that require a public, no-argument constructor. It should not be invoked directly in user code.
-
JmsEventService
@Inject public JmsEventService(EventSerializationService serializer, Connection conn) throws JMSException
Create a new JMS Publisher.- Parameters:
serializer- the event serializerconn- the connection- Throws:
JMSException- when there is a connection error
-
JmsEventService
public JmsEventService(EventSerializationService serializer, Session session, String queueName) throws JMSException
Create a new JMS Publisher.- Parameters:
serializer- the event serializersession- the JMS sessionqueueName- the name of the queue- Throws:
JMSException- when there is a connection error
-
JmsEventService
public JmsEventService(EventSerializationService serializer, Session session, String queueName, boolean useQueue) throws JMSException
Create a new JMS Publisher.- Parameters:
serializer- the event serializersession- the JMS sessionqueueName- the name of the queueuseQueue- whether to use a queue or a topic- Throws:
JMSException- when there is a connection error
-
-
Method Detail
-
emit
public void emit(Event event)
Description copied from interface:EventServiceEmit an event to the event service.- Specified by:
emitin interfaceEventService- Parameters:
event- the event
-
-