View Javadoc
1   /*
2    * $Header: /cvsroot/sinon/sinon/src/java/eteg/sinon/executor/ThinkTime.java,v 1.2 2005/06/21 14:25:08 thiagohp Exp $
3    * $Revision: 1.2 $
4    * $Date: 2005/06/21 14:25:08 $
5    * $Author: thiagohp $
6    *
7    * =============================================================================
8    *
9    * Copyright 2004-2005 Eteg Internet Ltda. (http://www.eteg.com.br)
10   *
11   * Licensed under the Apache License, Version 2.0 (the "License");
12   * you may not use this file except in compliance with the License.
13   * You may obtain a copy of the License at
14   *
15   *     http://www.apache.org/licenses/LICENSE-2.0
16   *
17   * Unless required by applicable law or agreed to in writing, software
18   * distributed under the License is distributed on an "AS IS" BASIS,
19   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   * See the License for the specific language governing permissions and
21   * limitations under the License.
22   */
23  package eteg.sinon.executor;
24  
25  import eteg.sinon.exception.InvalidThinkTimeConfigurationException;
26  
27  import java.util.Properties;
28  
29  /***
30   * Instances of this interface implement the think time (time between requests
31   * to the same website). They are configured through the use of
32   * <code>&lt;property name="" value=""&gt;</code> tags inside the
33   * <code>&lt;thinkTime&gt;</code> tag.
34   *
35   * @author <a href="mailto:thiagohp at users.sourceforge.net">Thiago H. de Paula Figueiredo</a>
36   * @author Last modified by $Author: thiagohp $
37   * @version $Revision: 1.2 $
38   */
39  public interface ThinkTime {
40  
41      /***
42       * Returns the think time, in milliseconds, between the last request
43       * made and the next one.
44       *
45       * @return a <code>long</code>.
46       */
47      public long nextThinkTime();
48  
49      /***
50       * Configures this {@link ThinkTime} object. This method is always
51       * invoked before {@link #nextThinkTime} is first invoked.
52       *
53       * @param properties a <code>Properties</code> instance.
54       * @throws InvalidThinkTimeConfigurationException if the given configuration
55       * is not valid.
56       */
57      public void setConfiguration(Properties properties)
58              throws InvalidThinkTimeConfigurationException;
59  
60  }