View Javadoc

1   /*
2    * $Id: LifecycleTrackerFilter.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  package org.mule.test.integration.filter;
11  
12  import org.mule.api.MuleContext;
13  import org.mule.api.MuleException;
14  import org.mule.api.MuleMessage;
15  import org.mule.api.context.MuleContextAware;
16  import org.mule.api.lifecycle.InitialisationException;
17  import org.mule.api.lifecycle.Lifecycle;
18  import org.mule.api.routing.filter.Filter;
19  
20  import java.util.ArrayList;
21  import java.util.List;
22  
23  public class LifecycleTrackerFilter implements Filter, Lifecycle, MuleContextAware
24  {
25  
26      private final List<String> tracker = new ArrayList<String>();
27  
28      public List<String> getTracker()
29      {
30          return tracker;
31      }
32  
33      public void setProperty(final String value)
34      {
35          tracker.add("setProperty");
36      }
37  
38      public void setMuleContext(final MuleContext context)
39      {
40          tracker.add("setMuleContext");
41      }
42  
43  
44      public void initialise() throws InitialisationException
45      {
46          tracker.add("initialise");
47      }
48  
49      public void start() throws MuleException
50      {
51          tracker.add("start");
52      }
53  
54      public void stop() throws MuleException
55      {
56          tracker.add("stop");
57      }
58  
59      public void dispose()
60      {
61          tracker.add("dispose");
62      }
63  
64      public boolean accept(MuleMessage message)
65      {
66          // TODO Auto-generated method stub
67          return false;
68      }
69  
70  }
71