1/******************************************************************************* 2 * Copyright (c) 2000, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11/* 12 * Created on 8-Jan-2004 13 * 14 * To change this generated comment go to 15 * Window>Preferences>Java>Code Generation>Code Template 16 */ 17package org.eclipse.releng; 18 19import org.apache.tools.ant.Task; 20import org.apache.tools.ant.BuildException; 21/** 22 * @author SDimitrov 23 * 24 * To change this generated comment go to 25 * Window>Preferences>Java>Code Generation>Code Template 26 */ 27public class FindMachineTask extends Task { 28 29 // findKey represents the key in cfg from which which to obtain the list of machines 30 // createKey is written to the registry with the machine name that is available 31 //registry mapping of machines being used by a given build 32 private String markerContainer; 33 34//time in seconds to wait before re-checking for an available machine 35 private int waitInterval; 36 private String markerName; 37 private String markerKey="0"; 38//list is the path to the configuration of build machines available for a given build type 39 private String cfgKey; 40 private String cfg; 41 42 /** 43 * 44 */ 45 public static void main(String args[]){ 46 FindMachineTask test = new FindMachineTask(); 47 test.markerContainer = "D:\\junk\\markers"; 48 test.cfg="D:\\workspaces\\current\\eclipseInternalBuildTools\\testConfig.properties"; 49 test.cfgKey="windowstesting"; 50 test.markerName = "200412091500"; 51 test.waitInterval = 10; 52 test.execute(); 53 } 54 public FindMachineTask() { 55 super(); 56 } 57 public void execute() throws BuildException { 58 new BuildMachineManager(cfg,markerContainer,waitInterval,markerName,markerKey,cfgKey); 59 } 60 /** 61 * @return Returns the cfg. 62 */ 63 public String getCfg() { 64 return cfg; 65 } 66 67 /** 68 * @param cfg The cfg to set. 69 */ 70 public void setCfg(String cfg) { 71 this.cfg = cfg; 72 } 73 74 /** 75 * @return Returns the createKey. 76 */ 77 public String getMarkerName() { 78 return markerName; 79 } 80 81 /** 82 * @param createKey The createKey to set. 83 */ 84 public void setMarkerName(String markerName) { 85 this.markerName = markerName; 86 } 87 88/** 89 * @return Returns the findKey. 90 */ 91public String getCfgKey() { 92 return cfgKey; 93} 94 95/** 96 * @param findKey The findKey to set. 97 */ 98public void setCfgKey(String cfgKey) { 99 this.cfgKey = cfgKey; 100} 101 102 /** 103 * @return Returns the registry. 104 */ 105 public String getMarkerContainer() { 106 return markerContainer; 107 } 108 109 /** 110 * @param registry The registry to set. 111 */ 112 public void setMarkerContainer(String markerContainer) { 113 this.markerContainer = markerContainer; 114 } 115 116/** 117 * @return Returns the waitInterval. 118 */ 119public int getWaitInterval() { 120 return waitInterval; 121} 122 123/** 124 * @param waitInterval The waitInterval to set. 125 */ 126public void setWaitInterval(int waitInterval) { 127 this.waitInterval = waitInterval; 128} 129 130 /** 131 * @return Returns the markerKey. 132 */ 133 public String getMarkerKey() { 134 return markerKey; 135 } 136 137 /** 138 * @param markerKey The markerKey to set. 139 */ 140 public void setMarkerKey(String markerKey) { 141 this.markerKey = markerKey; 142 } 143 144} 145