Class GuiceObjectFactory

  • All Implemented Interfaces:
    org.atmosphere.cpr.AtmosphereObjectFactory<com.google.inject.AbstractModule>, org.atmosphere.inject.AtmosphereConfigAware

    public class GuiceObjectFactory
    extends java.lang.Object
    implements org.atmosphere.cpr.AtmosphereObjectFactory<com.google.inject.AbstractModule>
    An AtmosphereObjectFactory for Guice
    Author:
    Jean-Francois Arcand
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.atmosphere.cpr.AtmosphereConfig config  
      protected com.google.inject.Injector injector  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.atmosphere.cpr.AtmosphereObjectFactory allowInjectionOf​(com.google.inject.AbstractModule module)  
      void configure​(org.atmosphere.cpr.AtmosphereConfig config)  
      protected void initInjector​(org.atmosphere.cpr.AtmosphereFramework framework)  
      <T,​U extends T>
      U
      newClassInstance​(java.lang.Class<T> classType, java.lang.Class<U> classToInstantiate)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • injector

        protected com.google.inject.Injector injector
      • config

        protected org.atmosphere.cpr.AtmosphereConfig config
    • Constructor Detail

      • GuiceObjectFactory

        public GuiceObjectFactory()
    • Method Detail

      • configure

        public void configure​(org.atmosphere.cpr.AtmosphereConfig config)
        Specified by:
        configure in interface org.atmosphere.inject.AtmosphereConfigAware
      • newClassInstance

        public <T,​U extends T> U newClassInstance​(java.lang.Class<T> classType,
                                                        java.lang.Class<U> classToInstantiate)
                                                 throws java.lang.InstantiationException,
                                                        java.lang.IllegalAccessException
        Specified by:
        newClassInstance in interface org.atmosphere.cpr.AtmosphereObjectFactory<com.google.inject.AbstractModule>
        Throws:
        java.lang.InstantiationException
        java.lang.IllegalAccessException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • initInjector

        protected void initInjector​(org.atmosphere.cpr.AtmosphereFramework framework)
      • allowInjectionOf

        public org.atmosphere.cpr.AtmosphereObjectFactory allowInjectionOf​(com.google.inject.AbstractModule module)
        Specified by:
        allowInjectionOf in interface org.atmosphere.cpr.AtmosphereObjectFactory<com.google.inject.AbstractModule>