Package org.uberfire.client.mvp
Class ActivityLifecycleError
- java.lang.Object
-
- org.uberfire.client.mvp.ActivityLifecycleError
-
- All Implemented Interfaces:
org.uberfire.workbench.events.UberFireEvent
public class ActivityLifecycleError extends Object implements org.uberfire.workbench.events.UberFireEvent
CDI event fired by the framework each time an Activity lifecycle method throws an exception. Observers of the event can use its methods to get information about the lifecycle call that failed, and can also ask the framework to suppress the default error message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classActivityLifecycleError.LifecyclePhaseThe different activity lifecycle calls that can fail.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThrowablegetException()Returns the exception thrown by the failed lifecycle method, if the failure was due to a thrown exception.ActivitygetFailedActivity()Returns the Activity instance that threw the exception.ActivityLifecycleError.LifecyclePhasegetFailedCall()Tells which lifecycle phase failed.booleanisErrorMessageSuppressed()Tells whether a previous observer has requested that the standard error message in the GUI be suppressed.voidsuppressErrorMessage()Tells the framework that it should not mention this failure in the workbench GUI.
-
-
-
Method Detail
-
getFailedActivity
public Activity getFailedActivity()
Returns the Activity instance that threw the exception.- Returns:
- the Activity that failed a lifecycle call. Never null.
-
getFailedCall
public ActivityLifecycleError.LifecyclePhase getFailedCall()
Tells which lifecycle phase failed.- Returns:
- the lifecycle phase that failed to happen. Never null.
-
getException
public Throwable getException()
Returns the exception thrown by the failed lifecycle method, if the failure was due to a thrown exception.- Returns:
- the exception thrown by the failed lifecycle method. May be null.
-
suppressErrorMessage
public void suppressErrorMessage()
Tells the framework that it should not mention this failure in the workbench GUI. Once this method has been invoked, there is no way to flip it back. Any such mechanism would not be reliable, because observers are not called in a predictable order.
-
isErrorMessageSuppressed
public boolean isErrorMessageSuppressed()
Tells whether a previous observer has requested that the standard error message in the GUI be suppressed. This is only truly useful to the originator of the event, who can examine the value after all observers have been notified. Application code should not rely on the return value of this method, because there is no guarantee what order observers are called in.- Returns:
- true if any observer has invoked the
suppressErrorMessage()method on this event .
-
-