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

项目:javify    文件:SocketChannelImpl.java   
public boolean connect (SocketAddress remote, int timeout) throws IOException
{
  if (!isOpen())
    throw new ClosedChannelException();

  if (isConnected())
    throw new AlreadyConnectedException();

  if (connectionPending)
    throw new ConnectionPendingException();

  if (!(remote instanceof InetSocketAddress))
    throw new UnsupportedAddressTypeException();

  connectAddress = (InetSocketAddress) remote;

  if (connectAddress.isUnresolved())
    throw new UnresolvedAddressException();

  connected = channel.connect(connectAddress, timeout);
  connectionPending = !connected;
  return connected;
}
项目:jvm-stm    文件:SocketChannelImpl.java   
public boolean connect (SocketAddress remote, int timeout) throws IOException
{
  if (!isOpen())
    throw new ClosedChannelException();

  if (isConnected())
    throw new AlreadyConnectedException();

  if (connectionPending)
    throw new ConnectionPendingException();

  if (!(remote instanceof InetSocketAddress))
    throw new UnsupportedAddressTypeException();

  connectAddress = (InetSocketAddress) remote;

  if (connectAddress.isUnresolved())
    throw new UnresolvedAddressException();

  connected = channel.connect(connectAddress, timeout);
  connectionPending = !connected;
  return connected;
}
项目:In-the-Box-Fork    文件:ConnectionPendingExceptionTest.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 = "ConnectionPendingException",
        args = {}
    )
})
public void testSerializationSelf() throws Exception {

    SerializationTest.verifySelf(new ConnectionPendingException());
}
项目:In-the-Box-Fork    文件:ConnectionPendingExceptionTest.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 = "ConnectionPendingException",
        args = {}
    )
})
public void testSerializationCompatibility() throws Exception {

    SerializationTest.verifyGolden(this, new ConnectionPendingException());
}
项目:JamVM-PH    文件:SocketChannelImpl.java   
public boolean connect (SocketAddress remote, int timeout) throws IOException
{
  if (!isOpen())
    throw new ClosedChannelException();

  if (isConnected())
    throw new AlreadyConnectedException();

  if (connectionPending)
    throw new ConnectionPendingException();

  if (!(remote instanceof InetSocketAddress))
    throw new UnsupportedAddressTypeException();

  connectAddress = (InetSocketAddress) remote;

  if (connectAddress.isUnresolved())
    throw new UnresolvedAddressException();

  connected = channel.connect(connectAddress, timeout);
  connectionPending = !connected;
  return connected;
}
项目:classpath    文件:SocketChannelImpl.java   
public boolean connect (SocketAddress remote, int timeout) throws IOException
{
  if (!isOpen())
    throw new ClosedChannelException();

  if (isConnected())
    throw new AlreadyConnectedException();

  if (connectionPending)
    throw new ConnectionPendingException();

  if (!(remote instanceof InetSocketAddress))
    throw new UnsupportedAddressTypeException();

  connectAddress = (InetSocketAddress) remote;

  if (connectAddress.isUnresolved())
    throw new UnresolvedAddressException();

  connected = channel.connect(connectAddress, timeout);
  connectionPending = !connected;
  return connected;
}
项目:OpenJSharp    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:jdk8u-jdk    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:openjdk-jdk10    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:openjdk9    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:jdk8u_jdk    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:j2objc    文件:SocketChannelImpl.java   
synchronized private void checkUnconnected() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (status == SOCKET_STATUS_CONNECTED) {
        throw new AlreadyConnectedException();
    }
    if (status == SOCKET_STATUS_PENDING) {
        throw new ConnectionPendingException();
    }
}
项目:j2objc    文件:SocketChannelImpl.java   
@Override
public void bind(SocketAddress localAddr) throws IOException {
    if (channel.isConnected()) {
        throw new AlreadyConnectedException();
    }
    if (SocketChannelImpl.SOCKET_STATUS_PENDING == channel.status) {
        throw new ConnectionPendingException();
    }
    super.bind(localAddr);
    channel.onBind(false);
}
项目:infobip-open-jdk-8    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:jdk8u-dev-jdk    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:In-the-Box-Fork    文件:SocketChannelImpl.java   
synchronized private void checkUnconnected() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (status == SOCKET_STATUS_CONNECTED) {
        throw new AlreadyConnectedException();
    }
    if (status == SOCKET_STATUS_PENDING) {
        throw new ConnectionPendingException();
    }
}
项目:In-the-Box-Fork    文件:SocketChannelImpl.java   
@Override
public void bind(SocketAddress localAddr) throws IOException {
    if (channel.isConnected()) {
        throw new AlreadyConnectedException();
    }
    if (SocketChannelImpl.SOCKET_STATUS_PENDING == channel.status) {
        throw new ConnectionPendingException();
    }
    super.bind(localAddr);
    // keep here to see if need next version
    // channel.Address = getLocalSocketAddress();
    // channel.localport = getLocalPort();
    channel.isBound = true;
}
项目:In-the-Box-Fork    文件:ConnectionPendingExceptionTest.java   
/**
 * @tests {@link java.nio.channels.ConnectionPendingException#ConnectionPendingException()}
 */
public void test_Constructor() {
    ConnectionPendingException e = new ConnectionPendingException();
    assertNull(e.getMessage());
    assertNull(e.getLocalizedMessage());
    assertNull(e.getCause());
}
项目:jdk7-jdk    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:openjdk-source-code-learn    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:OLD-OpenJDK8    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:cn1    文件:SocketChannelImpl.java   
synchronized private void checkUnconnected() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (status == SOCKET_STATUS_CONNECTED) {
        throw new AlreadyConnectedException();
    }
    if (status == SOCKET_STATUS_PENDING) {
        throw new ConnectionPendingException();
    }
}
项目:cn1    文件:SocketChannelImpl.java   
/**
 * @see java.net.Socket#bind(java.net.SocketAddress)
 */
@Override
public void bind(SocketAddress localAddr) throws IOException {
    if (channel.isConnected()) {
        throw new AlreadyConnectedException();
    }
    if (SocketChannelImpl.SOCKET_STATUS_PENDING == channel.status) {
        throw new ConnectionPendingException();
    }
    super.bind(localAddr);
    channel.isBound = true;
    channel.localAddress = super.getLocalAddress();
    channel.localPort = super.getLocalPort();
}
项目:cn1    文件:ConnectionPendingExceptionTest.java   
/**
 * @tests {@link java.nio.channels.ConnectionPendingException#ConnectionPendingException()}
 */
public void test_Constructor() {
    ConnectionPendingException e = new ConnectionPendingException();
    assertNull(e.getMessage());
    assertNull(e.getLocalizedMessage());
    assertNull(e.getCause());
}
项目:openjdk-jdk7u-jdk    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:freeVM    文件:SocketChannelImpl.java   
synchronized private void checkUnconnected() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (status == SOCKET_STATUS_CONNECTED) {
        throw new AlreadyConnectedException();
    }
    if (status == SOCKET_STATUS_PENDING) {
        throw new ConnectionPendingException();
    }
}
项目:freeVM    文件:SocketChannelImpl.java   
@Override
public void bind(SocketAddress localAddr) throws IOException {
    if (channel.isConnected()) {
        throw new AlreadyConnectedException();
    }
    if (SocketChannelImpl.SOCKET_STATUS_PENDING == channel.status) {
        throw new ConnectionPendingException();
    }
    super.bind(localAddr);
    // keep here to see if need next version
    // channel.Address = getLocalSocketAddress();
    // channel.localport = getLocalPort();
    channel.isBound = true;

}
项目:freeVM    文件:SocketChannelImpl.java   
synchronized private void checkUnconnected() throws IOException {
    if (!isOpen()) {
        throw new ClosedChannelException();
    }
    if (status == SOCKET_STATUS_CONNECTED) {
        throw new AlreadyConnectedException();
    }
    if (status == SOCKET_STATUS_PENDING) {
        throw new ConnectionPendingException();
    }
}
项目:freeVM    文件:SocketChannelImpl.java   
/**
 * @see java.net.Socket#bind(java.net.SocketAddress)
 */
@Override
public void bind(SocketAddress localAddr) throws IOException {
    if (channel.isConnected()) {
        throw new AlreadyConnectedException();
    }
    if (SocketChannelImpl.SOCKET_STATUS_PENDING == channel.status) {
        throw new ConnectionPendingException();
    }
    super.bind(localAddr);
    channel.isBound = true;
    channel.localAddress = super.getLocalAddress();
    channel.localPort = super.getLocalPort();
}
项目:freeVM    文件:ConnectionPendingExceptionTest.java   
/**
 * @tests {@link java.nio.channels.ConnectionPendingException#ConnectionPendingException()}
 */
public void test_Constructor() {
    ConnectionPendingException e = new ConnectionPendingException();
    assertNull(e.getMessage());
    assertNull(e.getLocalizedMessage());
    assertNull(e.getCause());
}
项目:openjdk-icedtea7    文件:SctpChannelImpl.java   
private void ensureOpenAndUnconnected() throws IOException {
    synchronized (stateLock) {
        if (!isOpen())
            throw new ClosedChannelException();
        if (isConnected())
            throw new AlreadyConnectedException();
        if (state == ChannelState.PENDING)
            throw new ConnectionPendingException();
    }
}
项目:cn1    文件:ConnectionPendingExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility.
 */
public void testSerializationSelf() throws Exception {

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

    SerializationTest.verifyGolden(this, new ConnectionPendingException());
}
项目:freeVM    文件:ConnectionPendingExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility.
 */
public void testSerializationSelf() throws Exception {

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

    SerializationTest.verifyGolden(this, new ConnectionPendingException());
}
项目:freeVM    文件:ConnectionPendingExceptionTest.java   
/**
 * @tests serialization/deserialization compatibility.
 */
public void testSerializationSelf() throws Exception {

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

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