use of org.glassfish.internal.api.InternalSystemAdministrator in project Payara by payara.
the class AppServerStartup method shutdown.
// TODO(Sahoo): Revisit this method after discussing with Jerome.
private void shutdown() {
CommandRunner runner = commandRunnerProvider.get();
if (runner != null) {
final ParameterMap params = new ParameterMap();
// By default we don't want to shutdown forcefully, as that will cause the VM to exit and that's not
// a very good behavior for a code known to be embedded in other processes.
final boolean noForcedShutdown = Boolean.parseBoolean(context.getArguments().getProperty(com.sun.enterprise.glassfish.bootstrap.Constants.NO_FORCED_SHUTDOWN, "true"));
if (noForcedShutdown) {
params.set("force", "false");
}
final InternalSystemAdministrator kernelIdentity = locator.getService(InternalSystemAdministrator.class);
if (env.isDas()) {
runner.getCommandInvocation("stop-domain", new DoNothingActionReporter(), kernelIdentity.getSubject()).parameters(params).execute();
} else {
runner.getCommandInvocation("_stop-instance", new DoNothingActionReporter(), kernelIdentity.getSubject()).parameters(params).execute();
}
}
}
Aggregations