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
 AtmosphereObjectFactory allowInjectionOf(Z z)
          Pass information to the underlying Dependency Injection Implementation
<T,U extends T>
T
newClassInstance(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 Detail

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 the AtmosphereConfigAware. AtmosphereConfigAware.configure(AtmosphereConfig) should be called in that case.

Parameters:
classType - The class' type to be created
defaultType - a class to be created @return an instance of T
Throws:
InstantiationException
IllegalAccessException

allowInjectionOf

AtmosphereObjectFactory allowInjectionOf(Z z)
Pass information to the underlying Dependency Injection Implementation

Parameters:
z - an Z
Returns:
this


Copyright © 2015. All Rights Reserved.