Top Description Fields Constructors Methods
sun.rmi.server

public Class UnicastRef

extends Object
implements RemoteRef
Class Inheritance
All Implemented Interfaces
java.rmi.server.RemoteRef, java.io.Externalizable, java.io.Serializable
Known Direct Subclasses
sun.rmi.server.UnicastRef2, sun.rmi.server.UnicastServerRef
Annotations
@SuppressWarnings:deprecation
Imports
java.io.IOException, .ObjectInput, .ObjectInputStream, .ObjectOutput, java.lang.reflect.Method, java.rmi.MarshalException, .Remote, .RemoteException, .UnmarshalException, java.rmi.server.Operation, .RemoteCall, .RemoteObject, .RemoteRef, java.security.AccessController, .PrivilegedAction, jdk.internal.access.SharedSecrets, sun.rmi.runtime.Log, sun.rmi.transport.Connection, .LiveRef, .StreamRemoteCall

Note

There is a JDK-internal dependency on the existence of this class's getLiveRef method (as it is inherited by UnicastRef2) in the implementation of javax.management.remote.rmi.RMIConnector.

Field Summary

Modifier and TypeField and Description
public static final Log
clientCallLog

Client-side call log.

public static final Log
clientRefLog

Client-side transport log.

protected LiveRef
private static final long

Constructor Summary

AccessConstructor and Description
public
UnicastRef()

Create a new (empty) Unicast remote reference.

public
UnicastRef(LiveRef liveRef)

Create a new Unicast RemoteRef.

Method Summary

Modifier and TypeMethod and Description
public void
done(RemoteCall
object representing remote call
call
)

Implements java.rmi.server.RemoteRef.done.

References Deprecated RemoteCall is deprecated or references (maybe indirectly) at least one deprecated element.

Done should only be called if the invoke returns successfully (non-exceptionally) to the stub.

private void
free(RemoteCall call, boolean reuse)
References Deprecated RemoteCall is deprecated or references (maybe indirectly) at least one deprecated element.

Private method to free a connection.

public LiveRef
getLiveRef()

Returns the current value of this UnicastRef's underlying LiveRef.

public String
getRefClass(ObjectOutput
the output stream to which the reference will be serialized
out
)

Implements java.rmi.server.RemoteRef.getRefClass.

Returns the class of the ref type to be serialized

public Object
invoke(Remote
the proxy for the remote object
obj
,
Method
the method to be invoked
method
,
Object[]
the parameter list
params
,
long
a hash that may be used to represent the method
opnum
)

Implements java.rmi.server.RemoteRef.invoke.

Invoke a method.

public void
invoke(RemoteCall
object representing remote call
call
)

Implements java.rmi.server.RemoteRef.invoke.

References Deprecated RemoteCall is deprecated or references (maybe indirectly) at least one deprecated element.

Invoke makes the remote call present in the RemoteCall object.

pack-priv void
logClientCall(Object obj, Object method)

Log the details of an outgoing call.

protected void
protected static void
marshalValue(Class<?> type, Object value, ObjectOutput out)

Marshal value to an ObjectOutput sink using RMI's serialization format for parameters or return values.

public RemoteCall
newCall(RemoteObject
remote stub through which to make call
obj
,
Operation[]
array of stub operations
ops
,
int
operation number
opnum
,
long
stub/skeleton interface hash
hash
)

Implements java.rmi.server.RemoteRef.newCall.

References Deprecated Operation and RemoteCall are deprecated or reference (maybe indirectly) at least one deprecated element.

Create an appropriate call object for a new call on this object.

public void
readExternal(ObjectInput
the stream to read data from in order to restore the object
in
)

Implements java.io.Externalizable.readExternal.

Read in external representation for remote ref.

public boolean
remoteEquals(RemoteRef
the Object to compare with
sub
)

Implements java.rmi.server.RemoteRef.remoteEquals.

default implementation of equals for remote objects

public int
remoteHashCode()

Implements java.rmi.server.RemoteRef.remoteHashCode.

default implementation of hashCode for remote objects

public String
remoteToString()

Implements java.rmi.server.RemoteRef.remoteToString.

Method from object, forward from RemoteObject

protected static Object
unmarshalValue(Class<?> type, ObjectInput in)

Unmarshal value from an ObjectInput source using RMI's serialization format for parameters or return values.

public void
writeExternal(ObjectOutput
the stream to write the object to
out
)

Implements java.io.Externalizable.writeExternal.

Write out external representation for remote ref.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientCallLogback to summary
public static final Log clientCallLog

Client-side call log.

Annotations
@SuppressWarnings:removal
clientRefLogback to summary
public static final Log clientRefLog

Client-side transport log.

refback to summary
protected LiveRef ref
Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.rmi.server.RemoteRef.serialVersionUID.

Constructor Detail

UnicastRefback to summary
public UnicastRef()

Create a new (empty) Unicast remote reference.

UnicastRefback to summary
public UnicastRef(LiveRef liveRef)

Create a new Unicast RemoteRef.

Method Detail

doneback to summary
public void done(RemoteCall call) throws RemoteException

Implements java.rmi.server.RemoteRef.done.

References Deprecated

RemoteCall is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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.

Parameters
call:RemoteCall

Doc from java.rmi.server.RemoteRef.done.

object representing remote call

Exceptions
RemoteException:

Doc from java.rmi.server.RemoteRef.done.

if remote error occurs during call cleanup

freeback to summary
private void free(RemoteCall call, boolean reuse) throws RemoteException

References Deprecated

RemoteCall is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Private method to free a connection.

getLiveRefback to summary
public LiveRef getLiveRef()

Returns the current value of this UnicastRef's underlying LiveRef.

Note

There is a JDK-internal dependency on the existence of this method (as it is inherited by UnicastRef) in the implementation of javax.management.remote.rmi.RMIConnector.

getRefClassback to summary
public String getRefClass(ObjectOutput out)

Implements java.rmi.server.RemoteRef.getRefClass.

Returns the class of the ref type to be serialized

Parameters
out:ObjectOutput

Doc from java.rmi.server.RemoteRef.getRefClass.

the output stream to which the reference will be serialized

Returns:String

Doc from java.rmi.server.RemoteRef.getRefClass.

the class name (without package qualification) of the reference type

invokeback to summary
public Object invoke(Remote obj, Method method, Object[] params, long opnum) throws Exception

Implements java.rmi.server.RemoteRef.invoke.

Invoke a method. This form of delegating method invocation to the reference allows the reference to take care of setting up the connection to the remote host, marshalling some representation for the method and parameters, then communicating the method invocation to the remote host. This method either returns the result of a method invocation on the remote object which resides on the remote host or throws a RemoteException if the call failed or an application-level exception if the remote invocation throws an exception.

Parameters
obj:Remote

the proxy for the remote object

method:Method

the method to be invoked

params:Object[]

the parameter list

opnum:long

a hash that may be used to represent the method

Returns:Object

Doc from java.rmi.server.RemoteRef.invoke.

result of remote method invocation

Exceptions
Exception:

Doc from java.rmi.server.RemoteRef.invoke.

if any exception occurs during remote method invocation

Since
1.2
invokeback to summary
public void invoke(RemoteCall call) throws Exception

Implements java.rmi.server.RemoteRef.invoke.

References Deprecated

RemoteCall is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Invoke makes the remote call present in the RemoteCall object. Invoke will raise any "user" exceptions which should pass through and not be caught by the stub. If any exception is raised during the remote invocation, invoke should take care of cleaning up the connection before raising the "user" or remote exception.

Parameters
call:RemoteCall

Doc from java.rmi.server.RemoteRef.invoke.

object representing remote call

Exceptions
Exception:

Doc from java.rmi.server.RemoteRef.invoke.

if any exception occurs during remote method

logClientCallback to summary
pack-priv void logClientCall(Object obj, Object method)

Log the details of an outgoing call. The method parameter is either of type java.lang.reflect.Method or java.rmi.server.Operation.

marshalCustomCallDataback to summary
protected void marshalCustomCallData(ObjectOutput out) throws IOException
marshalValueback to summary
protected static void marshalValue(Class<?> type, Object value, ObjectOutput out) throws IOException

Marshal value to an ObjectOutput sink using RMI's serialization format for parameters or return values.

newCallback to summary
public RemoteCall newCall(RemoteObject obj, Operation[] ops, int opnum, long hash) throws RemoteException

Implements java.rmi.server.RemoteRef.newCall.

References Deprecated

Operation and RemoteCall are deprecated or reference (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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.

Parameters
obj:RemoteObject

Doc from java.rmi.server.RemoteRef.newCall.

remote stub through which to make call

ops:Operation[]

Doc from java.rmi.server.RemoteRef.newCall.

array of stub operations

opnum:int

Doc from java.rmi.server.RemoteRef.newCall.

operation number

hash:long

Doc from java.rmi.server.RemoteRef.newCall.

stub/skeleton interface hash

Returns:RemoteCall

Doc from java.rmi.server.RemoteRef.newCall.

call object representing remote call

Exceptions
RemoteException:

Doc from java.rmi.server.RemoteRef.newCall.

if failed to initiate new remote call

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Read in external representation for remote ref.

Parameters
in:ObjectInput

Doc from java.io.Externalizable.readExternal.

the stream to read data from in order to restore the object

Exceptions
IOException:

Doc from java.io.Externalizable.readExternal.

if I/O errors occur

ClassNotFoundException:
If the class for an object being restored cannot be found.
remoteEqualsback to summary
public boolean remoteEquals(RemoteRef sub)

Implements java.rmi.server.RemoteRef.remoteEquals.

default implementation of equals for remote objects

Parameters
sub:RemoteRef

Doc from java.rmi.server.RemoteRef.remoteEquals.

the Object to compare with

Returns:boolean

Doc from java.rmi.server.RemoteRef.remoteEquals.

true if these Objects are equal; false otherwise.

remoteHashCodeback to summary
public int remoteHashCode()

Implements java.rmi.server.RemoteRef.remoteHashCode.

default implementation of hashCode for remote objects

Returns:int

Doc from java.rmi.server.RemoteRef.remoteHashCode.

remote object hashcode

remoteToStringback to summary
public String remoteToString()

Implements java.rmi.server.RemoteRef.remoteToString.

Method from object, forward from RemoteObject

Returns:String

Doc from java.rmi.server.RemoteRef.remoteToString.

string representing remote object reference

unmarshalValueback to summary
protected static Object unmarshalValue(Class<?> type, ObjectInput in) throws IOException, ClassNotFoundException

Unmarshal value from an ObjectInput source using RMI's serialization format for parameters or return values.

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Write out external representation for remote ref.

Parameters
out:ObjectOutput

Doc from java.io.Externalizable.writeExternal.

the stream to write the object to

Exceptions
IOException:

Doc from java.io.Externalizable.writeExternal.

Includes any I/O exceptions that may occur