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));
}
Aggregations