for (final NetworkListener listener : networkListeners) {
final GrizzlyProxy grizzlyProxy =
(GrizzlyProxy) grizzlyService.lookupNetworkProxy(listener);
if (grizzlyProxy != null) {
final GrizzlyListener grizzlyListener =
grizzlyProxy.getUnderlyingListener();
if (grizzlyListener != null) {
if (disable) {
grizzlyListener.getEmbeddedHttp().setErrorHandler(null);
} else {
if (grizzlyListener.getEmbeddedHttp().getErrorHandler() == null) {
grizzlyListener.getEmbeddedHttp().setErrorHandler(new ErrorHandler() {
@Override
public void onParsingError(com.sun.grizzly.tcp.Response response) {
Response res = new Response();
res.setCoyoteResponse(response);
WebConnector connector = webContainer.getConnectorMap().get(listener.getName());