Package java.nio.channels

Examples of java.nio.channels.ClosedChannelException


                  LOG.fine("waiting for more reveived data (guard: " + readGuard + ")");
              }

            waitingForData(readGuard, remainingTime);               
          } else {
            throw new ClosedChannelException();
          }
        }
      }

      remainingTime = computeRemainingTime(start, receiveTimeoutSec);
View Full Code Here


                  LOG.fine("waiting for " + (length - delegate.size()) + "bytes (guard: " + readGuard + ")");
              }

            waitingForData(readGuard, remainingTime);
          } else {
            throw new ClosedChannelException();
          }
        }
      }

      remainingTime = computeRemainingTime(start, receiveTimeoutSec);
View Full Code Here

            } else {
               
                // is destroyed?
                if (isDestroyed.get()) {
                    close();
                    throw new ClosedChannelException();
                } else {
                    return 0;
                }
            }
           
View Full Code Here

            } else {
               
                // is destroyed?
                if (isDestroyed.get()) {
                    close();
                    throw new ClosedChannelException();
                } else {
                    return 0;
                }
            }
           
View Full Code Here

    if (!isDisconnected.getAndSet(true)) {
     
      // notify pending handlers
      while (!handlersWaitingForResponseHeader.isEmpty()) {
          setPersistent(false);
          handlersWaitingForResponseHeader.remove(0).onException(new ClosedChannelException());
      }
     
     
      // notify waiting handler
      for (MessageHeaderHandler messageHandler : getHandlersWaitingForResponseCopy()) {
        ClosedChannelException cce = newDetailedClosedChannelException("channel " + getId() + " is closed (by peer?) while receiving response data " +
                                                                            "(countMessagesSent=" + getCountMessagesSent() + ", countMessagesReceived=" + getCountMessagesReceived() +
                                                                            ", countReceivedBytes=" + getCountReceivedBytes() + ")");
        messageHandler.onException(cce);
      }
      handlersWaitingForResponseHeader.clear();
View Full Code Here

        destroy();
        throw new IOException(msg);
      }
     
    } else {
      throw new ClosedChannelException();
    }   
  }
View Full Code Here

        destroy();
        throw new IOException(msg);
      }
     
    } else {
      throw new ClosedChannelException();
    }   

  }
View Full Code Here

        destroy();
        throw new IOException(msg);
      }
       
    } else {
      throw new ClosedChannelException();
    }
  }
View Full Code Here

                } else if (available == 0) {
                  if (isPrimarySinkClosed.get()) {
                        if (!isSecondarySinkClosed.get()) {
                            write(secondarySink, isSecondarySinkClosed, NULL_BYTE_BUFFER);
                        } else {
                            throw new ClosedChannelException();
                        }
                    } else {
                        if (!isSecondarySinkClosed.get()) {
                            write(secondarySink, isSecondarySinkClosed, NULL_BYTE_BUFFER);
                        }
                        write(primarySink, isPrimarySinkClosed, NULL_BYTE_BUFFER);
                    }                 
                 
                } else if (available > 0) {
                    ByteBuffer[] buffers = HttpClientConnection.readByteBufferByLengthSilence(bodyDataSource, available);
                   
                    for (ByteBuffer buffer : buffers) {
                       
                        if (isPrimarySinkClosed.get()) {
                            if (!isSecondarySinkClosed.get()) {
                                write(secondarySink, isSecondarySinkClosed, buffer);
                            } else {
                                throw new ClosedChannelException();
                            }
                        } else {
                            if (!isSecondarySinkClosed.get()) {
                                write(secondarySink, isSecondarySinkClosed, buffer.duplicate());
                            }
View Full Code Here

    if (!isDisconnected.getAndSet(true)) {
     
      // notify pending handlers
      while (!handlersWaitingForResponseHeader.isEmpty()) {
          setPersistent(false);
          handlersWaitingForResponseHeader.remove(0).onException(new ClosedChannelException());
      }
     
     
      // notify waiting handler
      for (MessageHeaderHandler messageHandler : getHandlersWaitingForResponseCopy()) {
        ClosedChannelException cce = newDetailedClosedChannelException("channel " + getId() + " is closed (by peer?) while receiving response data " +
                                                                            "(countMessagesSent=" + getCountMessagesSent() + ", countMessagesReceived=" + getCountMessagesReceived() +
                                                                            ", countReceivedBytes=" + getCountReceivedBytes() + ")");
        messageHandler.onException(cce);
      }
      handlersWaitingForResponseHeader.clear();
View Full Code Here

TOP

Related Classes of java.nio.channels.ClosedChannelException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.