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.lifecycle;
8   
9   import org.mule.api.MuleContext;
10  import org.mule.api.MuleException;
11  import org.mule.api.context.MuleContextAware;
12  import org.mule.api.lifecycle.InitialisationException;
13  import org.mule.api.lifecycle.Lifecycle;
14  
15  import java.util.ArrayList;
16  import java.util.List;
17  
18  /**
19   * @author David Dossot (david@dossot.net)
20   */
21  public abstract class AbstractLifecycleTracker implements Lifecycle,
22          MuleContextAware {
23  
24      private final List<String> tracker = new ArrayList<String>();
25  
26      public List<String> getTracker() {
27          return tracker;
28      }
29  
30      public void setProperty(final String value) {
31          getTracker().add("setProperty");
32      }
33  
34      public void setMuleContext(final MuleContext context) {
35          getTracker().add("setMuleContext");
36      }
37  
38      public void initialise() throws InitialisationException {
39          getTracker().add("initialise");
40      }
41  
42      public void start() throws MuleException {
43          getTracker().add("start");
44      }
45  
46      public void stop() throws MuleException {
47          getTracker().add("stop");
48      }
49  
50      public void dispose() {
51          getTracker().add("dispose");
52      }
53  
54  }