org.apache.catalina.tribes
public interface ChannelInterceptor extends MembershipListener, Heartbeat
Version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $
See Also: ChannelInterceptorBase
Nested Class Summary | |
---|---|
static interface | ChannelInterceptor.InterceptorEvent |
Method Summary | |
---|---|
void | fireInterceptorEvent(ChannelInterceptor.InterceptorEvent event) |
Member | getLocalMember(boolean incAliveTime)
Intercepts the code>Channel.getLocalMember(boolean) method |
Member | getMember(Member mbr)
Intercepts the code>Channel.getMember(Member) method |
Member[] | getMembers()
Intercepts the code>Channel.getMembers() method |
ChannelInterceptor | getNext()
Retrieve the next interceptor in the list |
int | getOptionFlag()
An interceptor can react to a message based on a set bit on the
message options. |
ChannelInterceptor | getPrevious()
Retrieve the previous interceptor in the list |
boolean | hasMembers()
Intercepts the Channel.hasMembers() method |
void | heartbeat()
The heartbeat() method gets invoked periodically
to allow interceptors to clean up resources, time out object and
perform actions that are unrelated to sending/receiving data. |
void | messageReceived(ChannelMessage data)
the messageReceived is invoked when a message is received.
|
void | sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload)
The sendMessage method is called when a message is being sent to one more destinations.
|
void | setNext(ChannelInterceptor next)
Set the next interceptor in the list of interceptors |
void | setOptionFlag(int flag)
Sets the option flag |
void | setPrevious(ChannelInterceptor previous)
Set the previous interceptor in the list |
void | start(int svc)
Starts up the channel. |
void | stop(int svc)
Shuts down the channel. |
Parameters: incAliveTime boolean
Returns: Member
See Also: Channel
Parameters: mbr Member
Returns: Member - the actual member information, including stay alive
See Also: getMember
Returns: Member[]
See Also: getMembers
Returns: ChannelInterceptor - returns the next interceptor in the list or null if no more interceptors exist
boolean react = (getOptionFlag() == (getOptionFlag() & ChannelMessage.getOptions()));
Returns: int
See Also: getOptions
Returns: ChannelInterceptor - returns the previous interceptor in the list or null if no more interceptors exist
Channel.hasMembers()
methodReturns: boolean - if the channel has members in its membership group
See Also: hasMembers
heartbeat()
method gets invoked periodically
to allow interceptors to clean up resources, time out object and
perform actions that are unrelated to sending/receiving data.messageReceived
is invoked when a message is received.
ChannelMessage.getAddress()
is the sender, or the reply-to address
if it has been overwritten.Parameters: data ChannelMessage
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)
Parameters: destination Member[] - the destination for this message msg ChannelMessage - the message to be sent payload InterceptorPayload - the payload, carrying an error handler and future useful data, can be null
Throws: ChannelException
See Also: ErrorHandler InterceptorPayload
Parameters: next ChannelInterceptor
Parameters: flag int
See Also: getOptionFlag
Parameters: previous ChannelInterceptor
Parameters: svc int value of
Channel.DEFAULT - will start all services
Channel.MBR_RX_SEQ - starts the membership receiver
Channel.MBR_TX_SEQ - starts the membership broadcaster
Channel.SND_TX_SEQ - starts the replication transmitter
Channel.SND_RX_SEQ - starts the replication receiver
Throws: ChannelException if a startup error occurs or the service is already started.
See Also: Channel
Parameters: svc int value of
Channel.DEFAULT - will shutdown all services
Channel.MBR_RX_SEQ - stops the membership receiver
Channel.MBR_TX_SEQ - stops the membership broadcaster
Channel.SND_TX_SEQ - stops the replication transmitter
Channel.SND_RX_SEQ - stops the replication receiver
Throws: ChannelException if a startup error occurs or the service is already started.
See Also: Channel