Search in sources :

Example 1 with ApplicationPassivationThread

use of org.qi4j.api.activation.ApplicationPassivationThread in project qi4j-sdk by Qi4j.

the class ApplicationBuilder method main.

/**
     * {@literal main} method that read JSON from STDIN.
     * <p>Passivation exceptions are written to STDERR if any.</p>
     * @param args Unused
     * @throws JSONException if unable to read JSON
     * @throws AssemblyException if the assembly failed
     * @throws ActivationException if the activation failed
     */
public static void main(String[] args) throws JSONException, ActivationException, AssemblyException {
    ApplicationBuilder builder = fromJson(System.in);
    Application application = builder.newApplication();
    Runtime.getRuntime().addShutdownHook(new ApplicationPassivationThread(application, System.err));
}
Also used : Application(org.qi4j.api.structure.Application) ApplicationPassivationThread(org.qi4j.api.activation.ApplicationPassivationThread)

Aggregations

ApplicationPassivationThread (org.qi4j.api.activation.ApplicationPassivationThread)1 Application (org.qi4j.api.structure.Application)1