if (quickSession) {
strings.add("-Dopenejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager");
}
System.setProperty("server.shutdown.port", Integer.toString(tomeeShutdownPort));
final RemoteServer server = new RemoteServer(getConnectAttempts(), false);
addShutdownHooks(server); // some shutdown hooks are always added (see UpdatableTomEEMojo)
if (getNoShutdownHook()) {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
server.stop();
}
});
}
getLog().info("Running '" + getClass().getSimpleName().replace("TomEEMojo", "").toLowerCase(Locale.ENGLISH)
+ "'. Configured TomEE in plugin is " + tomeeHost + ":" + tomeeHttpPort
+ " (plugin shutdown port is " + tomeeShutdownPort + ")");
serverCmd(server, strings);
if (!getNoShutdownHook()) {
try {
server.getServer().waitFor(); // connect attempts = 0
} catch (InterruptedException e) {
// ignored
}
}
}