Package org.opencms.main
Class CmsResourceInitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.opencms.main.CmsException
org.opencms.main.CmsResourceInitException
- All Implemented Interfaces:
Serializable
,I_CmsThrowable
This exeption is thrown by a class which implements org.opencms.main.I_CmsResourceInit.
When this exeption is thrown,
all other implementations of I_CmsResourceInit will not be executed.
- Since:
- 6.0.0
- See Also:
-
Field Summary
Fields inherited from class org.opencms.main.CmsException
m_message
-
Constructor Summary
ConstructorDescriptionCmsResourceInitException
(Class<? extends I_CmsResourceInit> cls) Creates a resource init exception for a given resource init handler class.CmsResourceInitException
(CmsMessageContainer container) Creates a new localized Exception.CmsResourceInitException
(CmsMessageContainer container, Throwable cause) Creates a new localized Exception that also containes a root cause. -
Method Summary
Modifier and TypeMethodDescriptioncreateException
(CmsMessageContainer container, Throwable cause) Creates a copied instance of this localized exception.boolean
If this method returns true, theOpenCmsCore.initResource(org.opencms.file.CmsObject, String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method should just return null instead of throwing an exception.void
setClearErrors
(boolean clearErrors) Sets the 'clear errors' flag, which causes the resource init method catching this exception to return null of throwing an exception.Methods inherited from class org.opencms.main.CmsException
getFormattedErrorstack, getLocalizedMessage, getLocalizedMessage, getMessage, getMessageContainer, getStackTraceAsString
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CmsResourceInitException
Creates a resource init exception for a given resource init handler class.- Parameters:
cls
- the resource init handler class
-
CmsResourceInitException
Creates a new localized Exception.- Parameters:
container
- the localized message container to use
-
CmsResourceInitException
Creates a new localized Exception that also containes a root cause.- Parameters:
container
- the localized message container to usecause
- the Exception root cause
-
-
Method Details
-
createException
Description copied from class:CmsException
Creates a copied instance of this localized exception.- Overrides:
createException
in classCmsException
- Parameters:
container
- the message containercause
- the root cause- Returns:
- a copied instance of this localized exception
- See Also:
-
isClearErrors
If this method returns true, theOpenCmsCore.initResource(org.opencms.file.CmsObject, String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method should just return null instead of throwing an exception.- Returns:
- the 'clear errors' flag
-
setClearErrors
Sets the 'clear errors' flag, which causes the resource init method catching this exception to return null of throwing an exception. This can be useful if you want to redirect inside a resource init handler.- Parameters:
clearErrors
- the new value of the 'clear errors' flag
-