Package java.nio.channels

Examples of java.nio.channels.CancelledKeyException


                key = ((AbstractSelector) selector).register(this, interestSet,
                        attachment);
                keyList.add(key);
            } else {
                if (!key.isValid()) {
                    throw new CancelledKeyException();
                }
                key.interestOps(interestSet);
                key.attach(attachment);
            }
            return key;
View Full Code Here


  }

  @Override
  public int interestOps() {
    if (!isValid()) {
      throw new CancelledKeyException();
    }
    return interestOps;
  }
View Full Code Here

  }

  @Override
  public SelectionKey interestOps(int ops) {
    if (!isValid()) {
      throw new CancelledKeyException();
    }
    if ((ops & ~(channel().validOps())) != 0) {
      throw new IllegalArgumentException("invalid ops");
    }
    if (((ops & OP_CONNECT) != 0) && socketUDT.isConnected()) {
View Full Code Here

  }

  @Override
  public int readyOps() {
    if (!isValid()) {
      throw new CancelledKeyException();
    }
    return readyOps;
  }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility.
     */
    public void testSerializationSelf() throws Exception {

        SerializationTest.verifySelf(new CancelledKeyException());
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility with RI.
     */
    public void testSerializationCompatibility() throws Exception {

        SerializationTest.verifyGolden(this, new CancelledKeyException());
    }
View Full Code Here

  }

  @Override
  public int interestOps() {
    if (!isValid()) {
      throw new CancelledKeyException();
    }
    return interestOps;
  }
View Full Code Here

  }

  @Override
  public SelectionKey interestOps(int ops) {
    if (!isValid()) {
      throw new CancelledKeyException();
    }
    if ((ops & ~(channel().validOps())) != 0) {
      throw new IllegalArgumentException("invalid ops");
    }
    if (((ops & OP_CONNECT) != 0) && socketUDT.isConnected()) {
View Full Code Here

  }

  @Override
  public int readyOps() {
    if (!isValid()) {
      throw new CancelledKeyException();
    }
    return readyOps;
  }
View Full Code Here

  }

  @Override
  public int interestOps() {
    if (!isValid()) {
      throw new CancelledKeyException();
    }
    return interestOps;
  }
View Full Code Here

TOP

Related Classes of java.nio.channels.CancelledKeyException

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.