View Javadoc

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