%% -------------------------------------------------------------------
%%
  Copyright ( c ) 2013    , Inc. All Rights Reserved .
%%
  This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
  except in compliance with the License .   You may obtain
%% a copy of the License at
%%
%%   -2.0
%%
%% Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
%% KIND, either express or implied.  See the License for the
%% specific language governing permissions and limitations
%% under the License.
%%
%% -------------------------------------------------------------------

%%%-------------------------------------------------------------------
  @author     <  >
   ( C ) 2013 , <    > , All Rights Reserved .
%%% @doc Supervisor of 'west_event_handler'.
%%% @end
  Created : 03 . Oct 2013 9:57 AM
%%%-------------------------------------------------------------------
-module(west_event_handler_sup).

-behaviour(supervisor).

%% API
-export([start_link/0, start_child/3]).

%% Callback
-export([init/1]).

-include("west.hrl").

-define(SERVER, ?MODULE).

%%%===================================================================
%%% API
%%%===================================================================

%% @doc Start a gen_server to register the subscription and handle
%%      incoming events to this subscription.
-spec start_link() -> supervisor:startlink_ret().
start_link() ->
  supervisor:start_link({local, ?SERVER}, ?MODULE, []).

%% @doc Starts a new child `west_event_handler'.
-spec start_child(scope(), cb_spec(), proplist()) -> supervisor:startchild_ret().
start_child(Scope, CallbackSpec, Opts) ->
  supervisor:start_child(?SERVER, [Scope, CallbackSpec, Opts]).

%%%===================================================================
%%% Supervisor callbacks
%%%===================================================================

  @private
init(_Args) ->
  Element = {west_event_handler,
             {west_event_handler, start_link, []},
             transient,
             brutal_kill,
             worker,
             [west_event_handler]},
  Children = [Element],
  RestartStrategy = {simple_one_for_one, 10, 60},
  {ok, {RestartStrategy, Children}}.

 -------------------------------------------------------------------


 Version 2.0 (the "License"); you may not use this file
 a copy of the License at

   -2.0

 Unless required by applicable law or agreed to in writing,
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.

 -------------------------------------------------------------------
-------------------------------------------------------------------
 @doc Supervisor of 'west_event_handler'.
 @end
-------------------------------------------------------------------
 API
 Callback
===================================================================
 API
===================================================================
 @doc Start a gen_server to register the subscription and handle
      incoming events to this subscription.
 @doc Starts a new child `west_event_handler'.
===================================================================
 Supervisor callbacks
===================================================================
  Copyright ( c ) 2013    , Inc. All Rights Reserved .
  This file is provided to you under the Apache License ,
  except in compliance with the License .   You may obtain
  software distributed under the License is distributed on an
  " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY

  @author     <  >
   ( C ) 2013 , <    > , All Rights Reserved .
  Created : 03 . Oct 2013 9:57 AM
-module(west_event_handler_sup).

-behaviour(supervisor).

-export([start_link/0, start_child/3]).

-export([init/1]).

-include("west.hrl").

-define(SERVER, ?MODULE).


-spec start_link() -> supervisor:startlink_ret().
start_link() ->
  supervisor:start_link({local, ?SERVER}, ?MODULE, []).

-spec start_child(scope(), cb_spec(), proplist()) -> supervisor:startchild_ret().
start_child(Scope, CallbackSpec, Opts) ->
  supervisor:start_child(?SERVER, [Scope, CallbackSpec, Opts]).


  @private
init(_Args) ->
  Element = {west_event_handler,
             {west_event_handler, start_link, []},
             transient,
             brutal_kill,
             worker,
             [west_event_handler]},
  Children = [Element],
  RestartStrategy = {simple_one_for_one, 10, 60},
  {ok, {RestartStrategy, Children}}.
