Package org.jgroups.protocols
Interface LocalTransport
-
public interface LocalTransportA 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LocalTransportdestroy()LocalTransportinit(TP transport)Calls after the local transport has been created.booleanisLocalMember(Address addr)Returns true if addr is a local member, false otherwiseLocalTransportresetStats()voidsendTo(Address dest, byte[] buf, int offset, int length)Sends a message to a given local member.voidsendToAll(byte[] buf, int offset, int length)Sends a message to all local members.LocalTransportstart()LocalTransportstop()LocalTransportviewChange(View v)
-
-
-
Method Detail
-
init
LocalTransport init(TP transport) throws java.lang.Exception
Calls after the local transport has been created.- Parameters:
transport- A reference to TP- Throws:
java.lang.Exception
-
start
LocalTransport start() throws java.lang.Exception
- Throws:
java.lang.Exception
-
stop
LocalTransport stop()
-
destroy
LocalTransport destroy()
-
resetStats
LocalTransport resetStats()
-
viewChange
LocalTransport viewChange(View v)
-
isLocalMember
boolean isLocalMember(Address addr)
Returns true if addr is a local member, false otherwise
-
sendTo
void sendTo(Address dest, byte[] buf, int offset, int length) throws java.lang.Exception
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:
java.lang.Exception- Thrown when the send failed, e.g. when dest isn't a local address.
-
sendToAll
void sendToAll(byte[] buf, int offset, int length) throws java.lang.ExceptionSends a message to all local members.- Parameters:
buf- The buffer to sendoffset- The offset at which the data startslength- The number of bytes to send- Throws:
java.lang.Exception- Thrown when the send failed.
-
-