/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsDbException(container, cause); } }
/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsDbException(container, cause); } }
/** * The constructor.<p> * * @throws CmsDbException if the manager is not initialized yet */ public CmsSqlManager() throws CmsDbException { if (!m_isInitialized) { throw new CmsDbException(Messages.get().container(Messages.ERR_SQLMANAGER_NOT_INITIALIZED_0)); } m_cachedQueries = new Hashtable<String, String>(); m_queries = new Hashtable<String, String>(); m_queriesWithParameters = new Hashtable<String, String>(); loadQueryProperties(QUERY_PROPERTIES); }
/** * Returns the number of idle connections managed by a pool.<p> * * @param dbPoolUrl the url of a pool * @return the number of idle connections * @throws CmsDbException if something goes wrong */ public int getIdleConnections(String dbPoolUrl) throws CmsDbException { try { for (Iterator i = m_connectionPools.iterator(); i.hasNext();) { PoolingDriver d = (PoolingDriver)i.next(); ObjectPool p = d.getConnectionPool(dbPoolUrl); return p.getNumIdle(); } } catch (Exception exc) { CmsMessageContainer message = Messages.get().container(Messages.ERR_ACCESSING_POOL_1, dbPoolUrl); throw new CmsDbException(message, exc); } CmsMessageContainer message = Messages.get().container(Messages.ERR_UNKNOWN_POOL_URL_1, dbPoolUrl); throw new CmsDbException(message); }
/** * Returns the number of active connections managed by a pool.<p> * * @param dbPoolUrl the url of a pool * @return the number of active connections * @throws CmsDbException if something goes wrong */ public int getActiveConnections(String dbPoolUrl) throws CmsDbException { try { for (Iterator i = m_connectionPools.iterator(); i.hasNext();) { PoolingDriver d = (PoolingDriver)i.next(); ObjectPool p = d.getConnectionPool(dbPoolUrl); return p.getNumActive(); } } catch (Exception exc) { CmsMessageContainer message = Messages.get().container(Messages.ERR_ACCESSING_POOL_1, dbPoolUrl); throw new CmsDbException(message, exc); } CmsMessageContainer message = Messages.get().container(Messages.ERR_UNKNOWN_POOL_URL_1, dbPoolUrl); throw new CmsDbException(message); }
/** * Returns the number of idle connections managed by a pool.<p> * * @param dbPoolUrl the url of a pool * @return the number of idle connections * @throws CmsDbException if something goes wrong */ public int getIdleConnections(String dbPoolUrl) throws CmsDbException { try { for (PoolingDriver d : m_connectionPools) { ObjectPool p = d.getConnectionPool(dbPoolUrl); return p.getNumIdle(); } } catch (Exception exc) { CmsMessageContainer message = Messages.get().container(Messages.ERR_ACCESSING_POOL_1, dbPoolUrl); throw new CmsDbException(message, exc); } CmsMessageContainer message = Messages.get().container(Messages.ERR_UNKNOWN_POOL_URL_1, dbPoolUrl); throw new CmsDbException(message); }
/** * Returns the number of active connections managed by a pool.<p> * * @param dbPoolUrl the url of a pool * @return the number of active connections * @throws CmsDbException if something goes wrong */ public int getActiveConnections(String dbPoolUrl) throws CmsDbException { try { for (PoolingDriver d : m_connectionPools) { ObjectPool p = d.getConnectionPool(dbPoolUrl); return p.getNumActive(); } } catch (Exception exc) { CmsMessageContainer message = Messages.get().container(Messages.ERR_ACCESSING_POOL_1, dbPoolUrl); throw new CmsDbException(message, exc); } CmsMessageContainer message = Messages.get().container(Messages.ERR_UNKNOWN_POOL_URL_1, dbPoolUrl); throw new CmsDbException(message); }
LOG.fatal(message.key(), exc); throw new CmsDbException(message, exc);
LOG.fatal(message.key(), exc); throw new CmsDbException(message, exc);