if(!instance.isRunning())
return null;
try {
logger.info(Strings.get("stop.instance.init", instanceName));
RemoteRestAdminCommand rac = new ServerRemoteRestAdminCommand(habitat, "_stop-instance",
host, port, false, "admin", null, logger);
// notice how we do NOT send in the instance's name as an operand!!
ParameterMap map = new ParameterMap();
map.add("force", Boolean.toString(force));
rac.executeCommand(map);
} catch (Exception e) {
// The instance server may have died so fast we didn't have time to
// get the (always successful!!) return data. This is NOT AN ERROR!
// see: http://java.net/jira/browse/GLASSFISH-19672
// also see StopDomainCommand which does the same thing.