1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.mule.lifecycle.phases; |
11 | |
|
12 | |
import org.mule.api.MuleContext; |
13 | |
import org.mule.api.agent.Agent; |
14 | |
import org.mule.api.lifecycle.Initialisable; |
15 | |
import org.mule.api.lifecycle.Startable; |
16 | |
import org.mule.api.lifecycle.Stoppable; |
17 | |
import org.mule.api.model.Model; |
18 | |
import org.mule.api.registry.Registry; |
19 | |
import org.mule.api.service.Service; |
20 | |
import org.mule.api.transport.Connector; |
21 | |
import org.mule.context.notification.MuleContextNotification; |
22 | |
import org.mule.lifecycle.DefaultLifecyclePhase; |
23 | |
import org.mule.lifecycle.NotificationLifecycleObject; |
24 | |
|
25 | |
import java.util.LinkedHashSet; |
26 | |
import java.util.Set; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
public class MuleContextStopPhase extends DefaultLifecyclePhase |
38 | |
{ |
39 | |
public MuleContextStopPhase() |
40 | |
{ |
41 | 1162 | this(new Class[]{Registry.class, MuleContext.class}); |
42 | 1162 | } |
43 | |
|
44 | |
public MuleContextStopPhase(Class[] ignorredObjects) |
45 | |
{ |
46 | 1162 | super(Stoppable.PHASE_NAME, Stoppable.class, Startable.PHASE_NAME); |
47 | |
|
48 | 1162 | Set stopOrderedObjects = new LinkedHashSet(); |
49 | 1162 | stopOrderedObjects.add(new NotificationLifecycleObject(Connector.class)); |
50 | 1162 | stopOrderedObjects.add(new NotificationLifecycleObject(Agent.class)); |
51 | 1162 | stopOrderedObjects.add(new NotificationLifecycleObject(Model.class, MuleContextNotification.class, |
52 | |
MuleContextNotification.CONTEXT_STOPPING_MODELS,MuleContextNotification.CONTEXT_STOPPED_MODELS)); |
53 | 1162 | stopOrderedObjects.add(new NotificationLifecycleObject(Service.class)); |
54 | 1162 | stopOrderedObjects.add(new NotificationLifecycleObject(Stoppable.class)); |
55 | |
|
56 | 1162 | setIgnoredObjectTypes(ignorredObjects); |
57 | 1162 | setOrderedLifecycleObjects(stopOrderedObjects); |
58 | 1162 | registerSupportedPhase(Startable.PHASE_NAME); |
59 | 1162 | registerSupportedPhase(Initialisable.PHASE_NAME); |
60 | 1162 | } |
61 | |
} |