Package org.apache.camel.model

Examples of org.apache.camel.model.SamplingDefinition


    }

    @SuppressWarnings("rawtypes")
    @Override
    public ProcessorDefinition createCamelDefinition() {
        SamplingDefinition answer = new SamplingDefinition();

        answer.setInheritErrorHandler(toXmlPropertyValue(PROPERTY_INHERITERRORHANDLER, Objects.<Boolean>getField(this, "inheritErrorHandler")));
        answer.setSamplePeriod(toXmlPropertyValue(PROPERTY_SAMPLEPERIOD, this.getSamplePeriod()));
        answer.setMessageFrequency(toXmlPropertyValue(PROPERTY_MESSAGEFREQUENCY, this.getMessageFrequency()));
        answer.setUnits(toXmlPropertyValue(PROPERTY_UNITS, this.getUnits()));

        super.savePropertiesToCamelDefinition(answer);
        return answer;
    }
View Full Code Here


    @Override
    protected void loadPropertiesFromCamelDefinition(ProcessorDefinition processor) {
        super.loadPropertiesFromCamelDefinition(processor);

        if (processor instanceof SamplingDefinition) {
            SamplingDefinition node = (SamplingDefinition) processor;

            this.setInheritErrorHandler(Objects.<Boolean>getField(node, "inheritErrorHandler"));
            this.setSamplePeriod(node.getSamplePeriod());
            this.setMessageFrequency(node.getMessageFrequency());
            this.setUnits(node.getUnits());
        } else {
            throw new IllegalArgumentException("ProcessorDefinition not an instanceof SamplingDefinition. Was " + processor.getClass().getName());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.model.SamplingDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.