1 | package de.uka.ipd.sdq.simucomframework.usage; |
2 | |
3 | import de.uka.ipd.sdq.simucomframework.model.SimuComModel; |
4 | |
5 | /** |
6 | * Factory to create closed workload users |
7 | * |
8 | * @author Steffen Becker |
9 | * |
10 | */ |
11 | public abstract class ClosedWorkloadUserFactory implements IUserFactory { |
12 | |
13 | private String thinkTime; |
14 | private SimuComModel model; |
15 | |
16 | public ClosedWorkloadUserFactory(SimuComModel model, String thinkTimeSpec) { |
17 | this.thinkTime = thinkTimeSpec; |
18 | this.model = model; |
19 | } |
20 | |
21 | /* |
22 | * (non-Javadoc) |
23 | * |
24 | * @see de.uka.ipd.sdq.simucomframework.usage.IUserFactory#createUser() |
25 | */ |
26 | public IUser createUser(final String usageScenarioId) { |
27 | IScenarioRunner scenarioRunner = this.createScenarioRunner(); |
28 | return new ClosedWorkloadUser(model, "ClosedUser", scenarioRunner, |
29 | thinkTime, usageScenarioId); |
30 | } |
31 | |
32 | /** |
33 | * Template method filled by the generator. Returns the users behaviour. |
34 | * |
35 | * @return The behaviour of the users created by this factory |
36 | */ |
37 | public abstract IScenarioRunner createScenarioRunner(); |
38 | |
39 | } |