public class OrderInterceptor extends ChannelInterceptorBase
Modifier and Type | Class and Description |
---|---|
protected static class |
OrderInterceptor.Counter |
protected static class |
OrderInterceptor.MessageOrder |
ChannelInterceptor.InterceptorEvent
Modifier and Type | Field and Description |
---|---|
protected static StringManager |
sm |
optionFlag
Constructor and Description |
---|
OrderInterceptor() |
Modifier and Type | Method and Description |
---|---|
long |
getExpire() |
boolean |
getForwardExpired() |
protected OrderInterceptor.Counter |
getInCounter(Member mbr) |
int |
getMaxQueue() |
protected OrderInterceptor.Counter |
getOutCounter(Member mbr) |
protected int |
incCounter(Member mbr) |
void |
memberAdded(Member member)
A member was added to the group
|
void |
memberDisappeared(Member member)
A member was removed from the group
If the member left voluntarily, the Member.getCommand will contain the Member.SHUTDOWN_PAYLOAD data |
void |
messageReceived(ChannelMessage msg)
the
messageReceived is invoked when a message is received. |
protected boolean |
processIncoming(OrderInterceptor.MessageOrder order) |
protected void |
processLeftOvers(Member member,
boolean force) |
void |
sendMessage(Member[] destination,
ChannelMessage msg,
InterceptorPayload payload)
The
sendMessage method is called when a message is being sent to one more destinations. |
void |
setExpire(long expire) |
void |
setForwardExpired(boolean forwardExpired) |
void |
setMaxQueue(int maxQueue) |
fireInterceptorEvent, getChannel, getLocalMember, getMember, getMembers, getNext, getOptionFlag, getPrevious, hasMembers, heartbeat, okToProcess, setChannel, setNext, setOptionFlag, setPrevious, start, stop
protected static final StringManager sm
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException
ChannelInterceptor
sendMessage
method is called when a message is being sent to one more destinations.
The interceptor can modify any of the parameters and then pass on the message down the stack by
invoking getNext().sendMessage(destination,msg,payload)
getNext().sendMessage(destination,msg,payload)
sendMessage
in interface ChannelInterceptor
sendMessage
in class ChannelInterceptorBase
destination
- Member[] - the destination for this messagemsg
- ChannelMessage - the message to be sentpayload
- InterceptorPayload - the payload, carrying an error handler and future useful data, can be nullChannelException
ErrorHandler
,
InterceptorPayload
public void messageReceived(ChannelMessage msg)
ChannelInterceptor
messageReceived
is invoked when a message is received.
ChannelMessage.getAddress()
is the sender, or the reply-to address
if it has been overwritten.messageReceived
in interface ChannelInterceptor
messageReceived
in class ChannelInterceptorBase
msg
- ChannelMessageprotected void processLeftOvers(Member member, boolean force)
protected boolean processIncoming(OrderInterceptor.MessageOrder order)
order
- MessageOrderpublic void memberAdded(Member member)
MembershipListener
memberAdded
in interface MembershipListener
memberAdded
in class ChannelInterceptorBase
member
- Member - the member that was addedpublic void memberDisappeared(Member member)
MembershipListener
memberDisappeared
in interface MembershipListener
memberDisappeared
in class ChannelInterceptorBase
member
- MemberMember.SHUTDOWN_PAYLOAD
protected int incCounter(Member mbr)
protected OrderInterceptor.Counter getInCounter(Member mbr)
protected OrderInterceptor.Counter getOutCounter(Member mbr)
public void setExpire(long expire)
public void setForwardExpired(boolean forwardExpired)
public void setMaxQueue(int maxQueue)
public long getExpire()
public boolean getForwardExpired()
public int getMaxQueue()
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.