Class 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.
    • Method Detail

      • getFailedActivity

        public Activity getFailedActivity()
        Returns the Activity instance that threw the exception.
        Returns:
        the Activity that failed a lifecycle call. 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 .