View Javadoc

1   /*
2    * $Id: LifecyclePhase.java 12269 2008-07-10 04:19:03Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.api.lifecycle;
11  
12  import org.mule.api.MuleContext;
13  import org.mule.api.MuleException;
14  import org.mule.lifecycle.LifecycleObject;
15  
16  import java.util.Set;
17  
18  /**
19   * Encapsulates the notion of a lifecycle phase i.e. 'stop'.  Implementations of this class are responsible
20   * for invoking the lifecycle phase on a set of objects and also for knowing which phases can preceed and go
21   * after it.  This objects are configurable so that lifecycles can be customised.
22   *
23   * Note that users wouldn't normally customise the lifecycle of the server.
24   */
25  
26  public interface LifecyclePhase
27  {
28      
29      String ALL_PHASES = "all";
30  
31      void fireLifecycle(MuleContext muleContext, String currentPhase) throws MuleException;
32  
33      void addOrderedLifecycleObject(LifecycleObject lco);
34  
35      void removeOrderedLifecycleObject(LifecycleObject lco);
36  
37      Set getOrderedLifecycleObjects();
38  
39      void setOrderedLifecycleObjects(Set orderedLifecycleObjects);
40  
41      Class[] getIgnoredObjectTypes();
42  
43      void setIgnoredObjectTypes(Class[] ignorredObjectTypes);
44  
45      Class getLifecycleClass();
46  
47      void setLifecycleClass(Class lifecycleClass);
48  
49      String getName();
50  
51      Set getSupportedPhases();
52  
53      void setSupportedPhases(Set supportedPhases);
54  
55      void registerSupportedPhase(String phase);
56  
57      boolean isPhaseSupported(String phase);
58  
59      void applyLifecycle(Object o) throws LifecycleException;
60  
61      int getRegistryScope();
62  
63      void setRegistryScope(int registryScope);
64  
65      String getOppositeLifecyclePhase();
66  
67  }