use of org.atmosphere.inject.InjectableObjectFactory in project atmosphere by Atmosphere.
the class AtmosphereFramework method lookupDefaultObjectFactoryType.
protected AtmosphereObjectFactory lookupDefaultObjectFactoryType() {
if (objectFactory != null && !DefaultAtmosphereObjectFactory.class.getName().equals(objectFactory.getClass().getName()))
return objectFactory;
for (String b : objectFactoryType) {
try {
Class<?> c = Class.forName(b);
objectFactory = (AtmosphereObjectFactory) c.newInstance();
break;
} catch (ClassNotFoundException e) {
logger.trace(e.getMessage() + " not found");
} catch (Exception e) {
logger.trace("", e);
}
}
if (objectFactory == null || DefaultAtmosphereObjectFactory.class.getName().equals(objectFactory.getClass().getName())) {
try {
IOUtils.loadClass(getClass(), INJECT_LIBARY);
objectFactory = new InjectableObjectFactory();
} catch (Exception e) {
logger.trace("javax.inject.Inject nor installed. Using DefaultAtmosphereObjectFactory");
objectFactory = new DefaultAtmosphereObjectFactory();
}
}
objectFactory.configure(config);
return objectFactory;
}
Aggregations