aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2012-10-11 15:44:24 +0200
committerAnders Svensson <[email protected]>2012-11-16 17:18:41 +0100
commit476db5308088f0a907aa72726a75e31c695a92d3 (patch)
treed63c83e2f11af7d87113ea42798ff9dd0f575f92
parentbdc34f0f247628bc285143f250192e4c6016c812 (diff)
downloadotp-476db5308088f0a907aa72726a75e31c695a92d3.tar.gz
otp-476db5308088f0a907aa72726a75e31c695a92d3.tar.bz2
otp-476db5308088f0a907aa72726a75e31c695a92d3.zip
Add start/stop service_event()
-rw-r--r--lib/diameter/doc/src/diameter.xml11
-rw-r--r--lib/diameter/src/base/diameter_service.erl2
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml
index 80863f8eff..a35fd5b3a8 100644
--- a/lib/diameter/doc/src/diameter.xml
+++ b/lib/diameter/doc/src/diameter.xml
@@ -512,6 +512,17 @@ following types.</p>
<taglist>
+<tag><c>start</c></tag>
+<tag><c>stop</c></tag>
+
+<item>
+<p>
+The service is being started or stopped.
+No event precedes a <c>start</c> event.
+No event follows a <c>stop</c> event and this event
+implies the termination of all transport processes.</p>
+</item>
+
<tag><c>{up, Ref, Peer, Config, Pkt}</c></tag>
<tag><c>{up, Ref, Peer, Config}</c></tag>
<tag><c>{down, Ref, Peer, Config}</c></tag>
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index cffba4fc94..36907a8d1c 100644
--- a/lib/diameter/src/base/diameter_service.erl
+++ b/lib/diameter/src/base/diameter_service.erl
@@ -681,6 +681,7 @@ upgrade_insert(#state{service = #diameter_service{pid = Pid}} = S) ->
%%% ---------------------------------------------------------------------------
terminate(Reason, #state{service_name = Name} = S) ->
+ send_event(Name, stop),
ets:delete(?STATE_TABLE, Name),
shutdown == Reason %% application shutdown
andalso shutdown(S).
@@ -857,6 +858,7 @@ i(SvcName) ->
lists:foreach(fun(T) -> start_fsm(T,S) end, CL),
init_shared(S),
+ send_event(SvcName, start),
S.
cfg_acc({SvcName, #diameter_service{applications = Apps} = Rec, Opts},