java.nio.channels.NotYetBoundException Java Examples

The following examples show how to use java.nio.channels.NotYetBoundException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SctpMultiChannelImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #2
Source File: NotYetBoundExceptionTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * @tests {@link java.nio.channels.NotYetBoundException#NotYetBoundException()}
 */
public void test_Constructor() {
    NotYetBoundException e = new NotYetBoundException();
    assertNull(e.getMessage());
    assertNull(e.getLocalizedMessage());
    assertNull(e.getCause());
}
 
Example #3
Source File: ServerSocketChannelTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public void testAccept_NonBlock_NotYetBound() throws IOException {
    assertTrue(this.serverChannel.isOpen());
    this.serverChannel.configureBlocking(false);
    try {
        this.serverChannel.accept();
        fail("Should throw NotYetBoundException");
    } catch (NotYetBoundException e) {
        // correct
    }
}
 
Example #4
Source File: ServerSocketChannelTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public void testAccept_Block_NotYetBound() throws IOException {
    assertTrue(this.serverChannel.isOpen());
    assertTrue(this.serverChannel.isBlocking());
    try {
        this.serverChannel.accept();
        fail("Should throw NotYetBoundException");
    } catch (NotYetBoundException e) {
        // correct
    }
}
 
Example #5
Source File: SctpMultiChannelImpl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #6
Source File: SctpMultiChannelImpl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #7
Source File: SctpMultiChannelImpl.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #8
Source File: SctpMultiChannelImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #9
Source File: SctpMultiChannelImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #10
Source File: SctpMultiChannelImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #11
Source File: SctpMultiChannelImpl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #12
Source File: SctpMultiChannelImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #13
Source File: ServerSocketChannelImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Marks the beginning of an I/O operation that might block.
 *
 * @throws ClosedChannelException if the channel is closed
 * @throws NotYetBoundException if the channel's socket has not been bound yet
 */
private void begin(boolean blocking) throws ClosedChannelException {
    if (blocking)
        begin();  // set blocker to close channel if interrupted
    synchronized (stateLock) {
        ensureOpen();
        if (localAddress == null)
            throw new NotYetBoundException();
        if (blocking)
            thread = NativeThread.current();
    }
}
 
Example #14
Source File: SctpMultiChannelImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #15
Source File: SctpMultiChannelImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #16
Source File: SctpMultiChannelImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #17
Source File: SctpMultiChannelImpl.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<Association> associations()
        throws ClosedChannelException, NotYetBoundException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (!isBound())
            throw new NotYetBoundException();

        return Collections.unmodifiableSet(associationMap.keySet());
    }
}
 
Example #18
Source File: NotYetBoundExceptionTest.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @tests serialization/deserialization compatibility.
 */
public void testSerializationSelf() throws Exception {

    SerializationTest.verifySelf(new NotYetBoundException());
}
 
Example #19
Source File: NotYetBoundExceptionTest.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * @tests serialization/deserialization compatibility with RI.
 */
public void testSerializationCompatibility() throws Exception {

    SerializationTest.verifyGolden(this, new NotYetBoundException());
}