@Component(value="cuba_HotDeployClassCastExceptionHandler") public class HotDeployClassCastExceptionHandler extends AbstractUiExceptionHandler
ClassCastException
for the same classes that occurs during the hot deployment.UiExceptionHandler.UiContext
Modifier and Type | Field and Description |
---|---|
protected static java.util.regex.Pattern |
HOT_DEPLOY_CLASS_CAST_REGEXP
Regexp to find the same class names in the
ClassCastException exception message. |
protected Messages |
messages |
classNames
HIGHEST_PLATFORM_PRECEDENCE, LOWEST_PLATFORM_PRECEDENCE
Constructor and Description |
---|
HotDeployClassCastExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canHandle(java.lang.String className,
java.lang.String message,
java.lang.Throwable throwable)
Should be implemented in subclasses if the exception class name is not enough to determine the ability to
handle the exception.
|
protected void |
doHandle(java.lang.String className,
java.lang.String message,
java.lang.Throwable throwable,
UiExceptionHandler.UiContext context)
Perform exception handling.
|
handle
protected static final java.util.regex.Pattern HOT_DEPLOY_CLASS_CAST_REGEXP
ClassCastException
exception message.
Regexp explanation:
^(\w.+?)\b
- matches the class name at the beginning of the string that consists of words
separated by a dot and ends with a space(\w.+?)\b$
- matches the class name that consists of words separated by a dot and ends at the end
of the stringExample:
com.company.sample.web.screens.TestScreen cannot be cast to com.company.sample.web.screens.TestScreen
@Inject protected Messages messages
protected boolean canHandle(java.lang.String className, java.lang.String message, @Nullable java.lang.Throwable throwable)
AbstractUiExceptionHandler
canHandle
in class AbstractUiExceptionHandler
className
- exception class namemessage
- exception messagethrowable
- exception instance. Can be null if the exception occurred on the server side and this
exception class isn't accessible by the client.protected void doHandle(java.lang.String className, java.lang.String message, @Nullable java.lang.Throwable throwable, UiExceptionHandler.UiContext context)
AbstractUiExceptionHandler
doHandle
in class AbstractUiExceptionHandler
className
- actual exception class namemessage
- exception messagethrowable
- exception instance. Can be null if the exception occurred on the server side and this
exception class isn't accessible by the client.context
- UI context