Commit fe08842f authored by afreyssin's avatar afreyssin

Use specific factory to create collector queue and topic.

parent 78dbc47b
......@@ -147,6 +147,8 @@ public class JoramSaxWrapper extends DefaultHandler {
static final String ELT_AMQP_DISTRIBUTION_TOPIC = "AMQPDistributionTopic";
static final String ELT_SCHEDULER_QUEUE = "SchedulerQueue";
static final String ELT_COLLECTOR_QUEUE = "CollectorQueue";
static final String ELT_COLLECTOR_TOPIC = "CollectorTopic";
/** Syntaxic name for property element */
static final String ELT_PROPERTY = "property";
......@@ -584,6 +586,12 @@ public class JoramSaxWrapper extends DefaultHandler {
foreign = atts.getValue(ATT_FOREIGN);
} else if (rawName.equals(ELT_SCHEDULER_QUEUE)) {
getQueueAtts(atts);
} else if (rawName.equals(ELT_COLLECTOR_QUEUE)) {
getQueueAtts(atts);
url = atts.getValue(ATT_URL);
} else if (rawName.equals(ELT_COLLECTOR_TOPIC)) {
getTopicAtts(atts);
url = atts.getValue(ATT_URL);
} else if (rawName.equals(ELT_DMQUEUE)) {
name = atts.getValue(ATT_NAME);
properties = null;
......@@ -1214,6 +1222,52 @@ public class JoramSaxWrapper extends DefaultHandler {
if (nbMaxMsg > 0) queue.setNbMaxMsg(nbMaxMsg);
registerDestination(queue);
setDestinationDMQ(name, queue, dmq);
} else if (rawName.equals(ELT_COLLECTOR_QUEUE)) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
rawName + ".create(" + serverId + "," + name + "," + foreign + "," + properties + ")");
if (properties == null)
properties = new Properties();
if (!properties.containsKey("acquisition.className"))
properties.setProperty("acquisition.className", CollectorQueue.URLAcquisition);
if (!properties.containsKey("collector.url"))
properties.setProperty("collector.url", url);
Queue queue = (Queue) getWrapper().createQueue(serverId, name, Queue.ACQUISITION_QUEUE, properties);
properties = null;
url = null;
configureDestination(queue);
if (threshold > 0) queue.setThreshold(threshold);
if (nbMaxMsg > 0) queue.setNbMaxMsg(nbMaxMsg);
registerDestination(queue);
setDestinationDMQ(name, queue, dmq);
} else if (rawName.equals(ELT_COLLECTOR_TOPIC)) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
rawName + ".create(" + serverId + "," + name + "," + foreign + "," + properties + ")");
if (properties == null)
properties = new Properties();
if (!properties.containsKey("acquisition.className"))
properties.setProperty("acquisition.className", CollectorQueue.URLAcquisition);
if (!properties.containsKey("collector.url"))
properties.setProperty("collector.url", url);
Topic topic = (Topic) getWrapper().createTopic(serverId, name, Topic.ACQUISITION_TOPIC, properties);
properties = null;
url = null;
configureDestination(topic);
if (isSet(parent)) {
// TODO (AF): may be we should search the parent topic: JNDI? Joram?
if (topics.containsKey(parent)) {
topic.setParent((Topic) topics.get(parent));
} else {
logger.log(BasicLevel.ERROR, "Topic.create(): Unknown parent: " + parent);
}
}
registerDestination(topic);
setDestinationDMQ(name, topic, dmq);
} else if (rawName.equals(ELT_DMQUEUE)) {
className = "org.objectweb.joram.mom.dest.Queue";
if (logger.isLoggable(BasicLevel.DEBUG))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment