public static void addThreshold ( String name , String producerName , String statName , String valueName , String intervalName , ThresholdConditionGuard ... guards ) { ThresholdDefinition definition = new ThresholdDefinition ( ) ; definition . setName ( name ) ; definition . setProducerName ( producerName ) ; definition . setStatName ( statName ) ; definition . setValueName ( valueName ) ; definition . setIntervalName ( intervalName ) ; Threshold threshold = ThresholdRepository . getInstance ( ) . createThreshold ( definition ) ; if ( guards != null ) { for ( ThresholdConditionGuard g : guards ) { threshold . addGuard ( g ) ; } } }
Creates a new Threshold and adds it to repository .