Class GuiceRegistry

java.lang.Object
com.peterphi.std.guice.apploader.impl.GuiceRegistry

public class GuiceRegistry extends Object
Registry that holds the Injector and the applications currently registered to be injected with the latest Guice objects.
Uses GuiceBuilder to acquire a GuiceSetup which defines the Guice Modules to use to build this environment.
  • Constructor Details

    • GuiceRegistry

      public GuiceRegistry()
    • GuiceRegistry

      public GuiceRegistry(GuiceBuilder builder)
  • Method Details

    • getBuilder

      public GuiceBuilder getBuilder()
    • register

      public void register(GuiceApplication service, boolean durable)
      Request that an application be registered with this GuiceRegistry
      Parameters:
      service - the service to register (must not be null)
      durable - true if the application registration should be durable (durable applications receive lifecycle updates and are reconfigured should restart() be called
    • getInjector

      public com.google.inject.Injector getInjector()
    • stop

      public void stop()
      Shutdown all services
    • restart

      public void restart()
      Restart Guice services