Package org.apache.accumulo.start.spi
Interface KeywordExecutable
-
public interface KeywordExecutableAn interface used with the JavaServiceLoaderto auto-discover classes executable with a convenient keyword on the command-line.All implementing classes who have an entry in META-INF/services/
KeywordExecutableon 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);
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidexecute(String[] args)Execute the item with the given arguments.Stringkeyword()Provides access to the service's keyword.
-
-
-
Method Detail
-
keyword
String keyword()
Provides access to the service's keyword.- Returns:
- the keyword which identifies this service
-
-