01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18:
19: package org.apache.jmeter.control;
20:
21: import org.apache.jmeter.engine.event.LoopIterationListener;
22: import org.apache.jmeter.samplers.Sampler;
23: import org.apache.jmeter.testelement.TestElement;
24:
25: /**
26: * This interface will typically be used in the following manner:
27: *
28: * Controller controller; //gets initialized while(!controller.isDone() &&
29: * controller.hasNext()) { Sampler sampler = controller.next(); return sampler; }
30: *
31: * @author Michael Stover
32: * @author Thad Smith
33: * @version $Revision: 493779 $
34: */
35: public interface Controller extends TestElement {
36: /**
37: * Delivers the next Sampler.
38: *
39: * @return org.apache.jmeter.samplers.Sampler
40: */
41: public Sampler next();
42:
43: /**
44: * Indicates whether the Controller is done delivering Samplers for the rest
45: * of the test.
46: *
47: * @return boolean
48: */
49: public boolean isDone();
50:
51: /**
52: * Controllers have to notify listeners of when they begin an iteration
53: * through their sub-elements.
54: */
55: public void addIterationListener(LoopIterationListener listener);
56:
57: /**
58: * Called to initialize a controller at the beginning of a test iteration.
59: */
60: public void initialize();
61: }
|