View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.context.notification;
8   
9   import org.mule.api.construct.FlowConstruct;
10  import org.mule.api.context.notification.BlockingServerEvent;
11  import org.mule.api.context.notification.ServerNotification;
12  
13  /**
14   * <code>FlowConstructNotification</code> is fired when an event such as the flow
15   * construct starting occurs. The payload of this event will always be a reference to
16   * the flow construct.
17   */
18  public class FlowConstructNotification extends ServerNotification implements BlockingServerEvent
19  {
20      private static final long serialVersionUID = 6658641434183647952L;
21      public static final int FLOW_CONSTRUCT_INITIALISED = FLOW_CONSTRUCT_EVENT_ACTION_START_RANGE + 1;
22      public static final int FLOW_CONSTRUCT_STARTED = FLOW_CONSTRUCT_EVENT_ACTION_START_RANGE + 2;
23      public static final int FLOW_CONSTRUCT_STOPPED = FLOW_CONSTRUCT_EVENT_ACTION_START_RANGE + 3;
24      public static final int FLOW_CONSTRUCT_PAUSED = FLOW_CONSTRUCT_EVENT_ACTION_START_RANGE + 4;
25      public static final int FLOW_CONSTRUCT_RESUMED = FLOW_CONSTRUCT_EVENT_ACTION_START_RANGE + 5;
26      public static final int FLOW_CONSTRUCT_DISPOSED = FLOW_CONSTRUCT_EVENT_ACTION_START_RANGE + 6;
27  
28      static
29      {
30          registerAction("flow construct initialised", FLOW_CONSTRUCT_INITIALISED);
31          registerAction("flow construct started", FLOW_CONSTRUCT_STARTED);
32          registerAction("flow construct stopped", FLOW_CONSTRUCT_STOPPED);
33          registerAction("flow construct paused", FLOW_CONSTRUCT_PAUSED);
34          registerAction("flow construct resumed", FLOW_CONSTRUCT_RESUMED);
35          registerAction("flow construct disposed", FLOW_CONSTRUCT_DISPOSED);
36      }
37  
38      public FlowConstructNotification(FlowConstruct flowConstruct, int action)
39      {
40          super(flowConstruct.getName(), action);
41          resourceIdentifier = flowConstruct.getName();
42      }
43  }