Package java.rmi

Examples of java.rmi.ConnectIOException


       Throwable[] throwArray = new Throwable[4];
       throwArray[3] =
     new NoSuchObjectException("NoSuchObjectException");
       throwArray[2] =
     new ConnectIOException("ConnectIOException");
       throwArray[1] =
     new RemoteException("RemoteException");
       throwArray[0] =
     new UnmarshalException("UnmarshalException");
View Full Code Here


       Throwable[] throwArray = new Throwable[4];
       throwArray[3] =
     new NoSuchObjectException("NoSuchObjectException");
       throwArray[2] =
     new ConnectIOException("ConnectIOException");
       throwArray[1] =
     new RemoteException("RemoteException");
       throwArray[0] =
     new UnmarshalException("UnmarshalException");
View Full Code Here

      uproxy = newUproxy;
     
  } catch (ConnectException e) {
      throw new ConnectException("activation failed", e);
  } catch (RemoteException e) {
      throw new ConnectIOException("activation failed", e);
  } catch (UnknownObjectException e) {
      throw new NoSuchObjectException("object not registered");
  } catch (ActivationException e) {
      throw new ActivateFailedException("activation failed", e);
  }
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

                    DataInputStream in =
                        new DataInputStream(conn.getInputStream());
                    byte ack = in.readByte();
                    if (ack != TransportConstants.ProtocolAck) {
                        throw new ConnectIOException(
                            ack == TransportConstants.ProtocolNack ?
                            "JRMP StreamProtocol not supported by server" :
                            "non-JRMP server at remote endpoint");
                    }

                    String suggestedHost = in.readUTF();
                    int    suggestedPort = in.readInt();
                    if (TCPTransport.tcpLog.isLoggable(Log.VERBOSE)) {
                        TCPTransport.tcpLog.log(Log.VERBOSE,
                            "server suggested " + suggestedHost + ":" +
                            suggestedPort);
                    }

                    // set local host name, if unknown
                    TCPEndpoint.setLocalHost(suggestedHost);
                    // do NOT set the default port, because we don't
                    // know if we can't listen YET...

                    // write out default endpoint to match protocol
                    // (but it serves no purpose)
                    TCPEndpoint localEp =
                        TCPEndpoint.getLocalEndpoint(0, null, null);
                    out.writeUTF(localEp.getHost());
                    out.writeInt(localEp.getPort());
                    if (TCPTransport.tcpLog.isLoggable(Log.VERBOSE)) {
                        TCPTransport.tcpLog.log(Log.VERBOSE, "using " +
                            localEp.getHost() + ":" + localEp.getPort());
                    }

                    /*
                     * After JRMP handshake, set socket read timeout to value
                     * configured for the rest of the lifetime of the
                     * connection.  NOTE: this timeout, if configured to a
                     * finite duration, places an upper bound on the time
                     * that a remote method call is permitted to execute.
                     */
                    try {
                        /*
                         * If socket factory had set a non-zero timeout on its
                         * own, then restore it instead of using the property-
                         * configured value.
                         */
                        sock.setSoTimeout((originalSoTimeout != 0 ?
                                           originalSoTimeout :
                                           responseTimeout));
                    } catch (Exception e) {
                        // if we fail to set this, ignore and proceed anyway
                    }

                    out.flush();
                }
            } catch (IOException e) {
                if (e instanceof RemoteException)
                    throw (RemoteException) e;
                else
                    throw new ConnectIOException(
                        "error during JRMP connection establishment", e);
            }
        } else {
            try {
                conn = multiplexer.openConnection();
            } catch (IOException e) {
                synchronized (this) {
                    usingMultiplexer = false;
                    multiplexer = null;
                }
                throw new ConnectIOException(
                    "error opening virtual connection " +
                    "over multiplexed connection", e);
            }
        }
        return conn;
View Full Code Here

            DataOutputStream dataOut =
                new DataOutputStream(out);
            dataOut.writeInt(TransportConstants.Magic);
            dataOut.writeShort(TransportConstants.Version);
        } catch (IOException e) {
            throw new ConnectIOException(
                "error writing JRMP transport header", e);
        }
    }
View Full Code Here

                // don't quit if out of memory
            } catch (Exception ex) {
                // don't quit if shed fails non-catastrophically
            }

            throw new ConnectIOException("Exception creating connection to: " +
                host, e);
        }

        // set socket to disable Nagle's algorithm (always send immediately)
        // TBD: should this be left up to socket factory instead?
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.