use of org.apache.cxf.workqueue.WorkQueueManager in project jbossws-cxf by jbossws.
the class BusHolder method setAdditionalWorkQueues.
/**
* Adds work queues parsing simple values of properties in jboss-webservices.xml:
* cxf.queue.<queue-name>.<parameter> = value
* e.g.
* cxf.queue.default.maxQueueSize = 500
*
* See constants in {@link org.jboss.wsf.stack.cxf.client.Constants}.
*
* @param bus
* @param wsmd
*/
protected static void setAdditionalWorkQueues(Bus bus, Map<String, String> props) {
if (props != null && !props.isEmpty()) {
Map<String, Map<String, String>> queuesMap = new HashMap<String, Map<String, String>>();
for (Entry<String, String> e : props.entrySet()) {
String k = e.getKey();
if (k.startsWith(Constants.CXF_QUEUE_PREFIX)) {
String sk = k.substring(Constants.CXF_QUEUE_PREFIX.length());
int i = sk.indexOf(".");
if (i > 0) {
String queueName = sk.substring(0, i);
String queueProp = sk.substring(i + 1);
Map<String, String> m = queuesMap.get(queueName);
if (m == null) {
m = new HashMap<String, String>();
queuesMap.put(queueName, m);
}
m.put(queueProp, e.getValue());
}
}
}
WorkQueueManager mgr = bus.getExtension(WorkQueueManager.class);
for (Entry<String, Map<String, String>> e : queuesMap.entrySet()) {
final String queueName = e.getKey();
AutomaticWorkQueue q = createWorkQueue(queueName, e.getValue());
mgr.addNamedWorkQueue(queueName, q);
}
}
}
Aggregations