Search in sources :

Example 1 with ServiceFinderBinder

use of org.glassfish.jersey.internal.ServiceFinderBinder in project jersey by jersey.

the class MetaInfServicesAutoDiscoverable method configure.

@Override
public void configure(final FeatureContext context) {
    final Map<String, Object> properties = context.getConfiguration().getProperties();
    final RuntimeType runtimeType = context.getConfiguration().getRuntimeType();
    context.register(new AbstractBinder() {

        @Override
        protected void configure() {
            // Message Body providers.
            install(new ServiceFinderBinder<MessageBodyReader>(MessageBodyReader.class, properties, runtimeType));
            install(new ServiceFinderBinder<MessageBodyWriter>(MessageBodyWriter.class, properties, runtimeType));
            // Exception Mappers.
            install(new ServiceFinderBinder<ExceptionMapper>(ExceptionMapper.class, properties, runtimeType));
        }
    });
}
Also used : ServiceFinderBinder(org.glassfish.jersey.internal.ServiceFinderBinder) RuntimeType(javax.ws.rs.RuntimeType) AbstractBinder(org.glassfish.jersey.internal.inject.AbstractBinder)

Aggregations

RuntimeType (javax.ws.rs.RuntimeType)1 ServiceFinderBinder (org.glassfish.jersey.internal.ServiceFinderBinder)1 AbstractBinder (org.glassfish.jersey.internal.inject.AbstractBinder)1