private void queue(final FileChannel source, final IoCallback ioCallback) { //if data is sent from withing the callback we queue it, to prevent the stack growing indefinitely if (pendingFile != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } pendingFile = source; queuedCallback = ioCallback; }
private void queue(final ByteBuffer[] byteBuffers, final IoCallback ioCallback) { //if data is sent from withing the callback we queue it, to prevent the stack growing indefinitely if (next != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } next = byteBuffers; queuedCallback = ioCallback; }
@Override public void transferFrom(FileChannel source, IoCallback callback) { if (callback == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("callback"); } if(!exchange.getConnection().isOpen()) { invokeOnException(callback, new ClosedChannelException()); return; } if(exchange.isResponseComplete()) { invokeOnException(callback, new IOException(UndertowMessages.MESSAGES.responseComplete())); } if (this.fileChannel != null || this.buffer != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } this.callback = callback; this.fileChannel = source; if (inCallback) { return; } if(transferTask == null) { transferTask = new TransferTask(); } if (exchange.isInIoThread()) { exchange.dispatch(transferTask); return; } transferTask.run(); }
throw UndertowMessages.MESSAGES.dataAlreadyQueued();
throw UndertowMessages.MESSAGES.dataAlreadyQueued();
private void queue(final ByteBuffer[] byteBuffers, final IoCallback ioCallback) { //if data is sent from withing the callback we queue it, to prevent the stack growing indefinitely if (next != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } next = byteBuffers; queuedCallback = ioCallback; }
private void queue(final FileChannel source, final IoCallback ioCallback) { //if data is sent from withing the callback we queue it, to prevent the stack growing indefinitely if (pendingFile != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } pendingFile = source; queuedCallback = ioCallback; }
private void queue(final String data, final IoCallback callback) { //if data is sent from withing the callback we queue it, to prevent the stack growing indefinitely if (next != null || pendingFile != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } next = data; queuedCallback = callback; } private void queue(final FileChannel data, final IoCallback callback) {
private void queue(final FileChannel data, final IoCallback callback) { //if data is sent from withing the callback we queue it, to prevent the stack growing indefinitely if (next != null || pendingFile != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } pendingFile = data; queuedCallback = callback; }
private void queue(final FileChannel source, final IoCallback ioCallback) { //if data is sent from withing the callback we queue it, to prevent the stack growing indefinitely if (pendingFile != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } pendingFile = source; queuedCallback = ioCallback; }
private void queue(final ByteBuffer[] byteBuffers, final IoCallback ioCallback) { //if data is sent from withing the callback we queue it, to prevent the stack growing indefinitely if (next != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } next = byteBuffers; queuedCallback = ioCallback; }
private void queue(final ByteBuffer[] byteBuffers, final IoCallback ioCallback) { //if data is sent from withing the callback we queue it, to prevent the stack growing indefinitely if (next != null || pendingFile != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } StringBuilder builder = new StringBuilder(); for (ByteBuffer buffer : byteBuffers) { try { builder.append(charsetDecoder.decode(buffer)); } catch (CharacterCodingException e) { ioCallback.onException(exchange, this, e); return; } } this.next = builder.toString(); queuedCallback = ioCallback; }
@Override public void transferFrom(FileChannel source, IoCallback callback) { if (callback == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("callback"); } if(!exchange.getConnection().isOpen()) { invokeOnException(callback, new ClosedChannelException()); return; } if(exchange.isResponseComplete()) { invokeOnException(callback, new IOException(UndertowMessages.MESSAGES.responseComplete())); } if (this.fileChannel != null || this.buffer != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } this.callback = callback; this.fileChannel = source; if (inCallback) { return; } if(transferTask == null) { transferTask = new TransferTask(); } if (exchange.isInIoThread()) { exchange.dispatch(transferTask); return; } transferTask.run(); }
@Override public void transferFrom(FileChannel source, IoCallback callback) { if (callback == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("callback"); } if(!exchange.getConnection().isOpen()) { invokeOnException(callback, new ClosedChannelException()); return; } if(exchange.isResponseComplete()) { invokeOnException(callback, new IOException(UndertowMessages.MESSAGES.responseComplete())); } if (this.fileChannel != null || this.buffer != null) { throw UndertowMessages.MESSAGES.dataAlreadyQueued(); } this.callback = callback; this.fileChannel = source; if (inCallback) { return; } if(transferTask == null) { transferTask = new TransferTask(); } if (exchange.isInIoThread()) { exchange.dispatch(transferTask); return; } transferTask.run(); }
throw UndertowMessages.MESSAGES.dataAlreadyQueued();
throw UndertowMessages.MESSAGES.dataAlreadyQueued();
throw UndertowMessages.MESSAGES.dataAlreadyQueued();
throw UndertowMessages.MESSAGES.dataAlreadyQueued();