View Javadoc

1   /*
2    * $Id: LifecyclePhase.java 19191 2010-08-25 21:05:23Z tcarlson $
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.MuleException;
13  import org.mule.api.registry.Registry;
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 addOrderedLifecycleObject(LifecycleObject lco);
32  
33      void removeOrderedLifecycleObject(LifecycleObject lco);
34  
35      Set<LifecycleObject> getOrderedLifecycleObjects();
36  
37      void setOrderedLifecycleObjects(Set<LifecycleObject> orderedLifecycleObjects);
38  
39      Class<?>[] getIgnoredObjectTypes();
40  
41      void setIgnoredObjectTypes(Class<?>[] ignorredObjectTypes);
42  
43      Class<?> getLifecycleClass();
44  
45      void setLifecycleClass(Class<?> lifecycleClass);
46  
47      String getName();
48  
49      Set<String> getSupportedPhases();
50  
51      void setSupportedPhases(Set<String> supportedPhases);
52  
53      void registerSupportedPhase(String phase);
54  
55      boolean isPhaseSupported(String phase);
56  
57      void applyLifecycle(Object o) throws LifecycleException;
58  
59      String getOppositeLifecyclePhase();
60  
61  }