~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to lib/diameter/src/transport/diameter_transport_sup.erl

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2011-12-15 19:20:10 UTC
  • mfrom: (1.1.18) (3.5.15 sid)
  • mto: (3.5.16 sid)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20111215192010-jnxcfe3tbrpp0big
Tags: 1:15.b-dfsg-1
* New upstream release.
* Upload to experimental because this release breaks external drivers
  API along with ABI, so several applications are to be fixed.
* Removed SSL patch because the old SSL implementation is removed from
  the upstream distribution.
* Removed never used patch which added native code to erlang beam files.
* Removed the erlang-docbuilder binary package because the docbuilder
  application was dropped by upstream.
* Documented dropping ${erlang-docbuilder:Depends} substvar in
  erlang-depends(1) manpage.
* Made erlang-base and erlang-base-hipe provide virtual package
  erlang-abi-15.b (the number means the first erlang version, which
  provides current ABI).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%%
 
4
%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
 
5
%%
 
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/.
 
11
%%
 
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
 
15
%% under the License.
 
16
%%
 
17
%% %CopyrightEnd%
 
18
%%
 
19
 
 
20
%%
 
21
%% Top supervisor for transport processes.
 
22
%%
 
23
 
 
24
-module(diameter_transport_sup).
 
25
 
 
26
-behaviour(supervisor).
 
27
 
 
28
-export([start_link/0,   %% supervisor start
 
29
         start_child/2]).
 
30
 
 
31
%% supervisor callback
 
32
-export([init/1]).
 
33
 
 
34
%% ---------------------------------------------------------------------------
 
35
 
 
36
%% start_link/0
 
37
%%
 
38
%% Start the transport top supervisor. This is started as a child at
 
39
%% at application start, from diameter_sup.erl. Protocol-specific
 
40
%% supervisors are started as children of this supervisor dynamically
 
41
%% by calling start_child/2. (Eg. diameter_tcp_sup:start/0, which
 
42
%% is called from diameter_tcp:start/3 to start supervisors the
 
43
%% first time a TCP transport process is started.)
 
44
 
 
45
start_link() ->
 
46
    SupName = {local, ?MODULE},
 
47
    supervisor:start_link(SupName, ?MODULE, []).
 
48
 
 
49
%% start_child/2
 
50
%%
 
51
%% Start a protocol-specific supervisor under the top supervisor.
 
52
 
 
53
start_child(Name, Module) ->
 
54
    Spec = {Name,
 
55
            {Module, start_link, [Name]},
 
56
            permanent,
 
57
            1000,
 
58
            supervisor,
 
59
            [Module]},
 
60
    supervisor:start_child(?MODULE, Spec).
 
61
 
 
62
%% ---------------------------------------------------------------------------
 
63
 
 
64
%% Top supervisor callback.
 
65
init([]) ->
 
66
    Flags   = {one_for_one, 0, 1},
 
67
    Workers = [],  %% Each protocol starts its supervisor on demand.
 
68
    {ok, {Flags, Workers}}.