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.endpoint.ImmutableEndpoint;
15 import org.mule.api.lifecycle.Disposable;
16 import org.mule.api.lifecycle.Initialisable;
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.transformer.Transformer;
21 import org.mule.api.transport.Connector;
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
38 public class TransientRegistryInitialisePhase extends DefaultLifecyclePhase
39 {
40 public TransientRegistryInitialisePhase()
41 {
42 this(new Class[]{Registry.class});
43 }
44
45 public TransientRegistryInitialisePhase(Class[] ignorredObjects)
46 {
47 super(Initialisable.PHASE_NAME, Initialisable.class, Disposable.PHASE_NAME);
48
49 setIgnoredObjectTypes(ignorredObjects);
50 Set initOrderedObjects = new LinkedHashSet();
51 initOrderedObjects.add(new NotificationLifecycleObject(MuleContext.class));
52 initOrderedObjects.add(new NotificationLifecycleObject(Connector.class));
53 initOrderedObjects.add(new NotificationLifecycleObject(Transformer.class));
54 initOrderedObjects.add(new NotificationLifecycleObject(ImmutableEndpoint.class));
55 initOrderedObjects.add(new NotificationLifecycleObject(Agent.class));
56 initOrderedObjects.add(new NotificationLifecycleObject(Service.class));
57 initOrderedObjects.add(new NotificationLifecycleObject(Model.class));
58
59 initOrderedObjects.add(new NotificationLifecycleObject(Initialisable.class));
60
61 setOrderedLifecycleObjects(initOrderedObjects);
62 registerSupportedPhase(NotInLifecyclePhase.PHASE_NAME);
63 }
64 }