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