| Summary: | Allow classpath override in org.globus.bootstrap.Bootstrap | ||
|---|---|---|---|
| Product: | Java WS Core | Reporter: | Brian Watt <bwatt@us.ibm.com> |
| Component: | globus_wsrf_core | Assignee: | Rachana Ananthakrishnan <ranantha@mcs.anl.gov> |
| Status: | NEW | ||
| Severity: | enhancement | CC: | meder@mcs.anl.gov |
| Priority: | P3 | ||
| Version: | 4.0.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
More step-by-step detail: The class org.globus.bootstrap.Bootstrap.java has the following changes. 1. Define a constant (static final String) named GLOBUS_CLASSPATH with the value "GLOBUS_CLASSPATH" (new). 2. Query the System property GLOBUS_LOCATION and set a local String variable base. (Existing) 3. In the main method after constructing a Bootstrap object named boot (Existing), query the System property GLOBUS_CLASSPATH and set the local String variable classPath (new). 4. If the classPath is not set, that is, it is null (new check), then print out "GLOBUS_CLASSPATH not set, default Classpath will be used." (new), add the directory specified by base to the bootstrap object (Existing), and add the lib directory specified by base to the boostrap object (Existing). 5. If the classPath is set, that is, it is not-null (new), then get the "path.separator" and set the local variable pathSeparator, construct a String Tokenizer to process the classPath using the pathSeparator, loop while the tokenizer has more tokens: get the next token as a local variable entry, construct a new File object given this entry named file, add the directory specified by file to the bootstrap object, if the file is a directory invoke a new method named addJarsInDirectory given the file and a null filter [note:this method is in the BootstrapBase class which is described below], and end the tokenization loop. So for a directory this adds both the directory and the jars in the directory to the classpath which enables system resources to be found. 6. Continue processing (Existing). The class org.globus.boostrap.BoostrapBase has the following changes. 1. In the getDirectory method remove the condition: if the baseDir is not a directory. IOW, allow files and directories now. Optionally rename method getFileOrDirectory. Change bootstrap exception message to remove the phase "is not a directory,". 2. Remove the first addLibDirectory method which accepts a single string as the directory and then invokes the addLibDirectory which accepts two arguments, the directory and a null filter. It will no longer be called since we're going to refactor the method next. 3. Refactor the second addLibDirectory into two methods: addLibDirectory and addJarsInDirectory. Remove the filter argument from the remaining addLibDirectory, and after checking the lib file exists, is a directory and can be read invoke the new method addJarsInDirectory passing it the libDir (converted to a string), and a null filter. Then end the addLibDirectory method. IOW, don't do the code in the old try statement it'll be refactored into the next method, addJarsInDirectory. 4. Create a new addJarsInDirectory method contain the remainder of the old addLibDirectory statements beginning at the try statement. Have it take two arguments, the directory and a filter. Before the old try statement have it invoke the getDirectory method passing it the directory argument and setting the local variable libDir (although this is a misnomer and should probably be called baseDir now since it doesn't have to be a lib directory anymore). 5. Continue processing (Existing)
Reassigning to current wsrf developer to close/fix as appropriate