org.jboss.guice.plugins
Class GuiceInjectorFactory

java.lang.Object
  extended by org.jboss.guice.plugins.GuiceInjectorFactory
All Implemented Interfaces:
com.google.inject.Injector

public class GuiceInjectorFactory
extends Object
implements com.google.inject.Injector

Guice Injector factory.

Author:
Ales Justin

Method Summary
static com.google.inject.Injector createInjector(Kernel kernel, GuiceObject... guiceObjects)
          Create injector.
 void destroy()
          Uninstall Guice objects.
<T> List<com.google.inject.Binding<T>>
findBindingsByType(com.google.inject.TypeLiteral<T> type)
           
<T> com.google.inject.Binding<T>
getBinding(com.google.inject.Key<T> key)
           
 Map<com.google.inject.Key<?>,com.google.inject.Binding<?>> getBindings()
           
<T> T
getInstance(Class<T> type)
           
<T> T
getInstance(com.google.inject.Key<T> key)
           
<T> com.google.inject.Provider<T>
getProvider(Class<T> type)
           
<T> com.google.inject.Provider<T>
getProvider(com.google.inject.Key<T> key)
           
 void injectMembers(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInjector

public static com.google.inject.Injector createInjector(Kernel kernel,
                                                        GuiceObject... guiceObjects)
Create injector. Install all Guice objects.

Parameters:
kernel - the kernel
guiceObjects - guice objects
Returns:
injector instance

destroy

public void destroy()
Uninstall Guice objects.


injectMembers

public void injectMembers(Object o)
Specified by:
injectMembers in interface com.google.inject.Injector

getBindings

public Map<com.google.inject.Key<?>,com.google.inject.Binding<?>> getBindings()
Specified by:
getBindings in interface com.google.inject.Injector

getBinding

public <T> com.google.inject.Binding<T> getBinding(com.google.inject.Key<T> key)
Specified by:
getBinding in interface com.google.inject.Injector

findBindingsByType

public <T> List<com.google.inject.Binding<T>> findBindingsByType(com.google.inject.TypeLiteral<T> type)
Specified by:
findBindingsByType in interface com.google.inject.Injector

getProvider

public <T> com.google.inject.Provider<T> getProvider(com.google.inject.Key<T> key)
Specified by:
getProvider in interface com.google.inject.Injector

getProvider

public <T> com.google.inject.Provider<T> getProvider(Class<T> type)
Specified by:
getProvider in interface com.google.inject.Injector

getInstance

public <T> T getInstance(com.google.inject.Key<T> key)
Specified by:
getInstance in interface com.google.inject.Injector

getInstance

public <T> T getInstance(Class<T> type)
Specified by:
getInstance in interface com.google.inject.Injector


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.