net.jini.jeri
Interface ObjectEndpoint

All Known Implementing Classes:
BasicObjectEndpoint

public interface ObjectEndpoint

References a remote object at a remote communication endpoint to send requests to.

An ObjectEndpoint instance contains the information necessary to identify the remote object and to send requests to the remote object.

The newCall method can be used to send a request to the remote object that this object references.

Since:
2.0
Author:
Sun Microsystems, Inc.

Method Summary
 RemoteException executeCall(OutboundRequest call)
          Synchronously executes a remote call in progress to the identified remote object, so that the response can be read.
 OutboundRequestIterator newCall(InvocationConstraints constraints)
          Returns an OutboundRequestIterator to use to send a new remote call to the referenced remote object using the specified constraints.
 

Method Detail

newCall

OutboundRequestIterator newCall(InvocationConstraints constraints)
Returns an OutboundRequestIterator to use to send a new remote call to the referenced remote object using the specified constraints.

The constraints must be the complete, absolute constraints for the remote call, combining any client and server constraints for the remote method being invoked, with no relative time constraints.

For each OutboundRequest produced by the returned OutboundRequestIterator, after writing the request data and before reading any response data, executeCall must be invoked to execute the call.

Parameters:
constraints - the complete, absolute constraints
Returns:
an OutboundRequestIterator to use to send a new remote call to the referenced remote object
Throws:
NullPointerException - if constraints is null

executeCall

RemoteException executeCall(OutboundRequest call)
                            throws IOException
Synchronously executes a remote call in progress to the identified remote object, so that the response can be read.

This method should be passed an OutboundRequest that was produced by an OutboundRequestIterator returned from this object's newCall method. This method must be invoked after writing the request data to and before reading any response data from the OutboundRequest.

If the remote call was successfully executed (such that the response data may now be read) this method returns null. This method returns a non-null RemoteException to indicate a RemoteException that the remote call should fail with. For example, if the referenced object does not exist at the remote endpoint, a NoSuchObjectException will be returned. This method throws an IOException for other communication failures.

Parameters:
call - the remote call to execute, produced by an OutboundRequestIterator that was returned from newCall
Returns:
null on success, or a RemoteException if the remote call should fail with that RemoteException
Throws:
IOException - if an I/O exception occurs while performing this operation
NullPointerException - if call is null


Copyright 2007, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.