Application Life Cycle
As an application manager, Pandora.js can manage application's life cycle at 5 stages:
- Representation Stage
- Initialization Stage
- Injection Stage
- Launch Stage
- Shutdown Stage
Representation Stage - procfile.js
procfile.js to define the application.
Pandora.js can deploy multiple applications at the same time. By feeding the application root directory, Pandora.js would do some initialization works for the application, such as collecting meta information, initializing resource loader and context, etc.
There are several ways to do the injection:
- Using global variable
- Using the description file
Entities can be injected are listed as below:
- Process：inject process definition.
- Service：pandora.js managed services, whose lifecycle are managed by application manager.
- Environment：environment object.
Create application context and start applications, invoke the
start() method of services, such as HTTP service, etc.
Shut down the application as well as services via invoking
stop() method. Daemon will wait at most 5 seconds for applications to exit gracefully.