public class ProviderFactory extends java.lang.Object implements ComponentProviderFactory<ComponentProvider>
A cache of component providers is managed. When a component provider for a class is obtained it is cached such that the same instance on subsequent requests.
Modifier and Type | Class and Description |
---|---|
protected static interface |
ProviderFactory.Destroyable |
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
LOGGER |
Constructor and Description |
---|
ProviderFactory(InjectableProviderContext ipc)
Create the provider factory.
|
Modifier and Type | Method and Description |
---|---|
protected ComponentProvider |
_getComponentProvider(java.lang.Class c) |
void |
destroy()
Destroy all cached components.
|
ComponentProvider |
getComponentProvider(java.lang.Class c)
Get a component provider for a class.
|
ComponentProvider |
getComponentProvider(ProviderServices.ProviderClass pc)
Get a component provider for a class.
|
InjectableProviderContext |
getInjectableProviderContext()
Get the injectable provider context.
|
void |
injectOnAllComponents()
Inject on all cached components.
|
void |
injectOnProviderInstance(java.lang.Object provider)
Inject on a provider.
|
void |
injectOnProviderInstances(java.util.Collection<?> providers)
Inject on a collection of providers.
|
public ProviderFactory(InjectableProviderContext ipc)
ipc
- the injectable provider context to get injectables.public InjectableProviderContext getInjectableProviderContext()
public final ComponentProvider getComponentProvider(ProviderServices.ProviderClass pc)
pc
- the provider class.public final ComponentProvider getComponentProvider(java.lang.Class c)
getComponentProvider
in interface ComponentProviderFactory<ComponentProvider>
c
- the class.protected ComponentProvider _getComponentProvider(java.lang.Class c)
public void injectOnAllComponents()
public void destroy()
public void injectOnProviderInstances(java.util.Collection<?> providers)
providers
- the collection of providers.public void injectOnProviderInstance(java.lang.Object provider)
provider
- the provider.Copyright © 2016 Oracle Corporation. All Rights Reserved.