Search in sources :

Example 1 with Action

use of org.mule.runtime.api.notification.Notification.Action in project mule by mulesoft.

the class DefaultMuleApplication method setMuleContext.

private void setMuleContext(final MuleContext muleContext, Registry registry) {
    statusListener = new MuleContextNotificationListener<MuleContextNotification>() {

        @Override
        public boolean isBlocking() {
            return false;
        }

        @Override
        public void onNotification(MuleContextNotification notification) {
            Action action = notification.getAction();
            if (new IntegerAction(CONTEXT_INITIALISED).equals(action) || new IntegerAction(CONTEXT_STARTED).equals(action) || new IntegerAction(CONTEXT_STOPPED).equals(action) || new IntegerAction(CONTEXT_DISPOSED).equals(action)) {
                updateStatusFor(muleContext.getLifecycleManager().getCurrentPhase());
            }
        }
    };
    notificationRegistrer = registry.lookupByType(NotificationListenerRegistry.class).get();
    notificationRegistrer.registerListener(statusListener);
}
Also used : Action(org.mule.runtime.api.notification.Notification.Action) IntegerAction(org.mule.runtime.api.notification.IntegerAction) IntegerAction(org.mule.runtime.api.notification.IntegerAction) MuleContextNotification(org.mule.runtime.core.api.context.notification.MuleContextNotification)

Aggregations

IntegerAction (org.mule.runtime.api.notification.IntegerAction)1 Action (org.mule.runtime.api.notification.Notification.Action)1 MuleContextNotification (org.mule.runtime.core.api.context.notification.MuleContextNotification)1