Search in sources :

Example 1 with NotFoundException

use of org.jpos.util.NameRegistrar.NotFoundException in project jPOS by jpos.

the class QThreadPoolExecutor method getThreadPoolExecutor.

/**
 * Retrieves a thread pool executor from NameRegistrar given its name
 *
 * @param name
 * @throws NotFoundException
 */
public static ThreadPoolExecutor getThreadPoolExecutor(java.lang.String name) throws NotFoundException {
    ThreadPoolExecutor res = null;
    Object object = NameRegistrar.get(THREAD_POOL_EXECUTOR__QBEAN_PREFIX + name);
    if (object instanceof ThreadPoolExecutor) {
        res = (ThreadPoolExecutor) object;
    } else {
        throw new NotFoundException(name);
    }
    return res;
}
Also used : NotFoundException(org.jpos.util.NameRegistrar.NotFoundException) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor)

Example 2 with NotFoundException

use of org.jpos.util.NameRegistrar.NotFoundException in project jPOS by jpos.

the class ISORequestListenerAdaptor method setConfiguration.

public void setConfiguration(Configuration cfg) throws ConfigurationException {
    this.cfg = cfg;
    try {
        mux = (SpaceMUX) NameRegistrar.get(cfg.get("mux"));
    } catch (NotFoundException e) {
        throw new ConfigurationException(e);
    }
    timeout = cfg.getLong("timeout", 120000);
    pool = new ThreadPool(1, cfg.getInt("pool", 100));
}
Also used : ConfigurationException(org.jpos.core.ConfigurationException) NotFoundException(org.jpos.util.NameRegistrar.NotFoundException)

Aggregations

NotFoundException (org.jpos.util.NameRegistrar.NotFoundException)2 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1 ConfigurationException (org.jpos.core.ConfigurationException)1