Search in sources :

Example 1 with AtmosphereObjectFactory

use of org.atmosphere.runtime.AtmosphereObjectFactory in project atmosphere by Atmosphere.

the class Utils method inject.

public static final void inject(AtmosphereResource r) throws IllegalAccessException {
    AtmosphereConfig config = r.getAtmosphereConfig();
    // No Injectable supports Injection
    if (config.properties().get(NEED_RUNTIME_INJECTION) == null) {
        return;
    }
    AtmosphereObjectFactory injectableFactory = config.framework().objectFactory();
    if (!InjectableObjectFactory.class.isAssignableFrom(injectableFactory.getClass())) {
        return;
    }
    Object injectIn = injectWith(r);
    if (injectIn != null) {
        inject(injectIn, injectIn.getClass(), r);
    }
}
Also used : AtmosphereConfig(org.atmosphere.runtime.AtmosphereConfig) AtmosphereObjectFactory(org.atmosphere.runtime.AtmosphereObjectFactory) InjectableObjectFactory(org.atmosphere.inject.InjectableObjectFactory)

Aggregations

InjectableObjectFactory (org.atmosphere.inject.InjectableObjectFactory)1 AtmosphereConfig (org.atmosphere.runtime.AtmosphereConfig)1 AtmosphereObjectFactory (org.atmosphere.runtime.AtmosphereObjectFactory)1