public class InjectableObjectFactory extends Object implements AtmosphereObjectFactory<Injectable<?>>
AtmosphereConfig,AtmosphereFramework,org.atmosphere.cpr.BroadcasterFactory,
{@link org.atmosphere.cpr.AtmosphereResourceFactory } ,{@link org.atmosphere.cpr.DefaultMetaBroadcaster } and
{@link org.atmosphere.cpr.AtmosphereResourceSessionFactory } and classes implementing the {@link Injectable} defined inside
META_INF/services/org.atmosphere.inject.Inject| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
InjectableObjectFactory() |
| Modifier and Type | Method and Description |
|---|---|
AtmosphereObjectFactory |
allowInjectionOf(Injectable<?> injectable)
Pass information to the underlying Dependency Injection Implementation
|
void |
configure(AtmosphereConfig config)
Configure an AtmosphereFramework object.
|
<U> U |
getInjectable(Class<U> u)
Use this method to retrieve available
Injectable. |
<U> void |
injectAtmosphereInternalObject(U instance,
Class<U> defaultType,
AtmosphereFramework framework) |
<T,U extends T> |
newClassInstance(Class<T> classType,
Class<U> defaultType)
Delegate the creation of Object to the underlying object provider like Spring, Guice, etc.
|
<U> void |
postConstructExecution(U instance,
Class<U> defaultType)
Execute method.
|
String |
toString() |
public void configure(AtmosphereConfig config)
AtmosphereConfigAwareconfigure in interface AtmosphereConfigAwareconfig - AtmosphereConfigpublic <T,U extends T> U newClassInstance(Class<T> classType, Class<U> defaultType) throws InstantiationException, IllegalAccessException
AtmosphereObjectFactoryAtmosphereConfigAware. AtmosphereConfigAware.configure(AtmosphereConfig)
should be called in that case.newClassInstance in interface AtmosphereObjectFactory<Injectable<?>>classType - The class' type to be createddefaultType - a class to be created @return an instance of TInstantiationExceptionIllegalAccessExceptionpublic <U> void postConstructExecution(U instance,
Class<U> defaultType)
throws IllegalAccessException
U - instance - the requested object.defaultType - the type of the requested objectIllegalAccessExceptionpublic <U> void injectAtmosphereInternalObject(U instance,
Class<U> defaultType,
AtmosphereFramework framework)
throws IllegalAccessException
U - instance - the requested object.defaultType - the type of the requested objectframework - the AtmosphereFrameworkIllegalAccessExceptionpublic AtmosphereObjectFactory allowInjectionOf(Injectable<?> injectable)
AtmosphereObjectFactoryallowInjectionOf in interface AtmosphereObjectFactory<Injectable<?>>injectable - an Zpublic <U> U getInjectable(Class<U> u)
Injectable. This method is for application that inject their
own Injectable and needs already constructed classes.U - the typeu - the classCopyright © 2015. All Rights Reserved.