Search in sources :

Example 6 with Connection

use of sun.rmi.transport.Connection in project jdk8u_jdk by JetBrains.

the class UnicastRef method newCall.

/**
     * Create an appropriate call object for a new call on this object.
     * Passing operation array and index, allows the stubs generator to
     * assign the operation indexes and interpret them. The RemoteRef
     * may need the operation to encode in for the call.
     */
public RemoteCall newCall(RemoteObject obj, Operation[] ops, int opnum, long hash) throws RemoteException {
    clientRefLog.log(Log.BRIEF, "get connection");
    Connection conn = ref.getChannel().newConnection();
    try {
        clientRefLog.log(Log.VERBOSE, "create call context");
        /* log information about the outgoing call */
        if (clientCallLog.isLoggable(Log.VERBOSE)) {
            logClientCall(obj, ops[opnum]);
        }
        RemoteCall call = new StreamRemoteCall(conn, ref.getObjID(), opnum, hash);
        try {
            marshalCustomCallData(call.getOutputStream());
        } catch (IOException e) {
            throw new MarshalException("error marshaling " + "custom call data");
        }
        return call;
    } catch (RemoteException e) {
        ref.getChannel().free(conn, false);
        throw e;
    }
}
Also used : MarshalException(java.rmi.MarshalException) StreamRemoteCall(sun.rmi.transport.StreamRemoteCall) Connection(sun.rmi.transport.Connection) IOException(java.io.IOException) RemoteException(java.rmi.RemoteException) StreamRemoteCall(sun.rmi.transport.StreamRemoteCall) RemoteCall(java.rmi.server.RemoteCall)

Aggregations

Connection (sun.rmi.transport.Connection)6 IOException (java.io.IOException)4 RemoteException (java.rmi.RemoteException)3 StreamRemoteCall (sun.rmi.transport.StreamRemoteCall)3 MarshalException (java.rmi.MarshalException)2 RemoteCall (java.rmi.server.RemoteCall)2 Endpoint (sun.rmi.transport.Endpoint)2 DataInputStream (java.io.DataInputStream)1 DataOutputStream (java.io.DataOutputStream)1 ObjectInput (java.io.ObjectInput)1 ObjectOutput (java.io.ObjectOutput)1 Socket (java.net.Socket)1 ConnectIOException (java.rmi.ConnectIOException)1 UnmarshalException (java.rmi.UnmarshalException)1 RemoteObject (java.rmi.server.RemoteObject)1