accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Tubbs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-3514) Use Java ServiceLoader to identify classes that are launchable by start
Date Fri, 23 Jan 2015 00:23:34 GMT

    [ https://issues.apache.org/jira/browse/ACCUMULO-3514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14288490#comment-14288490
] 

Christopher Tubbs commented on ACCUMULO-3514:
---------------------------------------------

What this change would involve is each implementing service would implement an interface.
We'd make sure that interface has a method on it, called "getKeyword" or "commandName" or
similar, as well as some sort of "run" method. The start jar, would use these methods to determine
if it found one appropriate to the command-line args, and run it. If it can't find one, it
will fall back on the dynamic classloading, reflection to get and execute the main method,
as we do now. The big difference is that because the discovery of the available commands would
be dynamic, we don't have to keep maintaining string literals to refer to these classes, or
worry that refactoring would break the hard-coded fully-qualified class names (because there
won't be any).

> Use Java ServiceLoader to identify classes that are launchable by start
> -----------------------------------------------------------------------
>
>                 Key: ACCUMULO-3514
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3514
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: start
>            Reporter: Christopher Tubbs
>            Assignee: Christopher Tubbs
>             Fix For: 1.7.0
>
>
> This is similar to the goals of ACCUMULO-1496, but it should be possible to do it more
efficiently with an annotation processor and Java's ServiceLoader. If successful, this would
supersede ACCUMULO-1496.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message