public final <T> T resolveInstance(Class<T> beanType) { try { BeanLifeCycle<T> pluginLifeCycle = get(beanType); return pluginLifeCycle != null ? pluginLifeCycle.get() : null; } catch (InvocationTargetException e) { // log.log("Could not retrieve bean of type " + beanType, e.getCause()); return null; } }
public final <T> BeanLifeCycle<T> get(Class<T> type) { final B a = resolveBean(type); if (a == null) { return null; } else { return new BeanLifeCycleImpl<B, C,T>(type, this, a); } }
@Override public boolean isAvailable() { return getManager() != null; } },
private <B, I> Object resolveBean(InjectionContext<B, I> manager, String name) throws InvocationTargetException { B bean = manager.resolveBean(name); if (bean != null) { I cc = manager.createContext(bean); return manager.getInstance(bean, cc); } else { return null; } } }
protected static <B, I> InjectionContext<B, I> boot(Injector injector, Handler<Class<?>, Boolean> filter, Scope... scopes) throws Exception { for (Scope scope : scopes) { injector.addScope(scope); } if (filter == null) { return (InjectionContext<B, I>)injector.create(); } else { return (InjectionContext<B, I>)injector.create(filter); } }
public void close() { if (context != null) { manager.releaseContext(a, context); } } }
public <T> Iterable<T> resolveBeans(final Class<T> beanType) { return injectionContext.resolveInstances(beanType); }
public <T> T resolveBean(Class<T> beanType) { return injectionContext.resolveInstance(beanType); }
public ClassLoader getClassLoader() { return injectionContext.getClassLoader(); }
private <B, I> Object resolveBean(InjectionContext<B, I> manager, String name) throws InvocationTargetException { B bean = manager.resolveBean(name); if (bean != null) { I cc = manager.createContext(bean); return manager.getInstance(bean, cc); } else { return null; } } }
protected static <B, I> InjectionContext<B, I> boot(Injector injector, Handler<Class<?>, Boolean> filter, Scope... scopes) throws Exception { for (Scope scope : scopes) { injector.addScope(scope); } if (filter == null) { return (InjectionContext<B, I>)injector.create(); } else { return (InjectionContext<B, I>)injector.create(filter); } }
public final <T> T resolveInstance(Class<T> beanType) { try { BeanLifeCycle<T> pluginLifeCycle = get(beanType); return pluginLifeCycle != null ? pluginLifeCycle.get() : null; } catch (InvocationTargetException e) { // log.log("Could not retrieve bean of type " + beanType, e.getCause()); return null; } }
public final <T> BeanLifeCycle<T> get(Class<T> type) { final B a = resolveBean(type); if (a == null) { return null; } else { return new BeanLifeCycleImpl<B, C,T>(type, this, a); } }
public void close() { if (context != null) { manager.releaseContext(a, context); } } }
public <T> Iterable<T> resolveBeans(final Class<T> beanType) { return injectionContext.resolveInstances(beanType); }
public <T> T resolveBean(Class<T> beanType) { return injectionContext.resolveInstance(beanType); }
@Override public boolean isAvailable() { return getManager() != null; } },
public ClassLoader getClassLoader() { return injectionContext.getClassLoader(); }
public <T> Iterable<T> resolveBeans(final Class<T> beanType) { return injectionContext.resolveInstances(beanType); }
public <T> T resolveBean(Class<T> beanType) { return injectionContext.resolveInstance(beanType); }