Skip to content

Commit

Permalink
init checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfa committed Nov 14, 2010
1 parent dc6d8e3 commit 6ba4ae2
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
85 changes: 85 additions & 0 deletions app_sup.erl
@@ -0,0 +1,85 @@
%%% -------------------------------------------------------------------
%%% Author : {{author}} {{email}}
%%% Description :
%%%
%%% Created : {{date}}
%%% -------------------------------------------------------------------
-module({{module}}).

-behaviour(application).
-behaviour(supervisor).
%% --------------------------------------------------------------------
%% Include files
%% --------------------------------------------------------------------

%% --------------------------------------------------------------------
%% Behavioural exports
%% --------------------------------------------------------------------
-export([start/0, start/2, stop/0, stop/1, restart/0]).
-export([init/1, start_link/2]).

%% --------------------------------------------------------------------
%% Internal exports
%% --------------------------------------------------------------------

%% --------------------------------------------------------------------
%% API Functions
%% --------------------------------------------------------------------

%% ====================================================================
%% Server functions
%% ====================================================================
%% --------------------------------------------------------------------
%% Func: init/1
%% Returns: {ok, {SupFlags, [ChildSpec]}} |
%% ignore |
%% {error, Reason}
%% --------------------------------------------------------------------
init([]) ->
ok.
%% ====================================================================!
%% External functions
%% ====================================================================!
%% --------------------------------------------------------------------
%% Func: start/0
%% Returns: {ok, Pid} |
%% {ok, Pid, State} |
%% {error, Reason}
%% --------------------------------------------------------------------
start() ->
application:start(?MODULE).

start_link(_Type, _Args) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
%% --------------------------------------------------------------------
%% Func: start/2
%% Returns: {ok, Pid} |
%% {ok, Pid, State} |
%% {error, Reason}
%% --------------------------------------------------------------------
start(_Type, _Args) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
%% --------------------------------------------------------------------
%% Func: stop/0
%% Returns: any
%% --------------------------------------------------------------------
stop() ->
application:stop(?MODULE).
%% --------------------------------------------------------------------
%% Func: stop/1
%% Returns: any
%% --------------------------------------------------------------------
stop(_State) ->
ok.
%% --------------------------------------------------------------------
%% Func: restart/0
%% Returns: any
%% --------------------------------------------------------------------
restart() ->
stop(),
start().

%% ====================================================================
%% Internal functions
%% ====================================================================

2 changes: 2 additions & 0 deletions app_sup.template
@@ -0,0 +1,2 @@
{variables, [{module, ""}, {author, "Ulf"}, {date,""}, {email, "uaforum1@googlemail.com"}]}.
{template, "app_sup.erl", "src/{{module}}.erl"}.

0 comments on commit 6ba4ae2

Please sign in to comment.