/** * 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. */ } }
/** * @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)); }
/** * 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); }
public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash) { throw new UnsupportedOperationException(); }
public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash) { throw new AssertionError(); }
/** * 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); }