1 18 19 package org.apache.jmeter.protocol.http.modifier; 20 21 import java.io.Serializable ; 22 import java.util.HashMap ; 23 import java.util.Iterator ; 24 import java.util.List ; 25 import java.util.Map ; 26 27 import org.apache.jorphan.logging.LoggingManager; 28 import org.apache.log.Logger; 29 30 37 public class UserSequence implements Serializable 38 { 39 transient private static Logger log = LoggingManager.getLoggerForClass(); 40 41 private List allUsers; 45 private Iterator indexOfUsers; 46 47 51 public UserSequence() 52 { 53 } 54 55 61 public UserSequence(List allUsers) 62 { 63 this.allUsers = allUsers; 64 65 indexOfUsers = allUsers.iterator(); 67 } 68 69 73 78 public synchronized Map getNextUserMods() 79 { 80 if (!indexOfUsers.hasNext()) 82 { 83 indexOfUsers = allUsers.iterator(); 84 } 85 86 Map user; 87 if (indexOfUsers.hasNext()) 88 { 89 user = (Map ) indexOfUsers.next(); 90 log.debug( 91 "UserSequence.getNextuserMods(): current parameters will be " 92 + "changed to: " 93 + user); 94 } 95 else 96 { 97 user = new HashMap (); 99 } 100 101 return user; 102 } 103 } 104 | Popular Tags |