Package org.apache.accumulo.start.spi
Interface KeywordExecutable
-
public interface KeywordExecutable
An interface used with the JavaServiceLoader
to auto-discover classes executable with a convenient keyword on the command-line.All implementing classes who have an entry in META-INF/services/
KeywordExecutable
on the classpath will be constructed by theServiceLoader
, so they should be lightweight and quickly constructible with a mandatory no-argument constructor. Because of this, implementing classes could simply be factories which execute a different class, if that class is expensive to construct or cannot have a no-argument constructor.One way to easily create META-INF/services files is to use the AutoService annotation.
If the implementing class also wishes to have a redundant main method, it may be useful to simply implement main as:
new MyImplementingClass().execute(args);
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
KeywordExecutable.UsageGroup
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
description()
void
execute(String[] args)
Execute the item with the given arguments.String
keyword()
default String
usage()
default KeywordExecutable.UsageGroup
usageGroup()
-
-
-
Method Detail
-
keyword
String keyword()
- Returns:
- Keyword which identifies this service
-
usage
default String usage()
- Returns:
- Usage for service
-
usageGroup
default KeywordExecutable.UsageGroup usageGroup()
- Returns:
- Usage group for this command
-
description
String description()
- Returns:
- Description of service
-
-