Search in sources :

Example 6 with LifecycleException

use of org.mule.runtime.api.lifecycle.LifecycleException in project mule by mulesoft.

the class AbstractLifecycleManager method invokePhase.

protected void invokePhase(String phase, Object object, LifecycleCallback callback) throws LifecycleException {
    try {
        this.lastPhaseExecuted = phase;
        setExecutingPhase(phase);
        callback.onTransition(phase, object);
        setCurrentPhase(phase);
        lastPhaseExecutionFailed = false;
    }// In the case of a connection exception, trigger the reconnection strategy.
     catch (ConnectException ce) {
        lastPhaseExecutionFailed = true;
        doOnConnectException(ce);
    } catch (LifecycleException le) {
        lastPhaseExecutionFailed = true;
        throw le;
    } catch (Exception e) {
        lastPhaseExecutionFailed = true;
        throw new LifecycleException(e, object);
    } finally {
        setExecutingPhase(null);
    }
}
Also used : LifecycleException(org.mule.runtime.api.lifecycle.LifecycleException) LifecycleException(org.mule.runtime.api.lifecycle.LifecycleException) ConnectException(org.mule.runtime.core.api.connector.ConnectException) MuleException(org.mule.runtime.api.exception.MuleException) ConnectException(org.mule.runtime.core.api.connector.ConnectException)

Aggregations

LifecycleException (org.mule.runtime.api.lifecycle.LifecycleException)6 Method (java.lang.reflect.Method)2 MuleException (org.mule.runtime.api.exception.MuleException)2 ConnectException (org.mule.runtime.core.api.connector.ConnectException)2 AnnotationMetaData (org.mule.runtime.core.privileged.util.annotation.AnnotationMetaData)2 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1 Initialisable (org.mule.runtime.api.lifecycle.Initialisable)1 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)1 Startable (org.mule.runtime.api.lifecycle.Startable)1 Stoppable (org.mule.runtime.api.lifecycle.Stoppable)1 Processor (org.mule.runtime.core.api.processor.Processor)1 ReactiveProcessor (org.mule.runtime.core.api.processor.ReactiveProcessor)1 MessageSource (org.mule.runtime.core.api.source.MessageSource)1 LifecyclePhase (org.mule.runtime.core.internal.lifecycle.phases.LifecyclePhase)1 NotInLifecyclePhase (org.mule.runtime.core.internal.lifecycle.phases.NotInLifecyclePhase)1 RegistrationException (org.mule.runtime.core.privileged.registry.RegistrationException)1 SensingNullMessageProcessor (org.mule.tck.SensingNullMessageProcessor)1 LifecycleTrackerProcessor (org.mule.tck.core.lifecycle.LifecycleTrackerProcessor)1