Java Code Examples for java.rmi.server.RemoteCall

The following are top voted examples for showing how to use java.rmi.server.RemoteCall. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: UnicastRef.java   Source Code and License 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
Project: jdk8u-jdk   File: UnicastRef.java   Source Code and License 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
Project: openjdk-jdk10   File: UnicastRef.java   Source Code and License 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
Project: openjdk9   File: UnicastRef.java   Source Code and License 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
Project: jdk8u_jdk   File: UnicastRef.java   Source Code and License 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
Project: lookaside_java-1.8.0-openjdk   File: UnicastRef.java   Source Code and License 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
Project: javify   File: UnicastRef.java   Source Code and License 6 votes vote down vote up
/**
 * @deprecated
 */
public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum,
                          long hash) throws RemoteException
{
  UnicastConnection conn;

  try
    {
      conn = manager.getConnection();
    }
  catch (IOException e1)
    {
      throw new ConnectException("connection failed to host: "
                                 + manager.serverName, e1);
    }

  // obj: useless?

  return (new UnicastRemoteCall(conn, objid, opnum, hash));
}
 
Example 8
Project: jvm-stm   File: UnicastRef.java   Source Code and License 6 votes vote down vote up
/**
 * @deprecated
 */
public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum,
                          long hash) throws RemoteException
{
  UnicastConnection conn;

  try
    {
      conn = manager.getConnection();
    }
  catch (IOException e1)
    {
      throw new ConnectException("connection failed to host: "
                                 + manager.serverName, e1);
    }

  // obj: useless?

  return (new UnicastRemoteCall(conn, objid, opnum, hash));
}
 
Example 9
Project: infobip-open-jdk-8   File: UnicastRef.java   Source Code and License 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 10
Project: jdk8u-dev-jdk   File: UnicastRef.java   Source Code and License 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 11
Project: jdk7-jdk   File: UnicastRef.java   Source Code and License 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 12
Project: openjdk-source-code-learn   File: UnicastRef.java   Source Code and License 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 13
Project: OLD-OpenJDK8   File: UnicastRef.java   Source Code and License 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 14
Project: JamVM-PH   File: UnicastRef.java   Source Code and License 6 votes vote down vote up
/**
 * @deprecated
 */
public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum,
                          long hash) throws RemoteException
{
  UnicastConnection conn;

  try
    {
      conn = manager.getConnection();
    }
  catch (IOException e1)
    {
      throw new ConnectException("connection failed to host: "
                                 + manager.serverName, e1);
    }

  // obj: useless?

  return (new UnicastRemoteCall(conn, objid, opnum, hash));
}
 
Example 15
Project: openjdk-jdk7u-jdk   File: UnicastRef.java   Source Code and License 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 16
Project: classpath   File: UnicastRef.java   Source Code and License 6 votes vote down vote up
/**
 * @deprecated
 */
public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum,
                          long hash) throws RemoteException
{
  UnicastConnection conn;

  try
    {
      conn = manager.getConnection();
    }
  catch (IOException e1)
    {
      throw new ConnectException("connection failed to host: "
                                 + manager.serverName, e1);
    }

  // obj: useless?

  return (new UnicastRemoteCall(conn, objid, opnum, hash));
}
 
Example 17
Project: freeVM   File: UnicastRef.java   Source Code and License 6 votes vote down vote up
/**
 * @see RemoteRef.invoke(RemoteCall)
 */
public void invoke(RemoteCall call) throws Exception {
    if (clientRefLog.isLoggable(RMILog.VERBOSE)) {
        // rmi.log.103=Execute call {0}
        clientRefLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.103", call)); //$NON-NLS-1$
    }
    call.releaseOutputStream();
    call.executeCall();
}
 
Example 18
Project: openjdk-icedtea7   File: UnicastRef.java   Source Code and License 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 19
Project: OpenJSharp   File: ActivatableRef.java   Source Code and License 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 20
Project: jdk8u-jdk   File: ActivatableRef.java   Source Code and License 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 21
Project: jdk8u-jdk   File: NotSerializable.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example 22
Project: jdk8u-jdk   File: UnrecognizedRefType.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example 23
Project: jdk8u-jdk   File: Test.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new AssertionError();
}
 
Example 24
Project: openjdk-jdk10   File: ActivatableRef.java   Source Code and License 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 25
Project: openjdk-jdk10   File: UnicastServerRef.java   Source Code and License 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 26
Project: openjdk-jdk10   File: NotSerializable.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example 27
Project: openjdk-jdk10   File: UnrecognizedRefType.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example 28
Project: openjdk-jdk10   File: Test.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new AssertionError();
}
 
Example 29
Project: openjdk9   File: ActivatableRef.java   Source Code and License 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 30
Project: openjdk9   File: NotSerializable.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example 31
Project: openjdk9   File: UnrecognizedRefType.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example 32
Project: openjdk9   File: Test.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new AssertionError();
}
 
Example 33
Project: jdk8u_jdk   File: ActivatableRef.java   Source Code and License 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 34
Project: jdk8u_jdk   File: NotSerializable.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example 35
Project: jdk8u_jdk   File: UnrecognizedRefType.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example 36
Project: jdk8u_jdk   File: Test.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new AssertionError();
}
 
Example 37
Project: lookaside_java-1.8.0-openjdk   File: ActivatableRef.java   Source Code and License 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 38
Project: lookaside_java-1.8.0-openjdk   File: UnicastServerRef.java   Source Code and License 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 39
Project: lookaside_java-1.8.0-openjdk   File: NotSerializable.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}
 
Example 40
Project: lookaside_java-1.8.0-openjdk   File: UnrecognizedRefType.java   Source Code and License 5 votes vote down vote up
public RemoteCall newCall(RemoteObject obj,
                          Operation[] op,
                          int opnum,
                          long hash)
{
    throw new UnsupportedOperationException();
}