1 26 27 package org.objectweb.jonas.ant.cluster; 28 29 30 import java.io.File ; 31 import java.util.Iterator ; 32 33 import org.objectweb.jonas.ant.jonasbase.BaseTaskItf; 34 import org.objectweb.jonas.ant.jonasbase.Jms; 35 36 40 public class JmsCluster extends ClusterTasks { 41 42 45 private static final String INFO = "[JmsCluster] "; 46 47 50 private String [] portRange = null; 51 52 55 private String initialTopics = null; 56 57 60 private String initialQueues = null; 61 62 65 public JmsCluster() { 66 super(); 67 } 68 69 73 public void setPortRange(String portRange) { 74 this.portRange = portRange.split(","); 75 76 } 77 78 82 public void setInitialTopics(String initialTopics) { 83 this.initialTopics = initialTopics; 84 } 85 86 90 public void setInitialQueues(String initialQueues) { 91 this.initialQueues = initialQueues; 92 } 93 94 97 public void generatesTasks() { 98 99 int portInd = 0; 100 101 for (int i = getDestDirSuffixIndFirst(); i <= getDestDirSuffixIndLast(); i++) { 102 103 String destDir = getDestDir(getDestDirPrefix(), i); 104 log(INFO + "tasks generation for " + destDir); 105 Jms jms = new Jms(); 107 108 jms.setPort(portRange[portInd]); 109 jms.setInitialQueues(initialQueues); 110 jms.setInitialTopics(initialTopics); 111 112 for (Iterator it = jms.getTasks().iterator(); it.hasNext();) { 114 BaseTaskItf task = (BaseTaskItf) it.next(); 115 task.setDestDir(new File (destDir)); 116 } 117 118 addTasks(jms); 119 120 portInd++; 121 122 } 123 } 124 } | Popular Tags |