Package java.nio.channels

Examples of java.nio.channels.CancelledKeyException


  }

  @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

                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

                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

        this.readyOps = readyOps;
    }

    private void checkValid() {
        if (!isValid()) {
            throw new CancelledKeyException();
        }
    }
View Full Code Here

        this.index = index;
    }

    private void checkValid() {
        if (!isValid()) {
            throw new CancelledKeyException();
        }
    }
View Full Code Here

                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

                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

   
    /**
     * @tests {@link java.nio.channels.CancelledKeyException#CancelledKeyException()}
     */
    public void test_Constructor() {
        CancelledKeyException e = new CancelledKeyException();
        assertNull(e.getMessage());
        assertNull(e.getLocalizedMessage());
        assertNull(e.getCause());
    }
View Full Code Here

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

        SerializationTest.verifySelf(new CancelledKeyException());
    }
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.