1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.lifecycle.phases; |
8 | |
|
9 | |
import org.mule.api.MuleContext; |
10 | |
import org.mule.api.agent.Agent; |
11 | |
import org.mule.api.component.Component; |
12 | |
import org.mule.api.construct.FlowConstruct; |
13 | |
import org.mule.api.lifecycle.Initialisable; |
14 | |
import org.mule.api.lifecycle.Startable; |
15 | |
import org.mule.api.lifecycle.Stoppable; |
16 | |
import org.mule.api.model.Model; |
17 | |
import org.mule.api.registry.Registry; |
18 | |
import org.mule.api.routing.OutboundRouter; |
19 | |
import org.mule.api.routing.OutboundRouterCollection; |
20 | |
import org.mule.api.source.MessageSource; |
21 | |
import org.mule.api.transport.Connector; |
22 | |
import org.mule.context.notification.MuleContextNotification; |
23 | |
import org.mule.lifecycle.LifecycleObject; |
24 | |
import org.mule.lifecycle.NotificationLifecycleObject; |
25 | |
import org.mule.util.queue.TransactionalQueueManager; |
26 | |
|
27 | |
import java.util.LinkedHashSet; |
28 | |
import java.util.Set; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
public class MuleContextStopPhase extends DefaultLifecyclePhase |
50 | |
{ |
51 | |
public MuleContextStopPhase() |
52 | |
{ |
53 | 0 | this(new Class[]{Registry.class, MuleContext.class, MessageSource.class, Component.class, OutboundRouterCollection.class, OutboundRouter.class}); |
54 | 0 | } |
55 | |
|
56 | |
public MuleContextStopPhase(Class<?>[] ignorredObjects) |
57 | |
{ |
58 | 0 | super(Stoppable.PHASE_NAME, Stoppable.class, Startable.PHASE_NAME); |
59 | |
|
60 | 0 | Set<LifecycleObject> stopOrderedObjects = new LinkedHashSet<LifecycleObject>(); |
61 | |
|
62 | 0 | stopOrderedObjects.add(new NotificationLifecycleObject(FlowConstruct.class)); |
63 | 0 | stopOrderedObjects.add(new NotificationLifecycleObject(Model.class, MuleContextNotification.class)); |
64 | 0 | stopOrderedObjects.add(new NotificationLifecycleObject(Agent.class)); |
65 | 0 | stopOrderedObjects.add(new NotificationLifecycleObject(Connector.class)); |
66 | 0 | stopOrderedObjects.add(new NotificationLifecycleObject(TransactionalQueueManager.class)); |
67 | 0 | stopOrderedObjects.add(new NotificationLifecycleObject(Stoppable.class)); |
68 | |
|
69 | 0 | setIgnoredObjectTypes(ignorredObjects); |
70 | 0 | setOrderedLifecycleObjects(stopOrderedObjects); |
71 | |
|
72 | 0 | registerSupportedPhase(Initialisable.PHASE_NAME); |
73 | |
|
74 | 0 | registerSupportedPhase(Startable.PHASE_NAME); |
75 | 0 | } |
76 | |
} |