001/* 002 * The contents of this file are subject to the license and copyright 003 * detailed in the LICENSE and NOTICE files at the root of the source 004 * tree. 005 */ 006package org.fcrepo.jms; 007 008import javax.jms.Destination; 009import javax.jms.JMSException; 010 011/** 012 * Machinery to publish JMS messages when an EventBus 013 * message is received. 014 * 015 * @author barmintor 016 * @author awoods 017 */ 018public class JMSQueuePublisher extends AbstractJMSPublisher { 019 020 private final String queueName; 021 022 /** 023 * Create a JMS Topic with the default name of "fedora" 024 */ 025 public JMSQueuePublisher() { 026 this("fedora"); 027 } 028 029 /** 030 * Create a JMS Topic with a configurable name 031 * 032 * @param queueName the name of the queue 033 */ 034 public JMSQueuePublisher(final String queueName) { 035 this.queueName = queueName; 036 } 037 038 protected Destination createDestination() throws JMSException { 039 return jmsSession.createQueue(queueName); 040 } 041}