Tools can be located using {@link java.util.ServiceLoader#load(Class)}. @author Neal M Gafter @author Peter von der Ahé @author Jonathan Gibbons @since 1.6
ToolRunner
Configuration conf = getConf(); // Create a JobConf using the processed conf
JobConf job = new JobConf(conf, MyApp.class); // Process custom command-line options Path in = new Path(args[1]); Path out = new Path(args[2]); // Specify various job-specific parameters job.setJobName("my-app"); job.setInputPath(in); job.setOutputPath(out); job.setMapperClass(MyMapper.class); job.setReducerClass(MyReducer.class); // Submit the job, then poll for progress until the job is complete JobClient.runJob(job); return 0; } public static void main(String[] args) throws Exception { // Let ToolRunner
handle generic command-line options int res = ToolRunner.run(new Configuration(), new MyApp(), args); System.exit(res); } }
@see GenericOptionsParser
@see ToolRunner
A tool receive events from visualization window when it is currently the selected tool. The visualization window toolbar presents all available tools implementations.
Example: A Brush tool colors clicked nodes.
Tool
interface@ServiceProvider(service=Tool.class)
Must have a public default constructor so that the plug-in frame work can instantiate the class.
@see org.locationtech.udig.project.ui.tool.AbstractTool @author Jesse Eichar @version $Revision: 1.9 $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|