2362N/A * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * NOTE: There is a JDK-internal dependency on the existence of this 0N/A * class's getLiveRef method (as it is inherited by UnicastRef2) in 0N/A * the implementation of javax.management.remote.rmi.RMIConnector. 0N/A * Client-side transport log. 0N/A * Client-side call log. 0N/A * Create a new (empty) Unicast remote reference. 0N/A * Create a new Unicast RemoteRef. 0N/A * Returns the current value of this UnicastRef's underlying 0N/A * NOTE: There is a JDK-internal dependency on the existence of 0N/A * this method (as it is inherited by UnicastRef) in the 0N/A * implementation of javax.management.remote.rmi.RMIConnector. 0N/A * Invoke a method. This form of delegating method invocation 0N/A * to the reference allows the reference to take care of 0N/A * setting up the connection to the remote host, marshalling 0N/A * some representation for the method and parameters, then 0N/A * communicating the method invocation to the remote host. 0N/A * This method either returns the result of a method invocation 0N/A * on the remote object which resides on the remote host or 0N/A * throws a RemoteException if the call failed or an 0N/A * application-level exception if the remote invocation throws 0N/A * @param obj the proxy for the remote object 0N/A * @param method the method to be invoked 0N/A * @param params the parameter list 0N/A * @param opnum a hash that may be used to represent the method 0N/A /* If the call connection is "reused" early, remember not to 0N/A // create call context 0N/A // marshal parameters 0N/A "IOException marshalling arguments: ", e);
0N/A /* StreamRemoteCall.done() does not actually make use 0N/A * of conn, therefore it is safe to reuse this 0N/A * connection before the dirty call is sent for 0N/A /* we are freeing the connection now, do not free 0N/A /* if we got to this point, reuse must have been true. */ 0N/A /* Free the call's connection early. */ 0N/A "IOException unmarshalling return: ", e);
0N/A "ClassNotFoundException unmarshalling return: ", e);
0N/A /* WARNING: If the conn has been reused early, 0N/A * then it is too late to recover from thrown 0N/A * IOExceptions caught here. This code is relying 0N/A * on StreamRemoteCall.done() not actually 0N/A * throwing IOExceptions. 0N/A * Need to distinguish between client (generated by the 0N/A * invoke method itself) and server RuntimeExceptions. 0N/A * Client side RuntimeExceptions are likely to have 0N/A * corrupted the call connection and those from the server 0N/A * are not likely to have done so. If the exception came 0N/A * from the server the call connection should be reused. 0N/A * Some failure during call; assume connection cannot 0N/A * be reused. Must assume failure even if ServerException 0N/A * or ServerError occurs since these failures can happen 0N/A * during parameter deserialization which would leave 0N/A * the connection in a corrupted state. 0N/A /* If errors occurred, the connection is most likely not 0N/A /* alreadyFreed ensures that we do not log a reuse that 0N/A * may have already happened. 0N/A * Marshal value to an ObjectOutput sink using RMI's serialization 0N/A * format for parameters or return values. 0N/A }
else if (
type ==
boolean.
class) {
0N/A * Unmarshal value from an ObjectInput source using RMI's serialization 0N/A * format for parameters or return values. 0N/A }
else if (
type ==
boolean.
class) {
0N/A * Create an appropriate call object for a new call on this object. 0N/A * Passing operation array and index, allows the stubs generator to 0N/A * assign the operation indexes and interpret them. The RemoteRef 0N/A * may need the operation to encode in for the call. 0N/A /* log information about the outgoing call */ 0N/A "custom call data");
0N/A * Invoke makes the remote call present in the RemoteCall object. 0N/A * Invoke will raise any "user" exceptions which 0N/A * should pass through and not be caught by the stub. If any 0N/A * exception is raised during the remote invocation, invoke should 0N/A * take care of cleaning up the connection before raising the 0N/A * "user" or remote exception. 0N/A * Call did not complete; connection can't be reused. 0N/A /* If errors occurred, the connection is most likely not 0N/A * REMIND: Since runtime exceptions are no longer wrapped, 0N/A * we can't assue that the connection was left in 0N/A * a reusable state. Is this okay? 0N/A * Assume that these other exceptions are user exceptions 0N/A * and leave the connection in a reusable state. 0N/A /* reraise user (and unknown) exceptions. */ 0N/A * Don't free the connection if an exception did not 0N/A * occur because the stub needs to unmarshal the 0N/A * return value. The connection will be freed 0N/A * by a call to the "done" method. 0N/A * Private method to free a connection. 0N/A * Done should only be called if the invoke returns successfully 0N/A * (non-exceptionally) to the stub. It allows the remote reference to 0N/A * clean up (or reuse) the connection. 0N/A /* Done only uses the connection inside the call to obtain the 0N/A * channel the connection uses. Once all information is read 0N/A * from the connection, the connection may be freed. 0N/A /* Free the call connection early. */ 0N/A /* WARNING: If the conn has been reused early, then it is 0N/A * too late to recover from thrown IOExceptions caught 0N/A * here. This code is relying on StreamRemoteCall.done() 0N/A * not actually throwing IOExceptions. 0N/A * Log the details of an outgoing call. The method parameter is either of 0N/A * type java.lang.reflect.Method or java.rmi.server.Operation. 0N/A * Returns the class of the ref type to be serialized 0N/A return "UnicastRef";
0N/A * Write out external representation for remote ref. 0N/A * Read in external representation for remote ref. 0N/A * @exception ClassNotFoundException If the class for an object 0N/A * being restored cannot be found. 0N/A //----------------------------------------------------------------------; 0N/A * Method from object, forward from RemoteObject 0N/A * default implementation of hashCode for remote objects 0N/A /** default implementation of equals for remote objects