OperationDefinitionParametersUIBean operationParametersUIBean = FacesContextUtility
.getBean(OperationDefinitionParametersUIBean.class);
Configuration configuration = operationParametersUIBean.getConfiguration();
OperationDefinitionUIBean operationDefUIBean;
if (this instanceof ResourceOperationScheduleUIBean) {
operationDefUIBean = FacesContextUtility.getBean(ResourceOperationDefinitionUIBean.class);
} else if (this instanceof ResourceGroupOperationScheduleUIBean) {
operationDefUIBean = FacesContextUtility.getBean(ResourceGroupOperationDefinitionUIBean.class);
} else {
throw new IllegalStateException("Unsupported class - this is a bug, please report it: "
+ this.getClass().toString());
}
// if the user selected a timeout, add it to our configuration
String timeout = operationDefUIBean.getTimeout();
if (!timeout.trim().equals("")) {
Integer.parseInt(timeout); // see if it fails, to return back to the UI
if (configuration == null) {
configuration = new Configuration();
}
configuration.put(new PropertySimple(OperationDefinition.TIMEOUT_PARAM_NAME, timeout));
}
String operationName = operationDefUIBean.getName();
String description = operationDefUIBean.getDescription();
scheduleOperation(subject, operationName, configuration, simpleTrigger, description);
} catch (Exception e) {
FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR,
"There was an error scheduling your operation: " + e.getMessage());