1 26 27 package org.objectweb.jonas.ant.cluster; 28 29 import java.io.File ; 30 import java.util.Iterator ; 31 32 import org.objectweb.jonas.ant.jonasbase.BaseTaskItf; 33 import org.objectweb.jonas.ant.jonasbase.Carol; 34 35 39 public class CarolCluster extends ClusterTasks { 40 41 44 private static final String INFO = "[CarolCluster] "; 45 46 49 private String [] portRange = null; 50 51 54 private String protocols = null; 55 56 59 private String mcastAddr = null; 60 61 64 private boolean jrmpOptimization = false; 65 66 69 public CarolCluster() { 70 super(); 71 } 72 73 77 public void setProtocols(String protocols) { 78 this.protocols = protocols; 79 } 80 81 85 public void setMcastAddr(String mcastAddr) { 86 this.mcastAddr = mcastAddr; 87 } 88 89 93 public void setPortRange(String portRange) { 94 this.portRange = portRange.split(","); 95 96 } 97 98 102 public void setJrmpOptimization(boolean jrmpOptimization) { 103 this.jrmpOptimization = jrmpOptimization; 104 105 } 106 107 110 public void generatesTasks() { 111 112 int portInd = 0; 113 114 for (int i = getDestDirSuffixIndFirst(); i <= getDestDirSuffixIndLast(); i++) { 115 116 String destDir = getDestDir(getDestDirPrefix(), i); 117 118 Carol carol = new Carol(); 120 log(INFO + "tasks generation for " + destDir); 121 carol.setDefaultPort(portRange[portInd]); 122 carol.setProtocols(protocols); 123 carol.setCmiMcastAddr(mcastAddr); 124 carol.setJrmpOptimization(jrmpOptimization); 125 126 for (Iterator it = carol.getTasks().iterator(); it.hasNext();) { 128 BaseTaskItf task = (BaseTaskItf) it.next(); 129 task.setDestDir(new File (destDir)); 130 } 131 132 addTasks(carol); 133 134 portInd++; 135 136 } 137 } 138 } | Popular Tags |