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.context.MuleContextAware;
11  
12  import java.util.ArrayList;
13  import java.util.List;
14  
15  import javax.annotation.PostConstruct;
16  import javax.annotation.PreDestroy;
17  
18  public class JSR250ObjectLifecycleTracker implements MuleContextAware
19      {
20          private final List<String> tracker = new ArrayList<String>();
21  
22          public List<String> getTracker() {
23              return tracker;
24          }
25  
26          public void setMuleContext(MuleContext context)
27          {
28              tracker.add("setMuleContext");
29          }
30  
31          @PostConstruct
32          public void init()
33          {
34              tracker.add("initialise");
35          }
36  
37          @PreDestroy
38          public void dispose()
39          {
40              tracker.add("dispose");
41          }
42      }