/** * Introspect the request and determine if the target url can * execute under {@link AsyncHandler} or not. * @param bb The current byteBuffer. * @param handlerCode - no used. * @return An {@link Interceptor} value determining if an {@link AsyncHandler} * should be allowed to execute or not. * @throws java.io.IOException */ public int handle(ByteBuffer bb, int handlerCode) throws IOException { int pos = bb.position(); int limit = bb.limit(); try{ // TODO: Add patten matching. for (byte[] b: allowed){ if (Utils.findBytes(bb,b) > -1){ return Interceptor.CONTINUE; } } } finally { bb.position(pos); bb.limit(limit); } return Interceptor.BREAK; }
while(iterator.hasNext()){ matchBytes = iterator.next(); if (Utils.findBytes(bb,matchBytes) > -1){ log("Find match: " + (new String(matchBytes)) + " Suspending: " + ctx.getSelectionKey());