policy.setDescription(descriptionEle.getText());
}
//LoadThresholds
OMElement loadThresholdsEle = docEle.getFirstChildWithName(new QName("loadThresholds"));
LoadThresholds loadThresholds = new LoadThresholds();
//RequestsInFlight
OMElement reqInFlightEle = loadThresholdsEle.getFirstChildWithName(new QName("requestsInFlight"));
RequestsInFlight reqInFlight = new RequestsInFlight();
reqInFlight.setAverage(Float.valueOf(readValueAttr(reqInFlightEle,"average")));
reqInFlight.setGradient(Float.valueOf(readValueAttr(reqInFlightEle,"gradient")));
reqInFlight.setSecondDerivative(Float.valueOf(readValueAttr(reqInFlightEle,"secondDerivative")));
reqInFlight.setScaleDownMarginOfGradient(Float.valueOf(readValueAttr(reqInFlightEle,"scaleDownMarginOfGradient")));
reqInFlight.setScaleDownMarginOfSecondDerivative(Float.valueOf(readValueAttr(reqInFlightEle,"scaleDownMarginOfSecondDerivative")));
loadThresholds.setRequestsInFlight(reqInFlight);
//MemoryConsumption
OMElement memConsumptionEle = loadThresholdsEle.getFirstChildWithName(new QName("memoryConsumption"));
MemoryConsumption memConsumption = new MemoryConsumption();
memConsumption.setAverage(Float.valueOf(readValueAttr(memConsumptionEle,"average")));
memConsumption.setGradient(Float.valueOf(readValueAttr(memConsumptionEle,"gradient")));
memConsumption.setSecondDerivative(Float.valueOf(readValueAttr(memConsumptionEle,"secondDerivative")));
memConsumption.setScaleDownMarginOfGradient(Float.valueOf(readValueAttr(memConsumptionEle,"scaleDownMarginOfGradient")));
memConsumption.setScaleDownMarginOfSecondDerivative(Float.valueOf(readValueAttr(memConsumptionEle,"scaleDownMarginOfSecondDerivative")));
loadThresholds.setMemoryConsumption(memConsumption);
//LoadAverage
OMElement loadAvrEle = loadThresholdsEle.getFirstChildWithName(new QName("loadAverage"));
LoadAverage loadAvr = new LoadAverage();
loadAvr.setAverage(Float.valueOf(readValueAttr(loadAvrEle,"average")));
loadAvr.setGradient(Float.valueOf(readValueAttr(loadAvrEle,"gradient")));
loadAvr.setSecondDerivative(Float.valueOf(readValueAttr(loadAvrEle,"secondDerivative")));
loadAvr.setScaleDownMarginOfGradient(Float.valueOf(readValueAttr(loadAvrEle,"scaleDownMarginOfGradient")));
loadAvr.setScaleDownMarginOfSecondDerivative(Float.valueOf(readValueAttr(loadAvrEle,"scaleDownMarginOfSecondDerivative")));
loadThresholds.setLoadAverage(loadAvr);
policy.setLoadThresholds(loadThresholds);
} else{
throw new DeploymentException("File is not a valid autoscale policy");