View Javadoc

1   /*$Id: ToolListFromConfig.java,v 1.5 2004/07/01 21:15:00 nw Exp $
2    * Created on 07-Mar-2004
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
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  $Log: ToolListFromConfig.java,v $
50  Revision 1.5  2004/07/01 21:15:00  nw
51  added results-listener interface to jes
52  
53  Revision 1.4  2004/03/15 23:45:07  nw
54  improved javadoc
55  
56  Revision 1.3  2004/03/15 01:30:06  nw
57  factored component descriptor out into separate package
58  
59  Revision 1.2  2004/03/07 21:04:38  nw
60  merged in nww-itn05-pico - adds picocontainer
61  
62  Revision 1.1.2.1  2004/03/07 20:39:26  nw
63  added implementation of a self-configuring production set of component
64   
65  */