@Override public Injector getParent() { return delegateInjector.getParent(); }
public <U> Collection<ExtensionComponent<U>> find(Class<U> type, Hudson jenkins) { // the find method contract requires us to traverse all known components List<ExtensionComponent<U>> result = new ArrayList<>(); for (Injector i=container; i!=null; i=i.getParent()) { _find(type, result, i); } return result; }
public Injector getParent() { return resolve().getParent(); }
@Override public Injector getParent() { return delegateInjector.getParent(); }
@Override public Injector getParent() { return delegateInjector.getParent(); }
public Injector getParent() { return delegateInjector.getParent(); } public Injector createChildInjector(Iterable<? extends Module> modules) {
public static boolean hasExplicitBindingFor(Injector injector, Key<?> key) { Injector target = injector; do { if (target.getBindings().containsKey(key)) { return true; } target = target.getParent(); } while (target != null); return false; } }
private Injector findInjector(Key<?> key) { Injector i = injector; while (i != null) { if (i.getBindings().containsKey(key)) { return i; } i = i.getParent(); } return null; }
public <U> Collection<ExtensionComponent<U>> find(Class<U> type, Hudson jenkins) { // the find method contract requires us to traverse all known components List<ExtensionComponent<U>> result = new ArrayList<>(); for (Injector i=container; i!=null; i=i.getParent()) { _find(type, result, i); } return result; }
private Map<Key<?>, Binding<?>> collectBindings() { ImmutableMap.Builder<Key<?>, Binding<?>> result = ImmutableMap.builder(); Injector current = this.injector; while (current != null) { result.putAll(current.getAllBindings()); current = current.getParent(); } return result.build(); }
/** * Gathers Guice {@link Injector} bindings over the hierarchy. */ private static Map<Key<?>, Binding<?>> gatherBindings(Injector injector) { Map<Key<?>, Binding<?>> dst = new HashMap<Key<?>, Binding<?>>(); Injector current = injector; while (current != null) { dst.putAll(current.getBindings()); current = current.getParent(); } return dst; }
/** * Gathers Guice {@link Injector} bindings over the hierarchy. */ private static Map<Key<?>, Binding<?>> gatherBindings(Injector injector) { Map<Key<?>, Binding<?>> dst = new HashMap<Key<?>, Binding<?>>(); Injector current = injector; while (current != null) { dst.putAll(current.getBindings()); current = current.getParent(); } return dst; }
/** * Gathers Guice {@link Injector} bindings over the hierarchy. */ private static Map<Key<?>, Binding<?>> gatherBindings(Injector injector) { Map<Key<?>, Binding<?>> dst = new HashMap<Key<?>, Binding<?>>(); Injector current = injector; while (current != null) { dst.putAll(current.getBindings()); current = current.getParent(); } return dst; }
@GET @Path("keys") public String get() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter out = new PrintWriter(baos); grapher.setOut(out); grapher.graph(injector.getParent()); return baos.toString("UTF-8"); }
private void addJaxrsClasses(Injector injector, List<Class<?>> classes) { for (Key<?> key : injector.getBindings().keySet()) { Class<?> clazz = key.getTypeLiteral().getRawType(); if (hasPathAnnotation(clazz)) { classes.add(clazz); } } while (injector.getParent() != null) { injector = injector.getParent(); addJaxrsClasses(injector, classes); } }
private void addJaxrsClasses(Injector injector, List<Class<?>> classes) { for (Key<?> key : injector.getBindings().keySet()) { Class<?> clazz = key.getTypeLiteral().getRawType(); if (hasPathAnnotation(clazz)) { classes.add(clazz); } } while (injector.getParent() != null) { injector = injector.getParent(); addJaxrsClasses(injector, classes); } }
private SourceServiceFactoryFactory findService(final String name) throws ServiceException { SourceServiceFactoryFactory find = servicesProvider .find(new SourceServiceInfo() { @Override public String getServiceName() { return name; } }); find.setParent(injector.getParent()); return find; }
@Override public Injector getParent() { synchronized (ContextScope.class) { scope.enter(context, scopedObjects); try { return delegate.getParent(); } finally { scope.exit(context); } } }
@Override public void evaluate() throws Throwable { initialize(); start(); beforeRun(); injector = injector.createChildInjector(loader.onModule()); try { next.evaluate(); } finally { injector = injector.getParent(); } }