Package org.atmosphere.cpr
Interface AtmosphereObjectFactory<Z>
- All Superinterfaces:
AtmosphereConfigAware
- All Known Implementing Classes:
AtmosphereFramework.DefaultAtmosphereObjectFactory,InjectableObjectFactory
Customization point for Atmosphere to instantiate classes.
Useful when using a DI framework.
- Author:
- Norman Franke, Jeanfrancois Arcand
-
Method Summary
Modifier and TypeMethodDescriptionPass information to the underlying Dependency Injection Implementation<T,U extends T>
TnewClassInstance(Class<T> classType, 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 Details
-
newClassInstance
<T,U extends T> T newClassInstance(Class<T> classType, Class<U> defaultType) throws InstantiationException, IllegalAccessException Delegate 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:
InstantiationExceptionIllegalAccessException
-
allowInjectionOf
Pass information to the underlying Dependency Injection Implementation- Parameters:
z- an Z- Returns:
- this
-