@Override
protected int executeCommand() throws CommandException {
try {
final Service service = ServiceFactory.getService(dirs, getType());
PlatformServicesInfo info = service.getInfo();
info.setTrace(logger.isLoggable(Level.FINER));
info.setDryRun(dry_run);
info.setForce(force);
info.setAppServerUser(getProgramOptions().getUser());
if (ok(serviceName))
info.setServiceName(serviceName);
if (ok(serviceUser))
info.setServiceUser(serviceUser);
if (programOpts.getPasswordFile() != null)
info.setPasswordFile(SmartFile.sanitize(
new File(programOpts.getPasswordFile())));
service.setServiceProperties(serviceProperties);
service.createService();