/** * Get an instance of a {@link Context} * @param key {@link SelectionKey} * @param opType the current SelectionKey op. * @return {@link Context} */ /* package */ public Context pollContext(SelectionKey key, OpType opType) { Context ctx = contexts.poll(); ctx.setController(this); ctx.setSelectionKey(key); if (opType != null) { ctx.setCurrentOpType(opType); } else { ctx.configureOpType(key); } if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "pollContext(..) Context : "+ctx); } return ctx; }