protected void configureShiro() { try { bindRealm().toConstructor(IniRealm.class.getConstructor(Ini.class)); } catch (NoSuchMethodException e) { addError(e); } }
@Override @SuppressWarnings("unchecked") // the raw constructor member and declaring type always agree public void applyTo(Binder binder) { InjectionPoint constructor = getConstructor(); getScoping() .applyTo( binder .withSource(getSource()) .bind(getKey()) .toConstructor( (Constructor) getConstructor().getMember(), (TypeLiteral) constructor.getDeclaringType())); }
@Override public <S extends T> ScopedBindingBuilder toConstructor(Constructor<S> constructor, TypeLiteral<? extends S> type) { return base.toConstructor(constructor, type); }
@Override public <S extends T> ScopedBindingBuilder toConstructor(Constructor<S> constructor) { return base.toConstructor(constructor); }
@Override public <S extends T> ScopedBindingBuilder toConstructor(Constructor<S> constructor) { linkedBindingBuilder().toConstructor(constructor); return this; }
@Override default <S extends T> ScopedBindingBuilder toConstructor(final Constructor<S> constructor) { return this.builder().toConstructor(constructor); }
@Override public <S extends T> ScopedBindingBuilder toConstructor(Constructor<S> constructor, TypeLiteral<? extends S> type) { linkedBindingBuilder().toConstructor(constructor, type); return this; }
@Override public <S extends T> ScopedBindingBuilder toConstructor(Constructor<S> constructor) { bindRegistration(); return linkedBindingBuilder.toConstructor(constructor); }
@Override public <S extends T> ScopedBindingBuilder toConstructor(Constructor<S> constructor, TypeLiteral<? extends S> type) { bindRegistration(); return linkedBindingBuilder.toConstructor(constructor, type); }
@Override default <S extends T> ScopedBindingBuilder toConstructor(final Constructor<S> constructor, final TypeLiteral<? extends S> type) { return this.builder().toConstructor(constructor, type); }
@SuppressWarnings("unchecked") @Override public Void visit(ConstructorBinding<? extends T> binding) { builder.toConstructor((Constructor<T>) binding.getConstructor().getMember()).in(Scopes.SINGLETON); return null; }
@Override protected void configureShiro() { try { bind(SecurityManager.class) .annotatedWith(Names.named(SHELL_SECURITY_MANAGER)) .toConstructor(DefaultSecurityManager.class.getConstructor(Collection.class)) .asEagerSingleton(); } catch (NoSuchMethodException e) { throw new RuntimeException("Internal error", e); } expose(SecurityManager.class).annotatedWith(Names.named(SHELL_SECURITY_MANAGER)); } }
@SuppressWarnings("unchecked") private <T> ScopedBindingBuilder bindNewSpyProvider(Key<T> key) { TypeLiteral<T> type = key.getTypeLiteral(); InjectionPoint constructorInjectionPoint = InjectionPoint.forConstructorOf(type); Key<T> relayingKey = Key.get(type, JukitoInternal.class); bind(relayingKey).toConstructor((Constructor<T>) constructorInjectionPoint.getMember()); return bind(key).toProvider(new SpyProvider<T>(getProvider(relayingKey), relayingKey)); }
@SuppressWarnings("unchecked") private <T> ScopedBindingBuilder bindNewSpyProvider(Key<T> key) { TypeLiteral<T> type = key.getTypeLiteral(); InjectionPoint constructorInjectionPoint = InjectionPoint.forConstructorOf(type); Key<T> relayingKey = Key.get(type, JukitoInternal.class); bind(relayingKey).toConstructor((Constructor<T>) constructorInjectionPoint.getMember()); return bind(key).toProvider(new SpyProvider<T>(getProvider(relayingKey), relayingKey)); }
@SuppressWarnings("unchecked") // the raw constructor member and declaring type always agree public void applyTo(Binder binder) { InjectionPoint constructor = getConstructor(); getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).toConstructor( (Constructor) getConstructor().getMember(), (TypeLiteral) constructor.getDeclaringType())); }
@SuppressWarnings("unchecked") // the raw constructor member and declaring type always agree public void applyTo(Binder binder) { InjectionPoint constructor = getConstructor(); getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).toConstructor( (Constructor) getConstructor().getMember(), (TypeLiteral) constructor.getDeclaringType())); }
@SuppressWarnings("unchecked") // the raw constructor member and declaring type always agree public void applyTo(Binder binder) { InjectionPoint constructor = getConstructor(); getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).toConstructor( (Constructor) getConstructor().getMember(), (TypeLiteral) constructor.getDeclaringType())); }
@SuppressWarnings("unchecked") // the raw constructor member and declaring type always agree public void applyTo(Binder binder) { InjectionPoint constructor = getConstructor(); getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).toConstructor( (Constructor) getConstructor().getMember(), (TypeLiteral) constructor.getDeclaringType())); }
@Override @SuppressWarnings("unchecked") // the raw constructor member and declaring type always agree public void applyTo(Binder binder) { InjectionPoint constructor = getConstructor(); getScoping() .applyTo( binder .withSource(getSource()) .bind(getKey()) .toConstructor( (Constructor) getConstructor().getMember(), (TypeLiteral) constructor.getDeclaringType())); }
@Override @SuppressWarnings("unchecked") // the raw constructor member and declaring type always agree public void applyTo(Binder binder) { InjectionPoint constructor = getConstructor(); getScoping() .applyTo( binder .withSource(getSource()) .bind(getKey()) .toConstructor( (Constructor) getConstructor().getMember(), (TypeLiteral) constructor.getDeclaringType())); }