use of org.glassfish.grizzly.filterchain.FilterChainContext in project LinkAgent by shulieTech.
the class MuleHttpRequestDispatcherFilterInterceptor method doException.
@Override
public void doException(Advice advice) {
Object[] args = advice.getParameterArray();
if (args == null || args.length == 0) {
return;
}
if (!(args[0] instanceof FilterChainContext)) {
return;
}
HttpRequestPacket request = getRequest();
// trace log end
RequestTracer.doAfterTrace(request, null, advice.getThrowable());
setRequest(null);
}
use of org.glassfish.grizzly.filterchain.FilterChainContext in project LinkAgent by shulieTech.
the class MuleHttpRequestDispatcherFilterInterceptor method doAfter.
@Override
public void doAfter(Advice advice) {
Object[] args = advice.getParameterArray();
if (args == null || args.length == 0) {
return;
}
if (!(args[0] instanceof FilterChainContext)) {
return;
}
HttpRequestPacket request = getRequest();
// trace log end
RequestTracer.doAfterTrace(request, null, null);
setRequest(null);
}
use of org.glassfish.grizzly.filterchain.FilterChainContext in project Payara by payara.
the class HSTSFilterTest method processFilter.
private HttpHeader processFilter(Ssl config) throws IOException {
HSTSFilter filter = new HSTSFilter();
filter.configure(null, null, config);
FilterChainContext context = new FilterChainContext();
context.setMessage(HttpContent.create(new TestHttpHeader()));
filter.handleRead(context);
return ((HttpContent) context.getMessage()).getHttpHeader();
}
use of org.glassfish.grizzly.filterchain.FilterChainContext in project openmq by eclipse-ee4j.
the class StompMessageDispatchFilter method sendToClient.
@Override
public void sendToClient(final StompFrameMessage msg, StompProtocolHandler sph, final Object context) throws Exception {
FilterChainContext ctx = (FilterChainContext) context;
boolean closechannel = false;
try {
if (msg.getCommand() == StompFrameMessage.Command.ERROR) {
if (msg.isFatalERROR()) {
closechannel = true;
}
}
ctx.write(msg, true);
} catch (Exception e) {
if (e instanceof java.nio.channels.ClosedChannelException || e.getCause() instanceof java.nio.channels.ClosedChannelException) {
_logger.log(Level.WARNING, _sbr.getKString(_sbr.W_EXCEPTION_ON_SEND_MSG, msg.toString(), e.toString()));
if (sph != null) {
sph.close(false);
}
}
throw e;
} finally {
if (closechannel) {
GrizzlyFuture f = ctx.getConnection().close();
try {
f.get();
} catch (Exception ee) {
_logger.log(Level.WARNING, ee.getMessage(), ee);
}
}
}
}
use of org.glassfish.grizzly.filterchain.FilterChainContext in project launcher by fujitsu.
the class Http2Session method sendMessageUpstream.
void sendMessageUpstream(final Http2Stream stream, final HttpPacket message) {
final FilterChainContext upstreamContext = http2StreamChain.obtainFilterChainContext(connection, stream);
final HttpContext httpContext = message.getHttpHeader().getProcessingState().getHttpContext();
httpContext.attach(upstreamContext);
sendMessageUpstream(stream, message, upstreamContext);
}
Aggregations