use of org.apache.axis2.transport.xmpp.util.XMPPPacketListener in project wso2-axis2-transports by wso2.
the class XMPPListener method start.
/**
* Start a pool of Workers. For each connection in connectionFactories,
* assign a packer listener. This packet listener will trigger when a
* message arrives.
*/
public void start() throws AxisFault {
// create thread pool of workers
ExecutorService workerPool = new ThreadPoolExecutor(1, WORKERS_MAX_THREADS, WORKER_KEEP_ALIVE, TIME_UNIT, new LinkedBlockingQueue(), new org.apache.axis2.util.threadpool.DefaultThreadFactory(new ThreadGroup("XMPP Worker thread group"), "XMPPWorker"));
Iterator iter = connectionFactories.values().iterator();
while (iter.hasNext()) {
XMPPConnectionFactory connectionFactory = (XMPPConnectionFactory) iter.next();
XMPPPacketListener xmppPacketListener = new XMPPPacketListener(connectionFactory, this.configurationContext, workerPool);
connectionFactory.listen(xmppPacketListener);
}
}
Aggregations