<T> T inject( Class<T> implementation, InternalContext context ) { try { ConstructorInjector<T> constructor = getConstructor(implementation); return implementation.cast( constructor.construct(context, implementation)); } catch ( Exception e ) { throw new RuntimeException(e); } }
@SuppressWarnings("unchecked") public T create(InternalContext context) { if (constructor == null) { this.constructor = context.getContainerImpl().getConstructor(implementation); } return (T) constructor.construct(context, type); }