Interface ClientPeer

All Superinterfaces:
Peer
All Known Implementing Classes:
BaseClientPeer, ConnectionResource, CPeer

public interface ClientPeer extends Peer
ClientPeer extends Peer with client-specific operations.

A client peer is maintaining a logical connection with a remote object with a unique id. The client peer usually connects to the server peer, invokes operations on the remote object using the server peer, and disconnects.

A pair of getter/setter methods control connection retries.

The connection itself is URL based. The connection URL is protocol adapter specific, but it usually has the following format:

://:/<remote-object-id-string>

A client can obtain the connection URL from a directory service, via e-mail or in some other way. The client can save the connection URL and connect to the same logical remote object at a later time.

Since:
4.0
Author:
Igor Goldenberg
  • Method Details

    • init

      void init(ITransportConfig config)
    • connect

      void connect(String connectionURL, LRMIMethod lrmiMethod) throws MalformedURLException, RemoteException
      Connects to the remote server peer.
      Parameters:
      connectionURL - usually of the form ://:/<remote-object-id-string>
      Throws:
      MalformedURLException - if the URL is not understood by the implementation
      RemoteException
    • getConnectionURL

      String getConnectionURL()
      Returns the connection URL associated with this peer.
      Returns:
      the connection URL associated with this peer.
    • getConnectRetries

      int getConnectRetries()
      Returns the number of connection retries associated with this peer.
      Returns:
      the number of connection retries associated with this peer.
    • setConnectRetries

      void setConnectRetries(int connectRetries)
      Sets the number of connection retries associated with this peer.
    • invoke

      Invokes a method on the remote object this peer is connected to. This method should propagate the methodName, arguments and security context associated with this peer (if exists), in a protocol specific format to the remote server peer, and return the result to the caller.
      Parameters:
      lrmiMethod - contains necessary information about invocation remote call
      args - arguments to the method
      Throws:
      ProtocolException - a result of a remote method invocation is thrown while unmarshalling the arguments or de/serialization request/reply packet.
      RemoteException - failed to open/close connection with remote endpoint.
      ApplicationException
      InterruptedException
    • getObjectId

      long getObjectId()
    • setObjectId

      void setObjectId(long objectId)
    • sendKeepAlive

      boolean sendKeepAlive()
      Send keep alive request to server
      Returns:
      true if keep alive was sent successfully