Interface DynamicOptions.ClassNameProvider

  • All Superinterfaces:
    DynamicOptions.DynamicBean
    All Known Subinterfaces:
    DynamicOptions.ModulesClassNamesProvider
    Enclosing class:
    DynamicOptions

    public static interface DynamicOptions.ClassNameProvider
    extends DynamicOptions.DynamicBean
    To provide additional options to a command in another classloader, bind a ClassNameProvider which provides the name of your DynamicBean in the other classLoader.

    Do this by binding to just the name of the command you are going to bind to so that your classLoader does not load the command's class which likely is not in your classpath. To ensure that the command's class is not in your classpath, you can exclude it during your build.

    For example:

       bind(com.google.gerrit.server.DynamicOptions.DynamicBean.class)
           .annotatedWith(Exports.named( "com.google.gerrit.plugins.otherplugin.command"))
           .to(MyOptionsClassNameProvider.class);
    
       static class MyOptionsClassNameProvider implements DynamicOptions.ClassNameProvider {
         @Override
         public String getClassName() {
           return "com.googlesource.gerrit.plugins.myplugin.CommandOptions";
         }
       }
     
    • Method Detail

      • getClassName

        String getClassName()