Package java.nio.channels

Examples of java.nio.channels.ClosedChannelException


      private boolean open = true;

      public int write(ByteBuffer src) throws IOException {
        if (open == false) {
          throw new ClosedChannelException();
        }

        final int p = buffer.position();
        final int l = buffer.limit();
        final int r = src.remaining();
View Full Code Here


      private boolean open = true;

      public int read(ByteBuffer dst) throws IOException {
        if (open == false) {
          throw new ClosedChannelException();
        }

        final int p = buffer.position();
        final int l = buffer.limit();
        final int r = dst.remaining();
View Full Code Here

         
        // if underlying connection is closed throwing a ClosedChannelException, because
        // the body is not complete
        } else {
          isOpen.set(false);
          throw new ClosedChannelException();
        }
      }
     
    } else {
      return available;
View Full Code Here

 
  private void preAppend() throws IOException {
    lastTimeDataReceivedMillis = System.currentTimeMillis();
   
    if (!isOpen.get() || isDestroyed.get()) {
      throw new ClosedChannelException();
    }
  }
View Full Code Here

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

                       
                        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 (!bodyReceivingResponseHandlers.isEmpty()) {
        bodyReceivingResponseHandlers.remove(0).onException(new ClosedChannelException());
      }
     
     
      // notify waiting handler
      for (MessageHandler messageHandler : getHandlersWaitingForResponseCopy()) {
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

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.