@@ -0,0 +1,2900 @@
+/*%0A * Copyright 2015 JBoss Inc%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *%0A */%0A%0Apackage org.kie.internal.conf;%0A%0Aimport org.kie.api.conf.SingleValueKieBaseOption;%0A%0A/**%0A * An option to define after how many evaluations in interpreted mode (with mvel)%0A * a constraint should be jitted (translated in bytecode)%0A */%0Apublic class ConstraintJittingThresholdOption implements SingleValueKieBaseOption %7B%0A%0A    private static final long serialVersionUID = 510l;%0A%0A    /**%0A     * The property name for the constraint jitting option%0A     */%0A    public static final String PROPERTY_NAME = %22drools.jittingThreshold%22;%0A%0A    /**%0A     * The defualt value for this option%0A     */%0A    public static final int DEFAULT_VALUE = 20;%0A%0A    /**%0A     * The number of evaluations in interpreted mode after which a%0A     * constraint has to be jitted%0A     */%0A    private final int threshold;%0A%0A    /**%0A     * Private constructor to enforce the use of the factory method%0A     * @param threshold%0A     */%0A    private ConstraintJittingThresholdOption( int threshold ) %7B%0A        this.threshold = threshold;%0A    %7D%0A%0A    /**%0A     * This is a factory method for this Constraint Jitting Threshold configuration.%0A     * The factory method is a best practice for the case where the%0A     * actual object construction is changed in the future.%0A     *%0A     * @param threshold the threshold value for the Constraint Jitting option%0A     *%0A     * @return the actual type safe Constraint Jitting threshold configuration.%0A     */%0A    public static ConstraintJittingThresholdOption get( int threshold ) %7B%0A        return new ConstraintJittingThresholdOption( threshold );%0A    %7D%0A%0A    /**%0A     * %7B@inheritDoc%7D%0A     */%0A    public String getPropertyName() %7B%0A        return PROPERTY_NAME;%0A    %7D%0A%0A    /**%0A     * Returns the threshold value for PermGen%0A     *%0A     * @return%0A     */%0A    public int getThreshold() %7B%0A        return threshold;%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        final int prime = 31;%0A        int result = 1;%0A        result = prime * result + threshold;%0A        return result;%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object obj) %7B%0A        if ( this == obj ) return true;%0A        if ( obj == null ) return false;%0A        if ( getClass() != obj.getClass() ) return false;%0A        ConstraintJittingThresholdOption other = (ConstraintJittingThresholdOption) obj;%0A        if ( threshold != other.threshold ) return false;%0A        return true;%0A    %7D%0A%7D%0A

add option to configure and disable constraints jitting