01: /*
02: * $Id: LifecyclePhase.java 10808 2008-02-14 20:36:57Z acooke $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10: package org.mule.api.lifecycle;
11:
12: import org.mule.api.MuleException;
13: import org.mule.api.MuleContext;
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: String ALL_PHASES = "all";
29:
30: void fireLifecycle(MuleContext muleContext, String currentPhase)
31: 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: LifecycleTransitionResult applyLifecycle(Object o)
60: throws LifecycleException;
61:
62: public int getRegistryScope();
63:
64: public void setRegistryScope(int registryScope);
65:
66: public String getOppositeLifecyclePhase();
67:
68: }
|