View Javadoc

1   /*$Id: BaseDirectoryFromConfig.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.impl.workflow.FileJobFactoryImpl.BaseDirectory;
16  
17  import java.io.File;
18  
19  /*** Configuration object for {@link org.astrogrid.jes.impl.workflow.FileJobFactoryImpl}
20   * <p>
21   * 
22   * @author Noel Winstanley nw@jb.man.ac.uk 07-Mar-2004
23   */
24  public class BaseDirectoryFromConfig extends SimpleComponentDescriptor implements BaseDirectory {
25      /*** key to look in config for base directory */
26      public static final String BASE_DIR_KEY = "jes.jobfactory.file.basedir";
27       public BaseDirectoryFromConfig(Config conf) {
28           String fileLoc = conf.getString(BASE_DIR_KEY,System.getProperty("java.io.tmpdir"));
29           baseDir = new File(fileLoc);
30           name = "FileJobFactory - Base Directory configuration";
31          description = "Loads base-directory configuration parameter for FileJobFactory from Config\n" +
32              "key :" + BASE_DIR_KEY
33              + "\n current value:" + baseDir.getAbsolutePath();
34       }
35       private final File baseDir;
36      /***
37       * @see org.astrogrid.jes.impl.workflow.FileJobFactoryImpl.BaseDirectory#getDir()
38       */
39      public File getDir() {
40          return baseDir;
41      }
42  
43  }
44  
45  
46  /* 
47  $Log: BaseDirectoryFromConfig.java,v $
48  Revision 1.5  2004/07/01 21:15:00  nw
49  added results-listener interface to jes
50  
51  Revision 1.4  2004/03/15 23:45:07  nw
52  improved javadoc
53  
54  Revision 1.3  2004/03/15 01:30:06  nw
55  factored component descriptor out into separate package
56  
57  Revision 1.2  2004/03/07 21:04:38  nw
58  merged in nww-itn05-pico - adds picocontainer
59  
60  Revision 1.1.2.1  2004/03/07 20:39:26  nw
61  added implementation of a self-configuring production set of component
62   
63  */