com.sun.jersey.server.impl.cdi
Class CDIComponentProviderFactory

java.lang.Object
  extended by com.sun.jersey.server.impl.cdi.CDIComponentProviderFactory
All Implemented Interfaces:
ComponentProviderFactory<IoCComponentProvider>, IoCComponentProviderFactory, WebApplicationListener

public class CDIComponentProviderFactory
extends Object
implements IoCComponentProviderFactory, WebApplicationListener

Factory for IoCComponentProvider for CDI beans. Crucially, it passes the WebApplication and ResourceConfig on to the CDIExtension, allowing beans registered by the extension to (finally) do some work.

Author:
Paul.Sandoz@Sun.Com, robc

Constructor Summary
CDIComponentProviderFactory(Object bm, ResourceConfig rc, WebApplication wa)
           
 
Method Summary
 IoCComponentProvider getComponentProvider(Class<?> c)
          Get the IoC component provider for a class.
 IoCComponentProvider getComponentProvider(ComponentContext cc, Class<?> c)
          Get the IoC component provider for a class with additional context.
 void onWebApplicationReady()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDIComponentProviderFactory

public CDIComponentProviderFactory(Object bm,
                                   ResourceConfig rc,
                                   WebApplication wa)
Method Detail

onWebApplicationReady

public void onWebApplicationReady()
Specified by:
onWebApplicationReady in interface WebApplicationListener

getComponentProvider

public IoCComponentProvider getComponentProvider(Class<?> c)
Description copied from interface: IoCComponentProviderFactory
Get the IoC component provider for a class.

Specified by:
getComponentProvider in interface ComponentProviderFactory<IoCComponentProvider>
Specified by:
getComponentProvider in interface IoCComponentProviderFactory
Parameters:
c - the class
Returns:
the IoC component provider for the class, otherwise null if the class is not supported.

getComponentProvider

public IoCComponentProvider getComponentProvider(ComponentContext cc,
                                                 Class<?> c)
Description copied from interface: IoCComponentProviderFactory
Get the IoC component provider for a class with additional context.

The additional context will be associated with the annotations and optionally an annotated object. For example, a component provider may be requested for a class that is the type of a Field, or be requested for a class that is the type of a method parameter.

Specified by:
getComponentProvider in interface IoCComponentProviderFactory
Parameters:
cc - the component context to obtain annotations and the annotated object (if present).
c - the class
Returns:
the IoC component provider for the class, otherwise null if the class is not supported.


Copyright © 2013 Oracle Corporation. All Rights Reserved.