javax.microedition.jcrmi
Interface RemoteRef


public interface RemoteRef

The interface RemoteRef represents the handle for a remote object. Each stub contains an instance of RemoteRef. RemoteRef contains the concrete representation of a reference. This remote reference is used to carry out remote calls on the remote object for which it is a reference.

Since:
BlackBerry API 4.2.1

Method Summary
 Object invoke(String method, Object[] params)
          Invokes a remote method.
 boolean remoteEquals(RemoteRef remoteref)
          Compares two remote references.
 int remoteHashCode()
          Returns a hashcode for a remote object.
 



Method Detail

invoke

Object invoke(String method,
              Object[] params)
              throws Exception
Invokes a remote method.

A remote method invocation consists of three steps: 1. Marshall the representation for the method and parameters. 2. Communicate the method invocation to the host and unmarshall the return value or exception returned. 3. Return the result of the method invocation to the caller.

The remote method invoked on the card can throw an exception to signal that an unexpected condition has been detected.

If the exception thrown on the card is an exception defined in the Java Card 2.2 API, then the same exception is thrown to the stub method. The client can access the reason code associated with Java Cardspecific exceptions using the standard getReason() method.

If the exception thrown on the card is a subclass of an exception defined in the Java Card 2.2 API, then the closest exception defined in the API (along with the reason code, if applicable) is thrown to the stub method. The detail message string of the exception object may indicate that exception subclass was thrown on the card.

Apart from the exceptions thrown by the remote method itself, errors during communication, marshalling, protocol handling, unmarshalling, stub object instantiation, and so on, related to the JCRMI method invocation, results in a RemoteException being thrown to the stub method.

Parameters:
method - The simple (not fully qualified) name of the method followed by the method descriptor
params - The parameter list
Returns:
result of remote method invocation
Throws:
Exception
Since:
BlackBerry API 4.2.1

remoteEquals

boolean remoteEquals(RemoteRef remoteref)
Compares two remote references. Two remote references are equal if they refer to the same remote object.

Parameters:
remoteref - the Object to compare with
Returns:
true if these Objects are equal; false otherwise
Since:
BlackBerry API 4.2.1

remoteHashCode

int remoteHashCode()
Returns a hashcode for a remote object. Two remote object stubs that refer to the same remote object will have the same hash code.

Returns:
the remote object hashcode
Since:
BlackBerry API 4.2.1





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal