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

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

public class GuiceComponentProviderFactory
extends java.lang.Object
implements com.sun.jersey.core.spi.component.ioc.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,com.sun.jersey.core.spi.component.ComponentScope> createScopeMap()
          Maps a Guice scope to a Jersey scope.
 com.sun.jersey.core.spi.component.ioc.IoCComponentProvider getComponentProvider(java.lang.Class c)
           
 com.sun.jersey.core.spi.component.ioc.IoCComponentProvider getComponentProvider(com.sun.jersey.core.spi.component.ComponentContext cc, java.lang.Class clazz)
           
 boolean isGuiceConstructorInjected(java.lang.Class<?> c)
          Determine if a class is an implicit Guice component that can be instatiated 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 com.sun.jersey.core.spi.component.ioc.IoCComponentProvider getComponentProvider(java.lang.Class c)
Specified by:
getComponentProvider in interface com.sun.jersey.core.spi.component.ComponentProviderFactory<com.sun.jersey.core.spi.component.ioc.IoCComponentProvider>
Specified by:
getComponentProvider in interface com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory

getComponentProvider

public com.sun.jersey.core.spi.component.ioc.IoCComponentProvider getComponentProvider(com.sun.jersey.core.spi.component.ComponentContext cc,
                                                                                       java.lang.Class clazz)
Specified by:
getComponentProvider in interface com.sun.jersey.core.spi.component.ioc.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 instatiated 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 instatiated 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,com.sun.jersey.core.spi.component.ComponentScope> createScopeMap()
Maps a Guice scope to a Jersey scope.

Returns:
the map


Copyright © 2010 Sun Microsystems, Inc. All Rights Reserved.