1 28 29 package com.caucho.make; 30 31 import java.util.ArrayList ; 32 33 36 public class MakeContainer implements Make { 37 private ArrayList <Make> _makeList = new ArrayList <Make>(); 38 39 42 public void add(Make make) 43 { 44 if (make == this) 45 throw new IllegalArgumentException ("Can't add self as a dependency."); 46 47 int p = _makeList.indexOf(make); 48 49 if (p >= 0) { 52 Make oldMake = _makeList.get(p); 53 54 if (oldMake != make) 55 _makeList.add(p, make); 56 } 57 else 58 _makeList.add(make); 59 } 60 61 64 public synchronized void make() 65 throws Exception 66 { 67 for (int i = 0; i < _makeList.size(); i++) { 68 Make make = _makeList.get(i); 69 70 make.make(); 71 } 72 } 73 74 public String toString() 75 { 76 return "MakeContainer" + _makeList; 77 } 78 } 79 | Popular Tags |