return instance;
}
private T create() {
// Look for an @Inject constructor or just create a new instance if not found
InjectionPoint injectionPoint = InjectionPoint.forConstructorOf(type);
final long startTime = System.nanoTime();
for (LifecycleListener listener : listeners) {
listener.objectInjecting(TypeLiteral.get(type));
}
if (injectionPoint != null) {
List<Dependency<?>> deps = injectionPoint.getDependencies();
if (deps.size() > 0) {
Constructor<?> constructor = (Constructor<?>)injectionPoint.getMember();
// One thread for each dependency
ExecutorService executor = Executors.newCachedThreadPool(
new ThreadFactoryBuilder()
.setDaemon(true)
.setNameFormat("ConcurrentProviders-" + type.getSimpleName() + "-%d")