Package com.gigaspaces.lrmi
Interface Peer
- All Known Subinterfaces:
ClientPeer,ServerPeer
- All Known Implementing Classes:
BaseClientPeer,BaseServerPeer,ConnectionResource,CPeer,SPeer
public interface Peer
Peer is an abstraction for a connection endpoint, similar to a socket in the TCP/IP world.
Peer is extended by the ClientPeer and ServerPeer interfaces.
Each LRMI logical connection is abstracted by a pair of ClientPeer and ServerPeer. Physical
connections may be shared (this is implementation dependent).
Each connection has a timeout attribute, for network oriented operations (connect, invoke,
read).
Each connection may have a security context property. A security context is an object that may be
passed by the protocol adapter provider from a client peer to a server peer in an invocation. A
client peer usually sets the security context of its peer, and the server can retreieve it.
Sophisticated protocol adapter implementations can use a caching mechanism of the security
context on the server peer, forwarding a new security context only upon change of the client
security context.
- Since:
- 4.0
- Author:
- Igor Goldenberg
-
Method Summary
Modifier and TypeMethodDescriptionvoidDisconnects, effectively closes the connection.<C extends ClientPeer>
ProtocolAdapter<C>Returns the protocol adapter that created this peer.booleanChecks if the current peer is in 'connected' state.
-
Method Details
-
isConnected
boolean isConnected()Checks if the current peer is in 'connected' state.- Returns:
trueif connected,falseotherwise.
-
disconnect
void disconnect()Disconnects, effectively closes the connection.- Throws:
RemoteException- if there was a problem with closing the connection.
-
getProtocolAdapter
Returns the protocol adapter that created this peer.- Returns:
- the protocol adapter that created this peer.
-