16
16
17
17
-module (rabbit_sup ).
18
18
19
- -behaviour (supervisor2 ).
19
+ -behaviour (supervisor ).
20
20
21
21
-export ([start_link /0 , start_child /1 , start_child /2 , start_child /3 , start_child /4 ,
22
22
start_supervisor_child /1 , start_supervisor_child /2 ,
25
25
start_delayed_restartable_child /1 , start_delayed_restartable_child /2 ,
26
26
stop_child /1 ]).
27
27
28
- -export ([init /1 , prep_stop / 0 ]).
28
+ -export ([init /1 ]).
29
29
30
30
-include (" rabbit.hrl" ).
31
31
49
49
50
50
% %----------------------------------------------------------------------------
51
51
52
- start_link () -> supervisor2 :start_link ({local , ? SERVER }, ? MODULE , []).
52
+ start_link () -> supervisor :start_link ({local , ? SERVER }, ? MODULE , []).
53
53
54
54
start_child (Mod ) -> start_child (Mod , []).
55
55
56
56
start_child (Mod , Args ) -> start_child (Mod , Mod , Args ).
57
57
58
58
start_child (ChildId , Mod , Args ) ->
59
- child_reply (supervisor2 :start_child (
59
+ child_reply (supervisor :start_child (
60
60
? SERVER ,
61
61
{ChildId , {Mod , start_link , Args },
62
62
transient , ? WORKER_WAIT , worker , [Mod ]})).
63
63
64
64
start_child (ChildId , Mod , Fun , Args ) ->
65
- child_reply (supervisor2 :start_child (
65
+ child_reply (supervisor :start_child (
66
66
? SERVER ,
67
67
{ChildId , {Mod , Fun , Args },
68
68
transient , ? WORKER_WAIT , worker , [Mod ]})).
@@ -73,7 +73,7 @@ start_supervisor_child(Mod) -> start_supervisor_child(Mod, []).
73
73
start_supervisor_child (Mod , Args ) -> start_supervisor_child (Mod , Mod , Args ).
74
74
75
75
start_supervisor_child (ChildId , Mod , Args ) ->
76
- child_reply (supervisor2 :start_child (
76
+ child_reply (supervisor :start_child (
77
77
? SERVER ,
78
78
{ChildId , {Mod , start_link , Args },
79
79
transient , infinity , supervisor , [Mod ]})).
@@ -85,25 +85,20 @@ start_delayed_restartable_child(M, A) -> start_restartable_child(M, A, true).
85
85
86
86
start_restartable_child (Mod , Args , Delay ) ->
87
87
Name = list_to_atom (atom_to_list (Mod ) ++ " _sup" ),
88
- child_reply (supervisor2 :start_child (
88
+ child_reply (supervisor :start_child (
89
89
? SERVER ,
90
90
{Name , {rabbit_restartable_sup , start_link ,
91
91
[Name , {Mod , start_link , Args }, Delay ]},
92
92
transient , infinity , supervisor , [rabbit_restartable_sup ]})).
93
93
94
94
stop_child (ChildId ) ->
95
- case supervisor2 :terminate_child (? SERVER , ChildId ) of
96
- ok -> supervisor2 :delete_child (? SERVER , ChildId );
95
+ case supervisor :terminate_child (? SERVER , ChildId ) of
96
+ ok -> supervisor :delete_child (? SERVER , ChildId );
97
97
E -> E
98
98
end .
99
99
100
100
init ([]) -> {ok , {{one_for_all , 0 , 1 }, []}}.
101
101
102
- prep_stop () ->
103
- rabbit_log :info (" Stopping dependencies...~n " ,[]),
104
- Apps = rabbit_plugins :active (),
105
- rabbit :stop_apps (app_utils :app_dependency_order (Apps , true )),
106
- rabbit_log :info (" Dependencies stopped...~n " ,[]).
107
102
108
103
% %----------------------------------------------------------------------------
109
104
0 commit comments