1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
.TH app 4 "kernel 2.12.3" "Ericsson AB" "FILES"
.SH NAME
app \- Application resource file\&.
.SH DESCRIPTION
.LP
The \fIapplication resource file\fR specifies the resources an application uses, and how the application is started\&. There must always be one application resource file called \fIApplication\&.app\fR for each application \fIApplication\fR in the system\&.
.LP
The file is read by the application controller when an application is loaded/started\&. It is also used by the functions in \fIsystools\fR, for example when generating start scripts\&.
.SH FILE SYNTAX
.LP
The application resource file should be called \fIApplication\&.app\fR where \fIApplication\fR is the name of the application\&. The file should be located in the \fIebin\fR directory for the application\&.
.LP
It must contain one single Erlang term, which is called an \fIapplication specification\fR:
.nf
{application, Application,
[{description, Description},
{id, Id},
{vsn, Vsn},
{modules, Modules},
{maxP, MaxP},
{maxT, MaxT},
{registered, Names},
{included_applications, Apps},
{applications, Apps},
{env, Env},
{mod, Start},
{start_phases, Phases}]}\&.
Value Default
----- -------
Application atom() -
Description string() ""
Id string() ""
Vsn string() ""
Modules [Module] []
MaxP int() infinity
MaxT int() infinity
Names [Name] []
Apps [App] []
Env [{Par,Val}] []
Start {Module,StartArgs} undefined
Phases [{Phase,PhaseArgs}] undefined
Module = Name = App = Par = Phase = atom()
Val = StartArgs = PhaseArgs = term()
.fi
.LP
\fIApplication\fR is the name of the application\&.
.LP
For the application controller, all keys are optional\&. The respective default values are used for any omitted keys\&.
.LP
The functions in \fIsystools\fR require more information\&. If they are used, the following keys are mandatory: \fIdescription\fR, \fIvsn\fR, \fImodules\fR, \fIregistered\fR and \fIapplications\fR\&. The other keys are ignored by \fIsystools\fR\&.
.RS 2
.TP 4
.B
\fIdescription\fR:
A one-line description of the application\&.
.TP 4
.B
\fIid\fR:
Product identification, or similar\&.
.TP 4
.B
\fIvsn\fR:
The version of the application\&.
.TP 4
.B
\fImodules\fR:
All modules introduced by this application\&. \fIsystools\fR uses this list when generating start scripts and tar files\&. A module can only be defined in one application\&.
.TP 4
.B
\fImaxP\fR:
\fIDeprecated - will be ignored\fR
.br
The maximum number of processes allowed in the application\&.
.TP 4
.B
\fImaxT\fR:
The maximum time in milliseconds that the application is allowed to run\&. After the specified time the application will automatically terminate\&.
.TP 4
.B
\fIregistered\fR:
All names of registered processes started in this application\&. \fIsystools\fR uses this list to detect name clashes between different applications\&.
.TP 4
.B
\fIincluded_applications\fR:
All applications which are included by this application\&. When this application is started, all included application will automatically be loaded, but not started, by the application controller\&. It is assumed that the topmost supervisor of the included application is started by a supervisor of this application\&.
.TP 4
.B
\fIapplications\fR:
All applications which must be started before this application is allowed to be started\&. \fIsystools\fR uses this list to generate correct start scripts\&. Defaults to the empty list, but note that all applications have dependencies to (at least) \fIkernel\fR and \fIstdlib\fR\&.
.TP 4
.B
\fIenv\fR:
Configuration parameters used by the application\&. The value of a configuration parameter is retrieved by calling \fIapplication:get_env/1, 2\fR\&. The values in the application resource file can be overridden by values in a configuration file (see \fIconfig(4)\fR) or by command line flags (see \fIerl(1)\fR)\&.
.TP 4
.B
\fImod\fR:
Specifies the application callback module and a start argument, see \fIapplication(3)\fR\&.
.RS 4
.LP
.LP
The \fImod\fR key is necessary for an application implemented as a supervision tree, or the application controller will not know how to start it\&. The \fImod\fR key can be omitted for applications without processes, typically code libraries such as the application STDLIB\&.
.RE
.TP 4
.B
\fIstart_phases\fR:
A list of start phases and corresponding start arguments for the application\&. If this key is present, the application master will - in addition to the usual call to \fIModule:start/2\fR - also call \fIModule:start_phase(Phase, Type, PhaseArgs)\fR for each start phase defined by the \fIstart_phases\fR key, and only after this extended start procedure will \fIapplication:start(Application)\fR return\&.
.RS 4
.LP
.LP
.LP
.LP
Start phases may be used to synchronize startup of an application and its included applications\&. In this case, the \fImod\fR key must be specified as:
.LP
.nf
{mod, {application_starter,[Module,StartArgs]}}
.fi
.LP
.LP
The application master will then call \fIModule:start/2\fR for the primary application, followed by calls to \fIModule:start_phase/3\fR for each start phase (as defined for the primary application) both for the primary application and for each of its included application, for which the start phase is defined\&.
.LP
.LP
.LP
.LP
This implies that for an included application, the set of start phases must be a subset of the set of phases defined for the primary application\&. Refer to \fIOTP Design Principles\fR for more information\&.
.RE
.RE
.SH SEE ALSO
.LP
application(3), systools(3)
|