Search in sources :

Example 1 with PortableRemoteObject

use of javax.rmi.PortableRemoteObject in project wildfly by wildfly.

the class StubStrategy method writeParams.

/**
     * Marshals the sequence of method parameters into an output stream.
     *
     * @param out    a CDR output stream
     * @param params an object array with the parameters.
     */
public void writeParams(OutputStream out, Object[] params) {
    int len = params.length;
    if (len != paramWriters.length) {
        throw IIOPLogger.ROOT_LOGGER.errorMashalingParams();
    }
    for (int i = 0; i < len; i++) {
        Object param = params[i];
        if (param instanceof PortableRemoteObject) {
            try {
                param = PortableRemoteObject.toStub((Remote) param);
            } catch (NoSuchObjectException e) {
                throw new RuntimeException(e);
            }
        }
        paramWriters[i].write(out, RemoteObjectSubstitutionManager.writeReplaceRemote(param));
    }
}
Also used : Remote(java.rmi.Remote) PortableRemoteObject(javax.rmi.PortableRemoteObject) NoSuchObjectException(java.rmi.NoSuchObjectException) PortableRemoteObject(javax.rmi.PortableRemoteObject)

Aggregations

NoSuchObjectException (java.rmi.NoSuchObjectException)1 Remote (java.rmi.Remote)1 PortableRemoteObject (javax.rmi.PortableRemoteObject)1