Search in sources :

Example 1 with ClassAnalyzer

use of org.glassfish.hk2.api.ClassAnalyzer in project jersey by jersey.

the class CdiComponentProvider method bindHk2ClassAnalyzer.

private void bindHk2ClassAnalyzer() {
    ClassAnalyzer defaultClassAnalyzer = injectionManager.getInstance(ClassAnalyzer.class, ClassAnalyzer.DEFAULT_IMPLEMENTATION_NAME);
    int skippedElements = methodsToSkip.size() + fieldsToSkip.size();
    ClassAnalyzer customizedClassAnalyzer = skippedElements > 0 ? new InjecteeSkippingAnalyzer(defaultClassAnalyzer, methodsToSkip, fieldsToSkip) : defaultClassAnalyzer;
    Binder binder = new AbstractBinder() {

        @Override
        protected void configure() {
            bind(customizedClassAnalyzer).analyzeWith(ClassAnalyzer.DEFAULT_IMPLEMENTATION_NAME).to(ClassAnalyzer.class).named(CDI_CLASS_ANALYZER);
        }
    };
    injectionManager.register(binder);
}
Also used : AbstractBinder(org.glassfish.jersey.internal.inject.AbstractBinder) Binder(org.glassfish.jersey.internal.inject.Binder) ClassAnalyzer(org.glassfish.hk2.api.ClassAnalyzer) AbstractBinder(org.glassfish.jersey.internal.inject.AbstractBinder) InjectionPoint(javax.enterprise.inject.spi.InjectionPoint)

Aggregations

InjectionPoint (javax.enterprise.inject.spi.InjectionPoint)1 ClassAnalyzer (org.glassfish.hk2.api.ClassAnalyzer)1 AbstractBinder (org.glassfish.jersey.internal.inject.AbstractBinder)1 Binder (org.glassfish.jersey.internal.inject.Binder)1