Interface LocalTransport
public interface LocalTransport
A local transport is used for sending messages only to single (or all) members of the same host.
- Since:
- 5.2.0
- Author:
- Bela Ban
-
Method Summary
Modifier and TypeMethodDescriptiondestroy()Calls after the local transport has been created.booleanisLocalMember(Address addr) Returns true if addr is a local member, false otherwisevoidSends a message to a given local member.default voidsendTo(Address dest, ByteBuffer buf) voidsendToAll(byte[] buf, int offset, int length) Sends a message to all local members.default voidsendToAll(ByteBuffer buf) start()stop()viewChange(View v)
-
Method Details
-
init
Calls after the local transport has been created.- Parameters:
transport- A reference to TP- Throws:
Exception
-
start
- Throws:
Exception
-
stop
LocalTransport stop() -
destroy
LocalTransport destroy() -
resetStats
LocalTransport resetStats() -
viewChange
-
isLocalMember
Returns true if addr is a local member, false otherwise -
sendTo
Sends a message to a given local member. The caller should check before whether dest is a local member; an implementation is not required to do so, but may nevertheless perform the check (and throw an exception if the destination is not local).- Parameters:
dest- The address of the member to which to send the message. Must be non-nullbuf- The buffer to sendoffset- The offset at which the data startslength- The number of bytes to send- Throws:
Exception- Thrown when the send failed, e.g. when dest isn't a local address.
-
sendTo
- Throws:
Exception
-
sendToAll
-
sendToAll
- Throws:
Exception
-