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:
java.io.Serializable
,I_CmsThrowable
public class CmsResourceInitException extends CmsException
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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.opencms.main.CmsException
m_message
-
-
Constructor Summary
Constructors Constructor Description CmsResourceInitException(java.lang.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, java.lang.Throwable cause)
Creates a new localized Exception that also containes a root cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsException
createException(CmsMessageContainer container, java.lang.Throwable cause)
Creates a copied instance of this localized exception.boolean
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.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
-
-
-
-
Constructor Detail
-
CmsResourceInitException
public CmsResourceInitException(java.lang.Class<? extends I_CmsResourceInit> cls)
Creates a resource init exception for a given resource init handler class.- Parameters:
cls
- the resource init handler class
-
CmsResourceInitException
public CmsResourceInitException(CmsMessageContainer container)
Creates a new localized Exception.- Parameters:
container
- the localized message container to use
-
CmsResourceInitException
public CmsResourceInitException(CmsMessageContainer container, java.lang.Throwable cause)
Creates a new localized Exception that also containes a root cause.- Parameters:
container
- the localized message container to usecause
- the Exception root cause
-
-
Method Detail
-
createException
public CmsException createException(CmsMessageContainer container, java.lang.Throwable cause)
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:
CmsException.createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable)
-
isClearErrors
public boolean 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
public 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. This can be useful if you want to redirect inside a resource init handler.- Parameters:
clearErrors
- the new value of the 'clear errors' flag
-
-