Java 8 ConnectionPendingException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ConnectionPendingException class.

This code example shows how to use the following methods:getCause, getLocalizedMessage, getMessage
 
    /** 
     * @tests {@link java.nio.channels.ConnectionPendingException#ConnectionPendingException()} 
     */ 
    public void test_Constructor() { 
        ConnectionPendingException e = new ConnectionPendingException();
        assertNull(e.getMessage());
        assertNull(e.getLocalizedMessage());
        assertNull(e.getCause());
    } 
 
    /** 
     * @tests serialization/deserialization compatibility. 
     */ 
    @TestTargets({ 
        @TestTargetNew( 
            level = TestLevel.COMPLETE, 
            notes = "Verifies serialization/deserialization compatibility.", 
            method = "!SerializationSelf", 
            args = {} 
7
CodeRank
This code example shows how to use the following methods:getCause, getLocalizedMessage, getMessage
     
    /** 
     * @tests {@link java.nio.channels.ConnectionPendingException#ConnectionPendingException()} 
     */ 
    public void test_Constructor() { 
        ConnectionPendingException e = new ConnectionPendingException();
        assertNull(e.getMessage());
        assertNull(e.getLocalizedMessage());
        assertNull(e.getCause());
    } 
 
    /** 
     * @tests serialization/deserialization compatibility. 
     */ 
    public void testSerializationSelf() throws Exception {
 
        SerializationTest.verifySelf(new ConnectionPendingException());
    } 
 
    /** 
6
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
        } 
        if (status == SOCKET_STATUS_CONNECTED) {
            throw new AlreadyConnectedException();
        } 
        if (status == SOCKET_STATUS_PENDING) {
            throw new ConnectionPendingException();
        } 
    } 
 
    /* 
     * Shared by this class and DatagramChannelImpl, to do the address transfer 
     * and check. 
     */ 
    static InetSocketAddress validateAddress(SocketAddress socketAddress) {
        if (null == socketAddress) {
            throw new IllegalArgumentException();
        } 
        if (!(socketAddress instanceof InetSocketAddress)) {
            throw new UnsupportedAddressTypeException();
        } 
4
CodeRank
This code example shows how to use the following methods:
        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;
        } 
 
        @Override 
        public void close() throws IOException { 
            synchronized (channel) {
                if (channel.isOpen()) {
                    channel.close();
                } else { 
4
CodeRank
This code example shows how to use the following methods:
        } 
        if (status == SOCKET_STATUS_CONNECTED) {
            throw new AlreadyConnectedException();
        } 
        if (status == SOCKET_STATUS_PENDING) {
            throw new ConnectionPendingException();
        } 
    } 
 
    /* 
     * Shared by this class and DatagramChannelImpl, to do the address transfer 
     * and check. 
     */ 
    static InetSocketAddress validateAddress(SocketAddress socketAddress) {
        if (null == socketAddress) {
            throw new IllegalArgumentException();
        } 
        if (!(socketAddress instanceof InetSocketAddress)) {
            throw new UnsupportedAddressTypeException();
        } 
2
CodeRank
See Code Examples for Java 8 ConnectionPendingException Methods: