org.jboss.resteasy.reactive.server.handlers.InterceptorHandler Maven / Gradle / Ivy
package org.jboss.resteasy.reactive.server.handlers;
import jakarta.ws.rs.ext.ReaderInterceptor;
import jakarta.ws.rs.ext.WriterInterceptor;
import org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext;
import org.jboss.resteasy.reactive.server.spi.ServerRestHandler;
public class InterceptorHandler implements ServerRestHandler {
private final WriterInterceptor[] writerInterceptors;
private final ReaderInterceptor[] readerInterceptors;
public InterceptorHandler(WriterInterceptor[] writerInterceptors, ReaderInterceptor[] readerInterceptors) {
this.writerInterceptors = writerInterceptors;
this.readerInterceptors = readerInterceptors;
}
@Override
public void handle(ResteasyReactiveRequestContext requestContext) throws Exception {
requestContext.setWriterInterceptors(writerInterceptors);
requestContext.setReaderInterceptors(readerInterceptors);
}
public boolean hasWriterInterceptors() {
return writerInterceptors != null && writerInterceptors.length > 0;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy