class BoundedTimeConstraint extends TimeConstraint {

    public static synchronized BoundedTimeConstraint getTimeConstraint(Object key, TimeSpan timeSpan, Duration minDuration,
            Duration maxDuration)
    {
        long minTime = timeSpan.isUnboundedStart() ? Long.MIN_VALUE : timeSpan.getStart();
        long maxTime = timeSpan.isUnboundedEnd() ? Long.MAX_VALUE : timeSpan.getEnd();
        int minDurationSeconds = minDuration == null ? 0 : new Seconds(minDuration).intValue();
        int maxDurationSeconds = maxDuration == null ? Integer.MAX_VALUE : new Seconds(maxDuration).intValue();
        return (BoundedTimeConstraint)getPool()
                .get(new BoundedTimeConstraint(key, minTime, maxTime, minDurationSeconds, maxDurationSeconds));
    }

    protected  BoundedTimeConstraint(Object key, long minTime, long maxTime, int minDurationSeconds, int maxDurationSeconds);

}