/** * Creates a new multi exception, a container for several exception messages.<p> */ public CmsMultiException() { this(Messages.get().container(Messages.ERR_MULTI_EXCEPTION_1, new Integer(0))); }
/** * Creates a new multi exception, a container for several exception messages.<p> */ public CmsMultiException() { this(Messages.get().container(Messages.ERR_MULTI_EXCEPTION_1, new Integer(0))); }
/** * Creates a resource init exception for a given resource init handler class.<p> * * @param cls the resource init handler class */ public CmsResourceInitException(Class<? extends I_CmsResourceInit> cls) { this(Messages.get().container(Messages.ERR_RESOURCE_INIT_ABORTED_1, cls.getName())); }
/** * Sets the default encoding, called after the configuration files have been read.<p> * * @param encoding the default encoding to set */ protected void setDefaultEncoding(String encoding) { m_defaultEncoding = encoding.intern(); if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.LOG_SET_DEFAULT_ENCODING_1, m_defaultEncoding)); } }
/** * Sets the default encoding, called after the configuration files have been read.<p> * * @param encoding the default encoding to set */ protected void setDefaultEncoding(String encoding) { m_defaultEncoding = encoding.intern(); if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.LOG_SET_DEFAULT_ENCODING_1, m_defaultEncoding)); } }
/** * Updates the intenal message for the Exception.<p> */ protected void updateMessage() { if (!hasIndividualMessage()) { m_message = Messages.get().container(Messages.ERR_MULTI_EXCEPTION_1, new Integer(m_exceptions.size())); } } }
/** * Updates the intenal message for the Exception.<p> */ protected void updateMessage() { if (!hasIndividualMessage()) { m_message = Messages.get().container(Messages.ERR_MULTI_EXCEPTION_1, new Integer(m_exceptions.size())); } } }
/** * Sets the server name.<p> * * The server name is set in <code>opencms.properties</code>. * It is not related to any DNS name the server might also have. * The server name is useful e.g. in a cluster to distinguish different servers, * or if you compare log files from multiple servers.<p> * * @param serverName the server name to set */ protected void setServerName(String serverName) { m_serverName = serverName; if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.LOG_SET_SERVERNAME_1, m_serverName)); } }
/** * Sets the server name.<p> * * The server name is set in <code>opencms.properties</code>. * It is not related to any DNS name the server might also have. * The server name is useful e.g. in a cluster to distinguish different servers, * or if you compare log files from multiple servers.<p> * * @param serverName the server name to set */ protected void setServerName(String serverName) { m_serverName = serverName; if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.LOG_SET_SERVERNAME_1, m_serverName)); } }
/** * Checks if this context info configuration is frozen.<p> * * @throws CmsRuntimeException in case the configuration is already frozen */ protected void checkFrozen() throws CmsRuntimeException { if (m_frozen) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_CONTEXT_INFO_FROZEN_0)); } } }
/** * Checks if this context info configuration is frozen.<p> * * @throws CmsRuntimeException in case the configuration is already frozen */ protected void checkFrozen() throws CmsRuntimeException { if (m_frozen) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_CONTEXT_INFO_FROZEN_0)); } } }
/** * Checks for invalid sessions.<p> */ protected void validateSessions() { try { CmsSessionManager sessionInfoManager = OpenCms.getSessionManager(); if (sessionInfoManager != null) { // will be null if only the shell is running sessionInfoManager.validateSessionInfos(); } } catch (Throwable t) { LOG.error(Messages.get().getBundle().key(Messages.LOG_THREADSTORE_CHECK_SESSIONS_ERROR_0), t); } }
/** * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) */ public void contextDestroyed(ServletContextEvent event) { try { // destroy the OpenCms instance OpenCmsCore.getInstance().shutDown(); } catch (CmsInitException e) { if (e.isNewError()) { LOG.error(e.getLocalizedMessage(), e); } } catch (Throwable t) { // make sure all other errors are displayed in the OpenCms log LOG.error(Messages.get().getBundle().key(Messages.LOG_ERROR_GENERIC_0), t); } }
/** * Sets the locale of the current user.<p> * * @param locale the locale to set * * @throws CmsException in case the locale of the current user can not be stored */ public void setLocale(Locale locale) throws CmsException { CmsUserSettings settings = getSettings(); if (settings != null) { settings.setLocale(locale); settings.save(m_cms); m_messages = Messages.get().getBundle(locale); } }
/** * @see javax.servlet.http.HttpSessionListener#sessionCreated(javax.servlet.http.HttpSessionEvent) */ public void sessionCreated(HttpSessionEvent event) { try { // inform the OpenCms session manager OpenCmsCore.getInstance().getSessionManager().sessionCreated(event); } catch (CmsInitException e) { if (e.isNewError()) { LOG.error(e.getLocalizedMessage(), e); } } catch (Throwable t) { // make sure all other errors are displayed in the OpenCms log LOG.error(Messages.get().getBundle().key(Messages.LOG_ERROR_GENERIC_0), t); } }
/** * Sets the locale of the current user.<p> * * @param locale the locale to set * * @throws CmsException in case the locale of the current user can not be stored */ public void setLocale(Locale locale) throws CmsException { CmsUserSettings settings = getSettings(); if (settings != null) { settings.setLocale(locale); settings.save(m_cms); m_messages = Messages.get().getBundle(locale); } }
/** * @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent) */ public void sessionDestroyed(HttpSessionEvent event) { try { // inform the OpenCms session manager OpenCmsCore.getInstance().getSessionManager().sessionDestroyed(event); } catch (CmsInitException e) { if (e.isNewError()) { LOG.error(e.getLocalizedMessage(), e); } } catch (Throwable t) { // make sure all other errors are displayed in the OpenCms log LOG.error(Messages.get().getBundle().key(Messages.LOG_ERROR_GENERIC_0), t); } }
/** * @see javax.servlet.http.HttpSessionListener#sessionCreated(javax.servlet.http.HttpSessionEvent) */ public void sessionCreated(HttpSessionEvent event) { try { // inform the OpenCms session manager OpenCmsCore.getInstance().getSessionManager().sessionCreated(event); } catch (CmsInitException e) { if (e.isNewError()) { LOG.error(e.getLocalizedMessage(), e); } } catch (Throwable t) { // make sure all other errors are displayed in the OpenCms log LOG.error(Messages.get().getBundle().key(Messages.LOG_ERROR_GENERIC_0), t); } }
/** * @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent) */ public void sessionDestroyed(HttpSessionEvent event) { try { // inform the OpenCms session manager OpenCmsCore.getInstance().getSessionManager().sessionDestroyed(event); } catch (CmsInitException e) { if (e.isNewError()) { LOG.error(e.getLocalizedMessage(), e); } } catch (Throwable t) { // make sure all other errors are displayed in the OpenCms log LOG.error(Messages.get().getBundle().key(Messages.LOG_ERROR_GENERIC_0), t); } } }
/** * Protected constructor that will initialize the singleton OpenCms instance * with runlevel {@link OpenCms#RUNLEVEL_1_CORE_OBJECT}.<p> * * @throws CmsInitException in case of errors during the initialization */ private OpenCmsCore() throws CmsInitException { synchronized (LOCK) { if ((m_instance != null) && (m_instance.getRunLevel() > OpenCms.RUNLEVEL_0_OFFLINE)) { throw new CmsInitException(Messages.get().container(Messages.ERR_ALREADY_INITIALIZED_0)); } initMembers(); m_instance = this; setRunLevel(OpenCms.RUNLEVEL_1_CORE_OBJECT); } }