@Override public boolean evaluate(Host obj) { if (!host.getState().equals(HostConstants.STATE_PROVISIONING)) { throw new ResourceTimeoutException(host, "provisioning canceled"); } return obj.getAgentId() != null; }
protected Long getInstanceIdFromThrowable(Throwable t) { Object obj = null; if (t instanceof InstanceException) { obj = ((InstanceException) t).getInstance(); } if (t instanceof ResourceTimeoutException) { obj = ((ResourceTimeoutException) t).getResource(); } if (obj instanceof Instance) { return ((Instance) obj).getId(); } return null; }
} catch (ResourceTimeoutException rte) { objectProcessManager.scheduleStandardProcess(StandardProcess.ERROR, host, null); ExecutionException e = new ExecutionException(rte.getMessage()); e.setResources(host); throw e;
throw new ResourceTimeoutException(obj, "Waiting: " + predicate.getMessage() + " [" + printKey + "]");
@Override public boolean evaluate(final PhysicalHost obj) { boolean transitioning = objectMetaDataManager.isTransitioningState(obj.getClass(), obj.getState()); if (!transitioning) { return true; } objectManager.reload(host); if (!host.getState().equals(HostConstants.STATE_PROVISIONING)) { throw new ResourceTimeoutException(host, "provisioning canceled"); } String message = TransitioningUtils.getTransitioningMessage(obj); objectManager.setFields(host, ObjectMetaDataManager.TRANSITIONING_MESSAGE_FIELD, message); DeferredUtils.nest(new Runnable() { @Override public void run() { ObjectUtils.publishChanged(eventService, objectManager, host); } }); return false; }
int count = incrementDepTry(state); if (serviceDao.isServiceInstance(instance) && count < 10) { throw new ResourceTimeoutException(instance, e.getMessage());