Package java.rmi

Examples of java.rmi.ConnectIOException


            int ack = din.readByte();

            if (ack != PROTOCOL_ACK) {
                // rmi.log.137=Protocol version {0} is not supported.
                // rmi.log.13C=Unknown protocol response: {0}
                throw new ConnectIOException((ack == PROTOCOL_NOT_SUPPORTED)
                        ? (Messages.getString("rmi.log.137", STREAM_PROTOCOL)) //$NON-NLS-1$
                        : (Messages.getString("rmi.log.13C",ack))); //$NON-NLS-1$
            }

            // read host and port
            String host = din.readUTF();
            int port = din.readInt();

            if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
                // rmi.log.138=Server is seeing us as {0}:{1}
                tcpTransportLog.log(RMILog.VERBOSE,
                        Messages.getString("rmi.log.138", host, port)); //$NON-NLS-1$
            }

            // restore original value of soTimeout
            try {
                s.setSoTimeout(origTimeout);
            } catch (Exception ex) {
            }

            // send our host and port (for Stream protocol they'll be ignored)
            dout.writeUTF(host);
            dout.writeInt(port);
            dout.flush();
        } catch (RemoteException re) {
            close();
            throw re;
        } catch (IOException ioe) {
            close();
            // rmi.92=Unable to acknowledge protocol with server
            throw new ConnectIOException(
                    Messages.getString("rmi.92"), ioe); //$NON-NLS-1$
        }

        // protocol is agreed
        return STREAM_PROTOCOL;
View Full Code Here


            close();
            throw re;
        } catch (IOException ioe) {
            close();
            // rmi.8E=Unable to acknowledge protocol with server
            throw new ConnectIOException(Messages.getString("rmi.8E"), ioe); //$NON-NLS-1$
        }

        // protocol is agreed
        return SINGLEOP_PROTOCOL;
    }
View Full Code Here

                    Messages.getString("rmi.80", toString()), uhe); //$NON-NLS-1$
        } catch (java.net.ConnectException ce) {
            throw new java.rmi.ConnectException(
                    Messages.getString("rmi.80", toString()), ce); //$NON-NLS-1$
        } catch (IOException ioe) {
            throw new ConnectIOException(
                    Messages.getString("rmi.80", toString()), ioe); //$NON-NLS-1$
        }
        return s;
    }
View Full Code Here

        try {
            dout.writeInt(RMI_HEADER);
            dout.writeShort(PROTOCOL_VER);
        } catch (IOException ioe) {
            // rmi.41=Unable to write RMI protocol header
            throw new ConnectIOException(Messages.getString("rmi.41"), ioe); //$NON-NLS-1$
        }

        if (transportLog.isLoggable(RMILog.VERBOSE)) {
            // rmi.log.94=Using protocol version {0}
            transportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.94", //$NON-NLS-1$
View Full Code Here

                    Messages.getString("rmi.80", toString()), uhe); //$NON-NLS-1$
        } catch (java.net.ConnectException ce) {
            throw new java.rmi.ConnectException(
                    Messages.getString("rmi.80", toString()), ce); //$NON-NLS-1$
        } catch (IOException ioe) {
            throw new ConnectIOException(
                    Messages.getString("rmi.80", toString()), ioe); //$NON-NLS-1$
        }
        return s;
    }
View Full Code Here

            close();
            throw re;
        } catch (IOException ioe) {
            close();
            // rmi.8E=Unable to acknowledge protocol with server
            throw new ConnectIOException(Messages.getString("rmi.8E"), ioe); //$NON-NLS-1$
        }

        // protocol is agreed
        return SINGLEOP_PROTOCOL;
    }
View Full Code Here

        try {
            dout.writeInt(RMI_HEADER);
            dout.writeShort(PROTOCOL_VER);
        } catch (IOException ioe) {
            // rmi.41=Unable to write RMI protocol header
            throw new ConnectIOException(Messages.getString("rmi.41"), ioe); //$NON-NLS-1$
        }

        if (transportLog.isLoggable(RMILog.VERBOSE)) {
            // rmi.log.94=Using protocol version {0}
            transportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.94", //$NON-NLS-1$
View Full Code Here

            int ack = din.readByte();

            if (ack != PROTOCOL_ACK) {
                // rmi.log.137=Protocol version {0} is not supported.
                // rmi.log.13C=Unknown protocol response: {0}
                throw new ConnectIOException((ack == PROTOCOL_NOT_SUPPORTED)
                        ? (Messages.getString("rmi.log.137", STREAM_PROTOCOL)) //$NON-NLS-1$
                        : (Messages.getString("rmi.log.13C",ack))); //$NON-NLS-1$
            }

            // read host and port
            String host = din.readUTF();
            int port = din.readInt();

            if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
                // rmi.log.138=Server is seeing us as {0}:{1}
                tcpTransportLog.log(RMILog.VERBOSE,
                        Messages.getString("rmi.log.138", host, port)); //$NON-NLS-1$
            }

            // restore original value of soTimeout
            try {
                s.setSoTimeout(origTimeout);
            } catch (Exception ex) {
            }

            // send our host and port (for Stream protocol they'll be ignored)
            dout.writeUTF(host);
            dout.writeInt(port);
            dout.flush();
        } catch (RemoteException re) {
            close();
            throw re;
        } catch (IOException ioe) {
            close();
            // rmi.92=Unable to acknowledge protocol with server
            throw new ConnectIOException(
                    Messages.getString("rmi.92"), ioe); //$NON-NLS-1$
        }

        // protocol is agreed
        return STREAM_PROTOCOL;
View Full Code Here

    /**
     * {@link java.rmi.ConnectIOException#ConnectIOException(java.lang.String, java.lang.Exception)}.
     */
    public void testConnectIOExceptionStringException() {
        NullPointerException npe = new NullPointerException();
        ConnectIOException e = new ConnectIOException("fixture", npe);
        assertTrue(e.getMessage().indexOf("fixture") > -1);
        assertSame(npe, e.getCause());
        assertSame(npe, e.detail);
    }
View Full Code Here

    /**
     * {@link java.rmi.ConnectIOException#ConnectIOException(java.lang.String)}.
     */
    public void testConnectIOExceptionString() {
        ConnectIOException e = new ConnectIOException("fixture");
        assertEquals("fixture", e.getMessage());
        assertNull(e.getCause());
        assertNull(e.detail);
    }
View Full Code Here

TOP

Related Classes of java.rmi.ConnectIOException

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.