* Execute the Mojo by launching the email servers and waiting for the stop
* command. If the server daemon option is set the email servers are spun
* off in a background thread.
*/
public void execute() {
final Monitor monitor = new Monitor(getMonitorKey(), getMonitorPort());
final MailServer server = createServer();
if (server != null) {
server.setPortOffset(portOffset);
server.setUseSSL(useSSL);
server.start(this);
if (daemon) {
new Thread(new Runnable() {
public void run() {
monitor.runMonitor(server, RunMojo.this);
}
}).start();
} else {
monitor.runMonitor(server, this);
}
}
}