java.rmi.server.RemoteCall Java Examples

The following examples show how to use java.rmi.server.RemoteCall. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UnicastRef.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Done should only be called if the invoke returns successfully
 * (non-exceptionally) to the stub. It allows the remote reference to
 * clean up (or reuse) the connection.
 */
public void done(RemoteCall call) throws RemoteException {

    /* Done only uses the connection inside the call to obtain the
     * channel the connection uses.  Once all information is read
     * from the connection, the connection may be freed.
     */
    clientRefLog.log(Log.BRIEF, "free connection (reuse = true)");

    /* Free the call connection early. */
    free(call, true);

    try {
        call.done();
    } catch (IOException e) {
        /* WARNING: If the conn has been reused early, then it is
         * too late to recover from thrown IOExceptions caught
         * here. This code is relying on StreamRemoteCall.done()
         * not actually throwing IOExceptions.
         */
    }
}
 
Example #2
Source File: UnicastRef.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Done should only be called if the invoke returns successfully
 * (non-exceptionally) to the stub. It allows the remote reference to
 * clean up (or reuse) the connection.
 */
public void done(RemoteCall call) throws RemoteException {

    /* Done only uses the connection inside the call to obtain the
     * channel the connection uses.  Once all information is read
     * from the connection, the connection may be freed.
     */
    clientRefLog.log(Log.BRIEF, "free connection (reuse = true)");

    /* Free the call connection early. */
    free(call, true);

    try {
        call.done();
    } catch (IOException e) {
        /* WARNING: If the conn has been reused early, then it is
         * too late to recover from thrown IOExceptions caught
         * here. This code is relying on StreamRemoteCall.done()
         * not actually throwing IOExceptions.
         */
    }
}
 
Example #3
Source File: UnicastRef.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Done should only be called if the invoke returns successfully
 * (non-exceptionally) to the stub. It allows the remote reference to
 * clean up (or reuse) the connection.
 */
public void done(RemoteCall call) throws RemoteException {

    /* Done only uses the connection inside the call to obtain the
     * channel the connection uses.  Once all information is read
     * from the connection, the connection may be freed.
     */
    clientRefLog.log(Log.BRIEF, "free connection (reuse = true)");

    /* Free the call connection early. */
    free(call, true);

    try {
        call.done();
    } catch (IOException e) {
        /* WARNING: If the conn has been reused early, then it is
         * too late to recover from thrown IOExceptions caught
         * here. This code is relying on StreamRemoteCall.done()
         * not actually throwing IOExceptions.
         */
    }
}
 
Example #4
Source File: UnicastRef.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Done should only be called if the invoke returns successfully
 * (non-exceptionally) to the stub. It allows the remote reference to
 * clean up (or reuse) the connection.
 */
public void done(RemoteCall call) throws RemoteException {

    /* Done only uses the connection inside the call to obtain the
     * channel the connection uses.  Once all information is read
     * from the connection, the connection may be freed.
     */
    clientRefLog.log(Log.BRIEF, "free connection (reuse = true)");

    /* Free the call connection early. */
    free(call, true);

    try {
        call.done();
    } catch (IOException e) {
        /* WARNING: If the conn has been reused early, then it is
         * too late to recover from thrown IOExceptions caught
         * here. This code is relying on StreamRemoteCall.done()
         * not actually throwing IOExceptions.
         */
    }
}
 
Example #5
Source File: UnicastRef.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Done should only be called if the invoke returns successfully
 * (non-exceptionally) to the stub. It allows the remote reference to
 * clean up (or reuse) the connection.
 */
public void done(RemoteCall call) throws RemoteException {

    /* Done only uses the connection inside the call to obtain the
     * channel the connection uses.  Once all information is read
     * from the connection, the connection may be freed.
     */
    clientRefLog.log(Log.BRIEF, "free connection (reuse = true)");

    /* Free the call connection early. */
    free(call, true);

    try {
        call.done();
    } catch (IOException e) {
        /* WARNING: If the conn has been reused early, then it is
         * too late to recover from thrown IOExceptions caught
         * here. This code is relying on StreamRemoteCall.done()
         * not actually throwing IOExceptions.
         */
    }
}
 
Example #6
Source File: UnicastRef.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Done should only be called if the invoke returns successfully
 * (non-exceptionally) to the stub. It allows the remote reference to
 * clean up (or reuse) the connection.
 */
public void done(RemoteCall call) throws RemoteException {

    /* Done only uses the connection inside the call to obtain the
     * channel the connection uses.  Once all information is read
     * from the connection, the connection may be freed.
     */
    clientRefLog.log(Log.BRIEF, "free connection (reuse = true)");

    /* Free the call connection early. */
    free(call, true);

    try {
        call.done();
    } catch (IOException e) {
        /* WARNING: If the conn has been reused early, then it is
         * too late to recover from thrown IOExceptions caught
         * here. This code is relying on StreamRemoteCall.done()
         * not actually throwing IOExceptions.
         */
    }
}
 
Example #7
Source File: NotSerializable.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example #8
Source File: Test.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new AssertionError();
}
 
Example #9
Source File: ActivatableRef.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This call is used by the old 1.1 stub protocol and is
 * unsupported since activation requires 1.2 stubs.
 */
public synchronized RemoteCall newCall(RemoteObject obj,
                                       Operation[] ops,
                                       int opnum,
                                       long hash)
    throws RemoteException
{
    throw new UnsupportedOperationException(versionComplaint);
}
 
Example #10
Source File: ActivatableRef.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This call is used by the old 1.1 stub protocol and is
 * unsupported since activation requires 1.2 stubs.
 */
public synchronized RemoteCall newCall(RemoteObject obj,
                                       Operation[] ops,
                                       int opnum,
                                       long hash)
    throws RemoteException
{
    throw new UnsupportedOperationException(versionComplaint);
}
 
Example #11
Source File: UnicastServerRef.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Handle server-side dispatch using the RMI 1.1 stub/skeleton
 * protocol, given a non-negative operation number that has
 * already been read from the call stream.
 * Exceptions are handled by the caller to be sent to the remote client.
 *
 * @param obj the target remote object for the call
 * @param call the "remote call" from which operation and
 * method arguments can be obtained.
 * @param op the operation number
 * @throws Exception if unable to marshal return result or
 * release input or output streams
 */
private void oldDispatch(Remote obj, RemoteCall call, int op)
    throws Exception
{
    long hash;              // hash for matching stub with skeleton

    // read remote call header
    ObjectInput in;
    in = call.getInputStream();
    try {
        Class<?> clazz = Class.forName("sun.rmi.transport.DGCImpl_Skel");
        if (clazz.isAssignableFrom(skel.getClass())) {
            ((MarshalInputStream)in).useCodebaseOnly();
        }
    } catch (ClassNotFoundException ignore) { }

    try {
        hash = in.readLong();
    } catch (Exception ioe) {
        throw new UnmarshalException("error unmarshalling call header", ioe);
    }

    // if calls are being logged, write out object id and operation
    logCall(obj, skel.getOperations()[op]);
    unmarshalCustomCallData(in);
    // dispatch to skeleton for remote object
    skel.dispatch(obj, call, op, hash);
}
 
Example #12
Source File: UnicastServerRef.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Handle server-side dispatch using the RMI 1.1 stub/skeleton
 * protocol, given a non-negative operation number or negative method hash
 * that has already been read from the call stream.
 * Exceptions are handled by the caller to be sent to the remote client.
 *
 * @param obj the target remote object for the call
 * @param call the "remote call" from which operation and
 * method arguments can be obtained.
 * @param op the operation number
 * @throws Exception if unable to marshal return result or
 * release input or output streams
 */
private void oldDispatch(Remote obj, RemoteCall call, int op)
    throws Exception
{
    long hash;              // hash for matching stub with skeleton

    // read remote call header
    ObjectInput in;
    in = call.getInputStream();
    try {
        Class<?> clazz = Class.forName("sun.rmi.transport.DGCImpl_Skel");
        if (clazz.isAssignableFrom(skel.getClass())) {
            ((MarshalInputStream)in).useCodebaseOnly();
        }
    } catch (ClassNotFoundException ignore) { }

    try {
        hash = in.readLong();
    } catch (Exception ioe) {
        throw new UnmarshalException("error unmarshalling call header", ioe);
    }

    // if calls are being logged, write out object id and operation
    Operation[] operations = skel.getOperations();
    logCall(obj, op >= 0 && op < operations.length ?  operations[op] : "op: " + op);
    unmarshalCustomCallData(in);
    // dispatch to skeleton for remote object
    skel.dispatch(obj, call, op, hash);
}
 
Example #13
Source File: ActivatableRef.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This call is used by the old 1.1 stub protocol and is
 * unsupported since activation requires 1.2 stubs.
 */
public synchronized RemoteCall newCall(RemoteObject obj,
                                       Operation[] ops,
                                       int opnum,
                                       long hash)
    throws RemoteException
{
    throw new UnsupportedOperationException(versionComplaint);
}
 
Example #14
Source File: UnicastServerRef.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Handle server-side dispatch using the RMI 1.1 stub/skeleton
 * protocol, given a non-negative operation number or negative method hash
 * that has already been read from the call stream.
 * Exceptions are handled by the caller to be sent to the remote client.
 *
 * @param obj the target remote object for the call
 * @param call the "remote call" from which operation and
 * method arguments can be obtained.
 * @param op the operation number
 * @throws Exception if unable to marshal return result or
 * release input or output streams
 */
private void oldDispatch(Remote obj, RemoteCall call, int op)
    throws Exception
{
    long hash;              // hash for matching stub with skeleton

    // read remote call header
    ObjectInput in;
    in = call.getInputStream();
    try {
        Class<?> clazz = Class.forName("sun.rmi.transport.DGCImpl_Skel");
        if (clazz.isAssignableFrom(skel.getClass())) {
            ((MarshalInputStream)in).useCodebaseOnly();
        }
    } catch (ClassNotFoundException ignore) { }

    try {
        hash = in.readLong();
    } catch (Exception ioe) {
        throw new UnmarshalException("error unmarshalling call header", ioe);
    }

    // if calls are being logged, write out object id and operation
    Operation[] operations = skel.getOperations();
    logCall(obj, op >= 0 && op < operations.length ?  operations[op] : "op: " + op);
    unmarshalCustomCallData(in);
    // dispatch to skeleton for remote object
    skel.dispatch(obj, call, op, hash);
}
 
Example #15
Source File: Test.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new AssertionError();
}
 
Example #16
Source File: ActivatableRef.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This call is used by the old 1.1 stub protocol and is
 * unsupported since activation requires 1.2 stubs.
 */
public synchronized RemoteCall newCall(RemoteObject obj,
                                       Operation[] ops,
                                       int opnum,
                                       long hash)
    throws RemoteException
{
    throw new UnsupportedOperationException(versionComplaint);
}
 
Example #17
Source File: NotSerializable.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example #18
Source File: Test.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new AssertionError();
}
 
Example #19
Source File: NotSerializable.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example #20
Source File: UnrecognizedRefType.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example #21
Source File: UnrecognizedRefType.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example #22
Source File: UnrecognizedRefType.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example #23
Source File: ActivatableRef.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This call is used by the old 1.1 stub protocol and is
 * unsupported since activation requires 1.2 stubs.
 */
public synchronized RemoteCall newCall(RemoteObject obj,
                                       Operation[] ops,
                                       int opnum,
                                       long hash)
    throws RemoteException
{
    throw new UnsupportedOperationException(versionComplaint);
}
 
Example #24
Source File: NotSerializable.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example #25
Source File: NotSerializable.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example #26
Source File: Test.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new AssertionError();
}
 
Example #27
Source File: ActivatableRef.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This call is used by the old 1.1 stub protocol and is
 * unsupported since activation requires 1.2 stubs.
 */
public synchronized RemoteCall newCall(RemoteObject obj,
                                       Operation[] ops,
                                       int opnum,
                                       long hash)
    throws RemoteException
{
    throw new UnsupportedOperationException(versionComplaint);
}
 
Example #28
Source File: NotSerializable.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void invoke(RemoteCall call) {
    throw new UnsupportedOperationException();
}
 
Example #29
Source File: UnrecognizedRefType.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void done(RemoteCall call) {
    throw new UnsupportedOperationException();
}
 
Example #30
Source File: UnrecognizedRefType.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void done(RemoteCall call) {
    throw new UnsupportedOperationException();
}