Package org.atmosphere.cpr
Interface AtmosphereObjectFactory<Z>
-
- All Superinterfaces:
AtmosphereConfigAware
- All Known Implementing Classes:
AtmosphereFramework.DefaultAtmosphereObjectFactory,InjectableObjectFactory
public interface AtmosphereObjectFactory<Z> extends AtmosphereConfigAware
Customization point for Atmosphere to instantiate classes. Useful when using a DI framework.- Author:
- Norman Franke, Jeanfrancois Arcand
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AtmosphereObjectFactoryallowInjectionOf(Z z)Pass information to the underlying Dependency Injection Implementation<T,U extends T>
TnewClassInstance(java.lang.Class<T> classType, java.lang.Class<U> defaultType)Delegate the creation of Object to the underlying object provider like Spring, Guice, etc.-
Methods inherited from interface org.atmosphere.inject.AtmosphereConfigAware
configure
-
-
-
-
Method Detail
-
newClassInstance
<T,U extends T> T newClassInstance(java.lang.Class<T> classType, java.lang.Class<U> defaultType) throws java.lang.InstantiationException, java.lang.IllegalAccessExceptionDelegate the creation of Object to the underlying object provider like Spring, Guice, etc. When creating a class, it is important to check if the class can be configured via its implementation of theAtmosphereConfigAware.AtmosphereConfigAware.configure(AtmosphereConfig)should be called in that case.- Parameters:
classType- The class' type to be createddefaultType- a class to be created @return an instance of T- Throws:
java.lang.InstantiationExceptionjava.lang.IllegalAccessException
-
allowInjectionOf
AtmosphereObjectFactory allowInjectionOf(Z z)
Pass information to the underlying Dependency Injection Implementation- Parameters:
z- an Z- Returns:
- this
-
-