Search in sources :

Example 1 with ContextClosedException

use of com.att.cdp.exceptions.ContextClosedException in project AJSC by att.

the class AbstractService method checkOpen.

/**
 * This method checks to see if the open flag has been cleared (indicating that the context has been closed). If the
 * context has been closed, then an exception is thrown indicating that the context has been closed and cannot be
 * used. If the open flag has not been cleared, indicating that the context is still usable, the method simply
 * returns to the caller.
 *
 * @throws ContextClosedException
 *             IFF the context has been closed.
 */
protected void checkOpen() throws ContextClosedException {
    if (!context.isOpen()) {
        Provider provider = context.getProvider();
        String msg = EELFResourceManager.format(Msg.PROVIDER_CONTEXT_IS_CLOSED, provider.getName());
        appLogger.error(msg);
        throw new ContextClosedException(msg);
    }
}
Also used : ContextClosedException(com.att.cdp.exceptions.ContextClosedException) Provider(com.att.cdp.zones.Provider)

Aggregations

ContextClosedException (com.att.cdp.exceptions.ContextClosedException)1 Provider (com.att.cdp.zones.Provider)1