Class GuiceServiceLocator

java.lang.Object
dev.getelements.elements.sdk.guice.GuiceServiceLocator
All Implemented Interfaces:
ServiceLocator

public class GuiceServiceLocator extends Object implements ServiceLocator
Created by patricktwohig on 9/1/15.
  • Constructor Details

    • GuiceServiceLocator

      public GuiceServiceLocator()
  • Method Details

    • findInstance

      public <T> Optional<Supplier<T>> findInstance(ElementServiceKey<T> elementServiceKey)
      Description copied from interface: ServiceLocator
      Gets the service using the ElementServiceKey.
      Specified by:
      findInstance in interface ServiceLocator
      Type Parameters:
      T - the type to request
      Parameters:
      elementServiceKey - the key
      Returns:
      an Optional of Supplier to the object
    • getInjector

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

      @Inject public void setInjector(com.google.inject.Injector injector)