View Javadoc

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