| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ChannelInterceptor
A ChannelInterceptor is an interceptor that intercepts 
 messages and membership messages in the channel stack.
 This allows interceptors to modify the message or perform
 other actions when a message is sent or received.
 Interceptors are tied together in a linked list.
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 messageReceivedis invoked when a message is received. | 
|  void | sendMessage(Member[] destination,
            ChannelMessage msg,
            InterceptorPayload payload)The sendMessagemethod 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. | 
| Methods inherited from interface org.apache.catalina.tribes.MembershipListener | 
|---|
| memberAdded, memberDisappeared | 
| Method Detail | 
|---|
int getOptionFlag()
boolean react = (getOptionFlag() == (getOptionFlag() & ChannelMessage.getOptions()));
ChannelMessage.getOptions()void setOptionFlag(int flag)
flag - intgetOptionFlag()void setNext(ChannelInterceptor next)
next - ChannelInterceptorChannelInterceptor getNext()
void setPrevious(ChannelInterceptor previous)
previous - ChannelInterceptorChannelInterceptor getPrevious()
void sendMessage(Member[] destination,
                 ChannelMessage msg,
                 InterceptorPayload payload)
                 throws ChannelException
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)
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 null
ChannelExceptionErrorHandler, 
InterceptorPayloadvoid messageReceived(ChannelMessage data)
messageReceived is invoked when a message is received.
 ChannelMessage.getAddress() is the sender, or the reply-to address
 if it has been overwritten.
data - ChannelMessagevoid heartbeat()
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.
heartbeat in interface Heartbeatboolean hasMembers()
Channel.hasMembers() method
Channel.hasMembers()Member[] getMembers()
Channel.getMembers()Member getLocalMember(boolean incAliveTime)
incAliveTime - boolean
Channel.getLocalMember(boolean)Member getMember(Member mbr)
mbr - Member
Channel.getMember(Member)
void start(int svc)
           throws ChannelException
svc - int value of ChannelException - if a startup error occurs or the service is already started.Channel
void stop(int svc)
          throws ChannelException
svc - int value of ChannelException - if a startup error occurs or the service is already started.Channelvoid fireInterceptorEvent(ChannelInterceptor.InterceptorEvent event)
| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||