Permalink
Browse files

- condensed scalaris application start from three to a single file.

- no .app files needed.
  • Loading branch information...
1 parent 1b585da commit 88776c602c2026de907d06dee412f698a92afe72 schintke committed Mar 8, 2011
Showing with 60 additions and 118 deletions.
  1. +0 −24 ebin/scalaris.app
  2. +0 −24 ebin/scalaris2.app
  3. +31 −0 src/scalaris.erl
  4. +29 −0 src/scalaris2.erl
  5. +0 −35 src/scalaris2_app.erl
  6. +0 −35 src/scalaris_app.erl
View
@@ -1,24 +0,0 @@
-% Copyright 2007-2011 Zuse Institute Berlin
-%
-% Licensed 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
-%
-% http://www.apache.org/licenses/LICENSE-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.
-%
-% $Id$
-
-{application, scalaris,
- [{description, "scalaris"},
- {vsn, "0.2"},
- {mod, {scalaris_app, []}},
- {registered, []},
- {applications, [kernel, stdlib]},
- {env, []}
- ]}.
View
@@ -1,24 +0,0 @@
-% Copyright 2007-2011 Zuse Institute Berlin
-%
-% Licensed 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
-%
-% http://www.apache.org/licenses/LICENSE-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.
-%
-% $Id$
-
-{application, scalaris2,
- [{description, "scalaris2"},
- {vsn, "1.0"},
- {mod, {scalaris2_app, []}},
- {registered, []},
- {applications, [kernel, stdlib]},
- {env, []}
- ]}.
View
@@ -19,12 +19,43 @@
-author('schuett@zib.de').
-vsn('$Id$').
+%% functions called by Erlangs init module, triggered via command line
+%% (bin/scalarisctl and erl ... '-s scalaris')
-export([start/0, stop/0]).
+%% functions called by application:start(scalaris)
+%% triggered by ?MODULE:start/0.
+-behaviour(application).
+-export([start/2, stop/1]).
+
+%% functions called by Erlangs init module, triggered via command line
+%% (bin/scalarisctl and erl ... '-s scalaris')
-spec start() -> ok | {error, Reason::term()}.
start() ->
+ application:load(
+ {application, scalaris,
+ [{description, "scalaris"},
+ {vsn, "0.2"},
+ {mod, {scalaris, []}},
+ {registered, []},
+ {applications, [kernel, stdlib]},
+ {env, []}
+ ]}),
application:start(scalaris).
-spec stop() -> ok | {error, Reason::term()}.
stop() ->
application:stop(scalaris).
+
+%% functions called by application:start(scalaris)
+%% triggered by ?MODULE:start/0.
+-spec start(StartType::normal, StartArgs::[])
+ -> {ok, Pid::pid()} | ignore |
+ {error, Error::{already_started, Pid::pid()} | term()}.
+start(normal, []) ->
+ _ = pid_groups:start_link(),
+ sup_scalaris:start_link().
+
+-spec stop(any()) -> ok.
+stop(_State) ->
+ ok.
View
@@ -20,15 +20,44 @@
-author('schuett@zib.de').
-vsn('$Id$').
+%% functions called by Erlangs init module, triggered via command line
+%% (bin/scalarisctl and erl ... '-s scalaris2')
-export([start/0, stop/0]).
+%% functions called by application:start(scalaris2)
+%% triggered by ?MODULE:start/0.
+-behaviour(application).
+-export([start/2, stop/1]).
+
+%% functions called by Erlangs init module, triggered via command line
+%% (bin/scalarisctl and erl ... '-s scalaris2')
-spec start() -> ok | {error, Reason::term()}.
start() ->
%% tracer:start(),
io:format("scalaris2~n", []),
+ application:load({application, scalaris2,
+ [{description, "scalaris2"},
+ {vsn, "1.0"},
+ {mod, {scalaris2, []}},
+ {registered, []},
+ {applications, [kernel, stdlib]},
+ {env, []}
+ ]}),
application:start(scalaris2).
-spec stop() -> ok | {error, Reason::term()}.
stop() ->
application:stop(scalaris2).
+%% functions called by application:start(scalaris2)
+%% triggered by ?MODULE:start/0.
+-spec start(StartType::normal, StartArgs::[])
+ -> {ok, Pid::pid()} | ignore |
+ {error, Error::{already_started, Pid::pid()} | term()}.
+start(normal, []) ->
+ _ = pid_groups:start_link(),
+ sup_scalaris2:start_link().
+
+-spec stop(any()) -> ok.
+stop(_State) ->
+ ok.
View
@@ -1,35 +0,0 @@
-% @copyright 2007-2011 Zuse Institute Berlin
-
-% Licensed 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
-%
-% http://www.apache.org/licenses/LICENSE-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 Thorsten Schuett <schuett@zib.de>
-%% @doc scalaris2 application file
-%% @version $Id$
--module(scalaris2_app).
--author('schuett@zib.de').
--vsn('$Id$').
-
--behaviour(application).
-
--export([start/2, stop/1]).
-
--spec start(StartType::normal, StartArgs::[])
- -> {ok, Pid::pid()} | ignore |
- {error, Error::{already_started, Pid::pid()} | term()}.
-start(normal, []) ->
- _ = pid_groups:start_link(),
- sup_scalaris2:start_link().
-
--spec stop(any()) -> ok.
-stop(_State) ->
- ok.
View
@@ -1,35 +0,0 @@
-% @copyright 2007-2011 Zuse Institute Berlin
-
-% Licensed 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
-%
-% http://www.apache.org/licenses/LICENSE-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 Thorsten Schuett <schuett@zib.de>
-%% @doc scalaris application file
-%% @version $Id$
--module(scalaris_app).
--author('schuett@zib.de').
--vsn('$Id$').
-
--behaviour(application).
-
--export([start/2, stop/1]).
-
--spec start(StartType::normal, StartArgs::[])
- -> {ok, Pid::pid()} | ignore |
- {error, Error::{already_started, Pid::pid()} | term()}.
-start(normal, []) ->
- _ = pid_groups:start_link(),
- sup_scalaris:start_link().
-
--spec stop(any()) -> ok.
-stop(_State) ->
- ok.

0 comments on commit 88776c6

Please sign in to comment.