4
%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
20
-behaviour(supervisor).
23
-export([start/2, stop/1, start_phase/3]).
28
start(_Type, {_AppN, Low, High}) ->
29
Name = list_to_atom(lists:concat([ch_sup, Low])),
30
{ok, P} = supervisor:start_link({local, Name}, ch_sup,
31
lists:seq(Low, High)),
37
SupFlags = {one_for_one, 12, 60},
38
Chs = lists:map(fun(No) ->
39
{list_to_atom(lists:concat([ch,No])),
40
{ch, start_link, [{ch, No}]},
41
permanent, 2000, worker, [ch]}
44
{ok, {SupFlags, Chs}}.
46
start_phase(Phase, _Type, _Args) ->
47
(catch global:send(start_phase,{sp, Phase})),