View Javadoc

1   /*
2    * $Id: LifecyclePhase.java 22039 2011-05-30 19:12:17Z 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.api.lifecycle;
11  
12  import org.mule.api.NamedObject;
13  import org.mule.lifecycle.LifecycleObject;
14  
15  import java.util.Set;
16  
17  /**
18   * Encapsulates the notion of a lifecycle phase i.e. 'stop'.  Implementations of this class are responsible
19   * for invoking the lifecycle phase on a set of objects and also for knowing which phases can preceed and go
20   * after it.  This objects are configurable so that lifecycles can be customised.
21   *
22   * Note that users wouldn't normally customise the lifecycle of the server.
23   */
24  
25  public interface LifecyclePhase extends NamedObject
26  {
27      
28      String ALL_PHASES = "all";
29  
30      void addOrderedLifecycleObject(LifecycleObject lco);
31  
32      void removeOrderedLifecycleObject(LifecycleObject lco);
33  
34      Set<LifecycleObject> getOrderedLifecycleObjects();
35  
36      void setOrderedLifecycleObjects(Set<LifecycleObject> orderedLifecycleObjects);
37  
38      Class<?>[] getIgnoredObjectTypes();
39  
40      void setIgnoredObjectTypes(Class<?>[] ignorredObjectTypes);
41  
42      Class<?> getLifecycleClass();
43  
44      void setLifecycleClass(Class<?> lifecycleClass);
45  
46      Set<String> getSupportedPhases();
47  
48      void setSupportedPhases(Set<String> supportedPhases);
49  
50      void registerSupportedPhase(String phase);
51  
52      boolean isPhaseSupported(String phase);
53  
54      void applyLifecycle(Object o) throws LifecycleException;
55  
56      String getOppositeLifecyclePhase();
57  
58  }