Class RestletGuice.Module

  • All Implemented Interfaces:
    com.google.inject.Module, FinderFactory
    Enclosing class:
    RestletGuice

    public static class RestletGuice.Module
    extends com.google.inject.AbstractModule
    implements FinderFactory
    A Guice module that implements FinderFactory. On first use of the methods of this facility, if the module hasn't been used to create an Injector, this module creates its own Injector.
    • Constructor Summary

      Constructors 
      Constructor Description
      Module​(com.google.inject.Module... modules)
      Creates a RestletGuice.Module that will install the given modules.
      Module​(java.lang.Iterable<? extends com.google.inject.Module> modules)
      Creates a RestletGuice.Module that will install the given modules.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void configure()  
      org.restlet.resource.Finder finder​(java.lang.Class<?> cls)
      Returns a Finder that will obtain a dependency-injected instance of the ServerResource subtype bound to the type associated with the given class.
      org.restlet.resource.Finder finder​(java.lang.Class<?> cls, java.lang.Class<? extends java.lang.annotation.Annotation> qualifier)
      Returns a Finder that will obtain a dependency-injected instance of the ServerResource subtype bound to the type and qualifier associated with the given class.
      protected com.google.inject.Provider<org.restlet.Application> newApplicationProvider()
      Creates a Providerr for the current Application.
      protected com.google.inject.Provider<org.restlet.Context> newContextProvider()
      Creates a Provider for the current Context.
      protected com.google.inject.Provider<org.restlet.Request> newRequestProvider()
      Creates a Provider for the current Request.
      protected com.google.inject.Provider<org.restlet.Response> newResponseProvider()
      Creates a Provider for the current Response.
      • Methods inherited from class com.google.inject.AbstractModule

        addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Module

        public Module​(com.google.inject.Module... modules)
        Creates a RestletGuice.Module that will install the given modules.
      • Module

        public Module​(java.lang.Iterable<? extends com.google.inject.Module> modules)
        Creates a RestletGuice.Module that will install the given modules.
    • Method Detail

      • configure

        protected final void configure()
        Overrides:
        configure in class com.google.inject.AbstractModule
      • finder

        public org.restlet.resource.Finder finder​(java.lang.Class<?> cls)
        Description copied from interface: FinderFactory
        Returns a Finder that will obtain a dependency-injected instance of the ServerResource subtype bound to the type associated with the given class.
        Specified by:
        finder in interface FinderFactory
        Parameters:
        cls - The class to instantiate.
        Returns:
        An instance of Finder.
      • finder

        public org.restlet.resource.Finder finder​(java.lang.Class<?> cls,
                                                  java.lang.Class<? extends java.lang.annotation.Annotation> qualifier)
        Description copied from interface: FinderFactory
        Returns a Finder that will obtain a dependency-injected instance of the ServerResource subtype bound to the type and qualifier associated with the given class.
        Specified by:
        finder in interface FinderFactory
        Parameters:
        cls - The class to instantiate.
        qualifier - The qualifier associated with the given class.
        Returns:
        An instance of Finder.
      • newApplicationProvider

        protected com.google.inject.Provider<org.restlet.Application> newApplicationProvider()
        Creates a Providerr for the current Application. Override to use a custom Application provider.
        Returns:
        A Provider for the current Application.
      • newContextProvider

        protected com.google.inject.Provider<org.restlet.Context> newContextProvider()
        Creates a Provider for the current Context. Override to use a custom Context provider.
        Returns:
        A Provider for the current Context.
      • newRequestProvider

        protected com.google.inject.Provider<org.restlet.Request> newRequestProvider()
        Creates a Provider for the current Request. Override to use a custom Request provider.
        Returns:
        A Provider for the current Request.
      • newResponseProvider

        protected com.google.inject.Provider<org.restlet.Response> newResponseProvider()
        Creates a Provider for the current Response. Override to use a custom Response provider.
        Returns:
        A Provider for the current Response.