1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.jes.component.production;
12
13 import org.astrogrid.component.descriptor.SimpleComponentDescriptor;
14 import org.astrogrid.config.Config;
15 import org.astrogrid.jes.jobscheduler.locator.XMLFileLocator.ToolList;
16
17 import java.net.URL;
18
19 /*** Configuration object for {@link org.astrogrid.jes.jobscheduler.locator.XMLFileLocator}
20 * @author Noel Winstanley nw@jb.man.ac.uk 07-Mar-2004
21 */
22 public class ToolListFromConfig extends SimpleComponentDescriptor implements ToolList {
23 /*** key to look in config for url of tools document */
24 public static final String XML_LOCATOR_URL = "jes.locator.xml.url";
25 /***
26 * Default location to load tool list from
27 * @todo change this location */
28 public static final String DEFAULT_XML_LOCATOR_URL = "/org/astrogrid/jes/jobscheduler/locator/tools.xml";
29 public ToolListFromConfig(Config conf) {
30 url = conf.getUrl(XML_LOCATOR_URL,this.getClass().getResource(DEFAULT_XML_LOCATOR_URL));
31 name = "get url for xml tool list from config";
32 description = "Loads url of tool list document from Config\n" +
33 "key :" + XML_LOCATOR_URL
34 + "\n default value: " + DEFAULT_XML_LOCATOR_URL + " on classpath"
35 + "\n current value:" + url.toString();
36
37 }
38
39 protected final URL url;
40
41
42 public URL getURL() {
43 return url;
44 }
45 }
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65