1
<?xml version="1.0" encoding="latin1" ?>
2
<!DOCTYPE fileref SYSTEM "fileref.dtd">
9
<holder>Ericsson AB, All Rights Reserved</holder>
12
The contents of this file are subject to the Erlang Public License,
13
Version 1.1, (the "License"); you may not use this file except in
14
compliance with the License. You should have received a copy of the
15
Erlang Public License along with this software. If not, it can be
16
retrieved online at http://www.erlang.org/.
18
Software distributed under the License is distributed on an "AS IS"
19
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
20
the License for the specific language governing rights and limitations
23
The Initial Developer of the Original Code is Ericsson AB.
33
<filesummary>Application resource file.</filesummary>
35
<p>The <em>application resource file</em> specifies the resources an
36
application uses, and how the application is started. There must
37
always be one application resource file called
38
<c>Application.app</c> for each application <c>Application</c> in
40
<p>The file is read by the application controller when an
41
application is loaded/started. It is also used by the functions in
42
<c>systools</c>, for example when generating start scripts.</p>
46
<title>FILE SYNTAX</title>
47
<p>The application resource file should be called
48
<c>Application.app</c> where <c>Application</c> is the name of
49
the application. The file should be located in the <c>ebin</c>
50
directory for the application.</p>
51
<p>It must contain one single Erlang term, which is called an
52
<em>application specification</em>:</p>
54
{application, Application,
55
[{description, Description},
62
{included_applications, Apps},
66
{start_phases, Phases}]}.
71
Description string() ""
80
Start {Module,StartArgs} undefined
81
Phases [{Phase,PhaseArgs}] undefined
82
Module = Name = App = Par = Phase = atom()
83
Val = StartArgs = PhaseArgs = term()</code>
84
<p><c>Application</c> is the name of the application.</p>
85
<p>For the application controller, all keys are optional.
86
The respective default values are used for any omitted keys.</p>
87
<p>The functions in <c>systools</c> require more information. If
88
they are used, the following keys are mandatory:
89
<c>description</c>, <c>vsn</c>, <c>modules</c>, <c>registered</c>
90
and <c>applications</c>. The other keys are ignored by
93
<tag><c>description</c></tag>
95
<p>A one-line description of the application.</p>
99
<p>Product identification, or similar.</p>
101
<tag><c>vsn</c></tag>
103
<p>The version of the application.</p>
105
<tag><c>modules</c></tag>
107
<p>All modules introduced by this application. <c>systools</c>
108
uses this list when generating start scripts and tar files. A
109
module can only be defined in one application.</p>
111
<tag><c>maxP</c></tag>
113
<p><em>Deprecated - will be ignored</em> <br></br>
115
The maximum number of processes allowed in the application.</p>
117
<tag><c>maxT</c></tag>
119
<p>The maximum time in milliseconds that the application is
120
allowed to run. After the specified time the application will
121
automatically terminate.</p>
123
<tag><c>registered</c></tag>
125
<p>All names of registered processes started in this
126
application. <c>systools</c> uses this list to detect name
127
clashes between different applications.</p>
129
<tag><c>included_applications</c></tag>
131
<p>All applications which are included by this application.
132
When this application is started, all included application
133
will automatically be loaded, but not started, by
134
the application controller. It is assumed that the topmost
135
supervisor of the included application is started by a
136
supervisor of this application.</p>
138
<tag><c>applications</c></tag>
140
<p>All applications which must be started before this
141
application is allowed to be started. <c>systools</c> uses
142
this list to generate correct start scripts. Defaults to
143
the empty list, but note that all applications have
144
dependencies to (at least) <c>kernel</c> and <c>stdlib</c>.</p>
146
<tag><c>env</c></tag>
148
<p>Configuration parameters used by the application. The value
149
of a configuration parameter is retrieved by calling
150
<c>application:get_env/1,2</c>. The values in the application
151
resource file can be overridden by values in a configuration
152
file (see <c>config(4)</c>) or by command line flags (see
155
<tag><c>mod</c></tag>
157
<p>Specifies the application callback module and a start
158
argument, see <c>application(3)</c>.</p>
159
<p>The <c>mod</c> key is necessary for an application
160
implemented as a supervision tree, or the application
161
controller will not know how to start it. The <c>mod</c> key
162
can be omitted for applications without processes, typically
163
code libraries such as the application STDLIB.</p>
165
<tag><c>start_phases</c></tag>
167
<p>A list of start phases and corresponding start arguments for
168
the application. If this key is present, the application
169
master will - in addition to the usual call to
170
<c>Module:start/2</c> - also call
171
<c>Module:start_phase(Phase,Type,PhaseArgs)</c> for each
172
start phase defined by the <c>start_phases</c> key, and only
173
after this extended start procedure will
174
<c>application:start(Application)</c> return.</p>
176
<p>Start phases may be used to synchronize startup of an
177
application and its included applications. In this case,
178
the <c>mod</c> key must be specified as:</p>
180
{mod, {application_starter,[Module,StartArgs]}}</code>
181
<p>The application master will then call <c>Module:start/2</c>
182
for the primary application, followed by calls to
183
<c>Module:start_phase/3</c> for each start phase (as defined
184
for the primary application) both for the primary application
185
and for each of its included application, for which the start
186
phase is defined.</p>
188
<p>This implies that for an included application, the set of
189
start phases must be a subset of the set of phases defined
190
for the primary application. Refer to <em>OTP Design Principles</em> for more information.</p>
196
<title>SEE ALSO</title>
197
<p><seealso marker="application">application(3)</seealso>,