Examples of RMIObjectOutputStream


Examples of org.apache.harmony.rmi.transport.RMIObjectOutputStream

            try {
                skel.dispatch((Remote) ref.get(), call, op, h);
            } catch (Throwable t) {
                Exception ex = prepareException(m, t);
                RMIObjectOutputStream oout =
                        (RMIObjectOutputStream) call.getResultStream(false);
                oout.writeObject(ex);
            }

            try {
                call.getOutputStream().flush();
            } catch (IOException ioe) {
            }
            return;
        }

        // Using 1.2 RMI protocol version
        Method m = (Method) remoteMethods.get(new Long(h));

        if (m == null) {
            // rmi.66=Method with hash = {0} not found.
            throw new UnmarshalException(Messages.getString("rmi.66", h)); //$NON-NLS-1$
        }
        logServerCall(m.toString());
        Object[] params = readParams(m, oin);
        call.releaseInputStream();
        Object toReturn = null;
        Throwable toThrow = null;

        // locally call the method
        try {
            toReturn = m.invoke(ref.get(), params);
        } catch (InvocationTargetException ite) {
            toThrow = prepareException(m.toString(),
                    ((InvocationTargetException) ite).getTargetException());
        } catch (Throwable t) {
            toThrow = prepareException(m.toString(), t);
        }

        // return result of method call
        RMIObjectOutputStream oout =
                (RMIObjectOutputStream) call.getResultStream(toThrow == null);

        try {
            if (toThrow != null) {
                oout.writeObject(toThrow);
            } else if (toReturn != null) {
                oout.writeRMIObject(toReturn, m.getReturnType());
            } else if (m.getReturnType() != Void.TYPE) {
                oout.writeObject(null);
            }
            oout.flush();
        } catch (Error er) {
            // rmi.67=Error occurred while marshalling return value
            throw new ServerError(Messages.getString("rmi.67"), er); //$NON-NLS-1$
        }
    }
View Full Code Here

Examples of org.apache.harmony.rmi.transport.RMIObjectOutputStream

     * @throws IOException if an I/O error occurred during stream construction
     */

    public ObjectOutput getOutputStream() throws IOException {
        if (oout == null) {
            oout = new RMIObjectOutputStream(conn.getOutputStream());
        }
        return oout;
    }
View Full Code Here

Examples of org.apache.harmony.rmi.transport.RMIObjectOutputStream

            throw new StreamCorruptedException(Messages.getString("rmi.7A")); //$NON-NLS-1$
        }
        (new DataOutputStream(conn.getOutputStream())).writeByte(CALL_OK);

        if (oout == null) {
            oout = new RMIObjectOutputStream(conn.getOutputStream(), true);
        }
        oout.writeByte(success ? RETURN_VAL : RETURN_EX);
        oout.writeUID();
        oout.flush();
        hasResStream = true;
View Full Code Here

Examples of org.apache.harmony.rmi.transport.RMIObjectOutputStream

     * @throws IOException if an I/O error occurred during stream construction
     */

    public ObjectOutput getOutputStream() throws IOException {
        if (oout == null) {
            oout = new RMIObjectOutputStream(conn.getOutputStream());
        }
        return oout;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.