@Override public void restart() { if (((SoftwareProcessImpl)entity()).getDriver() == null) { log.debug("restart of "+entity()+" has no driver - doing machine-level restart"); super.restart(); return; } if (Strings.isEmpty(entity().getAttribute(Attributes.HOSTNAME))) { log.debug("restart of "+entity()+" has no hostname - doing machine-level restart"); super.restart(); return; } log.debug("restart of "+entity()+" appears to have driver and hostname - doing driver-level restart"); ((SoftwareProcessImpl)entity()).getDriver().restart(); DynamicTasks.queue("post-restart", new Runnable() { public void run() { postStartCustom(); if (entity().getAttribute(Attributes.SERVICE_STATE) == Lifecycle.STARTING) entity().setAttribute(Attributes.SERVICE_STATE, Lifecycle.RUNNING); }}); }