Class ServerInjectorBuilder


  • public class ServerInjectorBuilder
    extends Object
    Initialize Guice for a server. Clients and tests should use the individual builders to create a non-server environment.

    This class is in this package for historical reasons. The proper place is in the same module as GuiceRunnable since this class should only ever be used by servers. It is here until tests are converted to use the builders, and @{link Initialization} is deleted.

    • Constructor Detail

      • ServerInjectorBuilder

        public ServerInjectorBuilder​(com.google.inject.Injector baseInjector)
    • Method Detail

      • makeServerInjector

        public static com.google.inject.Injector makeServerInjector​(com.google.inject.Injector baseInjector,
                                                                    Set<NodeRole> nodeRoles,
                                                                    Iterable<? extends com.google.inject.Module> modules)
        Create a server injector. Located here for testing. Should only be used by GuiceRunnable (and tests).
        Parameters:
        nodeRoles - the roles which this server provides
        baseInjector - the startup injector
        modules - modules for this server
        Returns:
        the injector for the server
      • build

        public com.google.inject.Injector build()
      • registerNodeRoleModule

        public static com.google.inject.Module registerNodeRoleModule​(Set<NodeRole> nodeRoles)