com.sun.jersey.guice.spi.container
Class GuiceComponentProviderFactory

java.lang.Object
  extended by com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory
All Implemented Interfaces:
ComponentProviderFactory<IoCComponentProvider>, IoCComponentProviderFactory
Direct Known Subclasses:
GuiceContainer.ServletGuiceComponentProviderFactory

public class GuiceComponentProviderFactory
extends java.lang.Object
implements IoCComponentProviderFactory

The Guice-based IoCComponentProviderFactory.

Author:
Gili Tzabari, Paul Sandoz

Constructor Summary
GuiceComponentProviderFactory(ResourceConfig config, Injector injector)
          Creates a new GuiceComponentProviderFactory.
 
Method Summary
 java.util.Map<Scope,ComponentScope> createScopeMap()
          Maps a Guice scope to a Jersey scope.
 IoCComponentProvider getComponentProvider(java.lang.Class<?> c)
           
 IoCComponentProvider getComponentProvider(ComponentContext cc, java.lang.Class<?> clazz)
           
 boolean isGuiceConstructorInjected(java.lang.Class<?> c)
          Determine if a class is an implicit Guice component that can be instantiated by Guice and the life-cycle managed by Jersey.
 boolean isGuiceFieldOrMethodInjected(java.lang.Class<?> c)
          Determine if a class uses field or method injection via Guice using the Inject annotation
 boolean isImplicitGuiceComponent(java.lang.Class<?> c)
          Deprecated. see isGuiceConstructorInjected(java.lang.Class)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuiceComponentProviderFactory

public GuiceComponentProviderFactory(ResourceConfig config,
                                     Injector injector)
Creates a new GuiceComponentProviderFactory.

Parameters:
config - the resource configuration
injector - the Guice injector
Method Detail

getComponentProvider

public IoCComponentProvider getComponentProvider(java.lang.Class<?> c)
Specified by:
getComponentProvider in interface ComponentProviderFactory<IoCComponentProvider>
Specified by:
getComponentProvider in interface IoCComponentProviderFactory

getComponentProvider

public IoCComponentProvider getComponentProvider(ComponentContext cc,
                                                 java.lang.Class<?> clazz)
Specified by:
getComponentProvider in interface IoCComponentProviderFactory

isImplicitGuiceComponent

@Deprecated
public boolean isImplicitGuiceComponent(java.lang.Class<?> c)
Deprecated. see isGuiceConstructorInjected(java.lang.Class)

Determine if a class is an implicit Guice component that can be instantiated by Guice and the life-cycle managed by Jersey.

Parameters:
c - the class.
Returns:
true if the class is an implicit Guice component.

isGuiceConstructorInjected

public boolean isGuiceConstructorInjected(java.lang.Class<?> c)
Determine if a class is an implicit Guice component that can be instantiated by Guice and the life-cycle managed by Jersey.

Parameters:
c - the class.
Returns:
true if the class is an implicit Guice component.

isGuiceFieldOrMethodInjected

public boolean isGuiceFieldOrMethodInjected(java.lang.Class<?> c)
Determine if a class uses field or method injection via Guice using the Inject annotation

Parameters:
c - the class.
Returns:
true if the class is an implicit Guice component.

createScopeMap

public java.util.Map<Scope,ComponentScope> createScopeMap()
Maps a Guice scope to a Jersey scope.

Returns:
the map


Copyright © 2011 Oracle Corporation. All Rights Reserved.