Example #1
0
 @SuppressWarnings("rawtypes")
 @Override
 public ProcessorDefinition createCamelDefinition() {
   DelayDefinition answer = new DelayDefinition();
   answer.setExpression(toXmlPropertyValue(PROPERTY_EXPRESSION, this.getExpression()));
   answer.setExecutorServiceRef(
       toXmlPropertyValue(PROPERTY_EXECUTORSERVICEREF, this.getExecutorServiceRef()));
   answer.setAsyncDelayed(toXmlPropertyValue(PROPERTY_ASYNCDELAYED, this.getAsyncDelayed()));
   answer.setCallerRunsWhenRejected(
       toXmlPropertyValue(PROPERTY_CALLERRUNSWHENREJECTED, this.getCallerRunsWhenRejected()));
   super.savePropertiesToCamelDefinition(answer);
   return answer;
 }
Example #2
0
  @SuppressWarnings("rawtypes")
  @Override
  protected void loadPropertiesFromCamelDefinition(ProcessorDefinition processor) {
    super.loadPropertiesFromCamelDefinition(processor);

    if (processor instanceof DelayDefinition) {
      DelayDefinition node = (DelayDefinition) processor;
      this.setExpression(node.getExpression());
      this.setExecutorServiceRef(node.getExecutorServiceRef());
      this.setAsyncDelayed(node.getAsyncDelayed());
      this.setCallerRunsWhenRejected(node.getCallerRunsWhenRejected());
    } else {
      throw new IllegalArgumentException(
          "ProcessorDefinition not an instanceof DelayDefinition. Was "
              + processor.getClass().getName());
    }
  }