Java 类java.nio.channels.NotYetBoundException 实例源码

项目:In-the-Box-Fork    文件:NotYetBoundExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility.
 */
@TestTargets({
    @TestTargetNew(
        level = TestLevel.COMPLETE,
        notes = "Verifies serialization/deserialization compatibility.",
        method = "!SerializationSelf",
        args = {}
    ),
    @TestTargetNew(
        level = TestLevel.PARTIAL_COMPLETE,
        notes = "Verifies serialization/deserialization compatibility.",
        method = "NotYetBoundException",
        args = {}
    )
})
public void testSerializationSelf() throws Exception {

    SerializationTest.verifySelf(new NotYetBoundException());
}
项目:In-the-Box-Fork    文件:NotYetBoundExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility with RI.
 */
@TestTargets({
    @TestTargetNew(
        level = TestLevel.COMPLETE,
        notes = "Verifies serialization/deserialization compatibility.",
        method = "!SerializationGolden",
        args = {}
    ),
    @TestTargetNew(
        level = TestLevel.PARTIAL_COMPLETE,
        notes = "Verifies serialization/deserialization compatibility.",
        method = "NotYetBoundException",
        args = {}
    )
})
public void testSerializationCompatibility() throws Exception {

    SerializationTest.verifyGolden(this, new NotYetBoundException());
}
项目:OpenJSharp    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:jdk8u-jdk    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:openjdk-jdk10    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:openjdk9    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:jdk8u_jdk    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:javify    文件:ServerSocketChannelImpl.java   
public SocketChannel accept () throws IOException
{
  if (!isOpen())
    throw new ClosedChannelException();

  if (!serverSocket.isBound())
    throw new NotYetBoundException();

  boolean completed = false;

  try
    {
      begin();
      VMChannel client = channel.accept();
      if (client == null)
        return null;
      else
        {
          completed = true;
          return new SocketChannelImpl(provider(), client, false);
        }
    }
  finally
    {
      end (completed);
    }
}
项目:jvm-stm    文件:ServerSocketChannelImpl.java   
public SocketChannel accept () throws IOException
{
  if (!isOpen())
    throw new ClosedChannelException();

  if (!serverSocket.isBound())
    throw new NotYetBoundException();

  boolean completed = false;

  try
    {
      begin();
      VMChannel client = channel.accept();
      if (client == null)
        return null;
      else
        {
          completed = true;
          return new SocketChannelImpl(provider(), client, false);
        }
    }
  finally
    {
      end (completed);
    }
}
项目:j2objc    文件:ServerSocketChannelImpl.java   
@Override
public SocketChannel accept() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (!socket.isBound()) {
        throw new NotYetBoundException();
    }

    // Create an empty socket channel. This will be populated by ServerSocketAdapter.implAccept.
    SocketChannelImpl result = new SocketChannelImpl(provider(), false);
    try {
        begin();
        synchronized (acceptLock) {
            try {
                socket.implAccept(result);
            } catch (SocketTimeoutException e) {
                if (shouldThrowSocketTimeoutExceptionFromAccept(e)) {
                    throw e;
                }
                // Otherwise, this is a non-blocking socket and there's nothing ready, so we'll
                // fall through and return null.
            }
        }
    } finally {
        end(result.isConnected());
    }
    return result.isConnected() ? result : null;
}
项目:infobip-open-jdk-8    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:jdk8u-dev-jdk    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:In-the-Box-Fork    文件:NotYetBoundExceptionTest.java   
/**
 * @tests {@link java.nio.channels.NotYetBoundException#NotYetBoundException()}
 */
public void test_Constructor() {
    NotYetBoundException e = new NotYetBoundException();
    assertNull(e.getMessage());
    assertNull(e.getLocalizedMessage());
    assertNull(e.getCause());
}
项目:jdk7-jdk    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:openjdk-source-code-learn    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:OLD-OpenJDK8    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:cn1    文件:ServerSocketChannelTest.java   
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
    }
}
项目:cn1    文件:ServerSocketChannelTest.java   
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
    }
}
项目:cn1    文件:NotYetBoundExceptionTest.java   
/**
 * @tests {@link java.nio.channels.NotYetBoundException#NotYetBoundException()}
 */
public void test_Constructor() {
    NotYetBoundException e = new NotYetBoundException();
    assertNull(e.getMessage());
    assertNull(e.getLocalizedMessage());
    assertNull(e.getCause());
}
项目:JamVM-PH    文件:ServerSocketChannelImpl.java   
public SocketChannel accept () throws IOException
{
  if (!isOpen())
    throw new ClosedChannelException();

  if (!serverSocket.isBound())
    throw new NotYetBoundException();

  boolean completed = false;

  try
    {
      begin();
      VMChannel client = channel.accept();
      if (client == null)
        return null;
      else
        {
          completed = true;
          return new SocketChannelImpl(provider(), client, false);
        }
    }
  finally
    {
      end (completed);
    }
}
项目:openjdk-jdk7u-jdk    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:classpath    文件:ServerSocketChannelImpl.java   
public SocketChannel accept () throws IOException
{
  if (!isOpen())
    throw new ClosedChannelException();

  if (!serverSocket.isBound())
    throw new NotYetBoundException();

  boolean completed = false;

  try
    {
      begin();
      VMChannel client = channel.accept();
      if (client == null)
        return null;
      else
        {
          completed = true;
          return new SocketChannelImpl(provider(), client, false);
        }
    }
  finally
    {
      end (completed);
    }
}
项目:freeVM    文件:ServerSocketChannelTest.java   
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
    }
}
项目:freeVM    文件:ServerSocketChannelTest.java   
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
    }
}
项目:freeVM    文件:ServerSocketChannelTest.java   
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
    }
}
项目:freeVM    文件:ServerSocketChannelTest.java   
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
    }
}
项目:freeVM    文件:NotYetBoundExceptionTest.java   
/**
 * @tests {@link java.nio.channels.NotYetBoundException#NotYetBoundException()}
 */
public void test_Constructor() {
    NotYetBoundException e = new NotYetBoundException();
    assertNull(e.getMessage());
    assertNull(e.getLocalizedMessage());
    assertNull(e.getCause());
}
项目:openjdk-icedtea7    文件:SctpMultiChannelImpl.java   
@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());
    }
}
项目:In-the-Box-Fork    文件:ServerSocketChannelImpl.java   
@Override public SocketChannel accept() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (!isBound) {
        throw new NotYetBoundException();
    }

    // TODO: pass in the SelectorProvider used to create this ServerSocketChannelImpl?
    // Create an empty socket channel. This will be populated by ServerSocketAdapter.accept.
    SocketChannelImpl result = new SocketChannelImpl(SelectorProvider.provider(), false);
    Socket resultSocket = result.socket();

    try {
        begin();
        synchronized (acceptLock) {
            synchronized (blockingLock()) {
                boolean isBlocking = isBlocking();
                if (!isBlocking) {
                    int[] tryResult = new int[1];
                    boolean success = Platform.getNetworkSystem().select(
                            new FileDescriptor[] { fd },
                            new FileDescriptor[0], 1, 0, 0, tryResult);
                    if (!success || 0 == tryResult[0]) {
                        // no pending connections, returns immediately.
                        return null;
                    }
                }
                // do accept.
                do {
                    try {
                        socket.accept(resultSocket, result);
                        // select successfully, break out immediately.
                        break;
                    } catch (SocketTimeoutException e) {
                        // continue to accept if the channel is in blocking mode.
                    }
                } while (isBlocking);
            }
        }
    } finally {
        end(resultSocket.isConnected());
    }
    return result;
}
项目:cn1    文件:ServerSocketChannelImpl.java   
public SocketChannel accept() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (!isBound) {
        throw new NotYetBoundException();
    }

    SocketChannel sockChannel = new SocketChannelImpl(SelectorProvider.provider(), false);
    Socket socketGot = sockChannel.socket();

    try {
        begin();

        synchronized (acceptLock) {
                boolean isBlocking = isBlocking();
                if (!isBlocking) {
                    // for non blocking mode, use select to see whether
                    // there are any pending connections.
                    int[] tryResult = new int[1];
                    boolean success = Platform.getNetworkSystem().select(
                            new FileDescriptor[] { this.fd },
                            new FileDescriptor[0], 1, 0, 0, tryResult);
                    if (!success || 0 == tryResult[0]) {
                        // no pending connections, returns immediately.
                        return null;
                    }
                }
                // do accept.
                do {
                    try {
                        ((ServerSocketAdapter) socket).accept(socketGot,
                                (SocketChannelImpl) sockChannel);
                        // select successfully, break out immediately.
                        break;
                    } catch (SocketTimeoutException e) {
                        // continue to accept if the channel is in blocking
                        // mode.
                    }
                } while (isBlocking);
        }
    } finally {
        end(socketGot.isConnected());
    }
    return sockChannel;
}
项目:cn1    文件:NotYetBoundExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility.
 */
public void testSerializationSelf() throws Exception {

    SerializationTest.verifySelf(new NotYetBoundException());
}
项目:cn1    文件:NotYetBoundExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility with RI.
 */
public void testSerializationCompatibility() throws Exception {

    SerializationTest.verifyGolden(this, new NotYetBoundException());
}
项目:freeVM    文件:ServerSocketChannelImpl.java   
public SocketChannel accept() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (!isBound) {
        throw new NotYetBoundException();
    }

    SocketChannel sockChannel = SocketChannel.open();
    Socket socketGot = sockChannel.socket();

    try {
        begin();

        synchronized (acceptLock) {
            synchronized (blockingLock()) {
                boolean isBlocking = isBlocking();
                if (!isBlocking) {
                    // for non blocking mode, use select to see whether
                    // there are any pending connections.
                    int[] tryResult = Platform.getNetworkSystem().select(
                            new FileDescriptor[] { this.fd },
                            new FileDescriptor[0], 0);
                    if (0 == tryResult.length || 0 == tryResult[0]) {
                        // no pending connections, returns immediately.
                        return null;
                    }
                }
                // do accept.
                do {
                    try {
                        ((ServerSocketAdapter) socket).accept(socketGot,
                                (SocketChannelImpl) sockChannel);
                        // select successfully, break out immediately.
                        break;
                    } catch (SocketTimeoutException e) {
                        // continue to accept if the channel is in blocking
                        // mode.
                    }
                } while (isBlocking);
            }
        }
    } finally {
        end(socketGot.isConnected());
    }
    return sockChannel;
}
项目:freeVM    文件:NotYetBoundExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility.
 */
public void testSerializationSelf() throws Exception {

    SerializationTest.verifySelf(new NotYetBoundException());
}
项目:freeVM    文件:NotYetBoundExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility with RI.
 */
public void testSerializationCompatibility() throws Exception {

    SerializationTest.verifyGolden(this, new NotYetBoundException());
}
项目:freeVM    文件:ServerSocketChannelImpl.java   
public SocketChannel accept() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (!isBound) {
        throw new NotYetBoundException();
    }

    SocketChannel sockChannel = new SocketChannelImpl(SelectorProvider.provider(), false);
    Socket socketGot = sockChannel.socket();

    try {
        begin();

        synchronized (acceptLock) {
                boolean isBlocking = isBlocking();
                if (!isBlocking) {
                    // for non blocking mode, use select to see whether
                    // there are any pending connections.
                    int[] tryResult = new int[1];
                    boolean success = Platform.getNetworkSystem().select(
                            new FileDescriptor[] { this.fd },
                            new FileDescriptor[0], 1, 0, 0, tryResult);
                    if (!success || 0 == tryResult[0]) {
                        // no pending connections, returns immediately.
                        return null;
                    }
                }
                // do accept.
                do {
                    try {
                        ((ServerSocketAdapter) socket).accept(socketGot,
                                (SocketChannelImpl) sockChannel);
                        // select successfully, break out immediately.
                        break;
                    } catch (SocketTimeoutException e) {
                        // continue to accept if the channel is in blocking
                        // mode.
                    }
                } while (isBlocking);
        }
    } finally {
        end(socketGot.isConnected());
    }
    return sockChannel;
}
项目:freeVM    文件:NotYetBoundExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility.
 */
public void testSerializationSelf() throws Exception {

    SerializationTest.verifySelf(new NotYetBoundException());
}
项目:freeVM    文件:NotYetBoundExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility with RI.
 */
public void testSerializationCompatibility() throws Exception {

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