| 
Apache Tomcat 7.0.28 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.catalina.tribes.group.ChannelInterceptorBase
public abstract class ChannelInterceptorBase
Abstract class for the interceptor base class.
| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from interface org.apache.catalina.tribes.ChannelInterceptor | 
|---|
ChannelInterceptor.InterceptorEvent | 
| Field Summary | |
|---|---|
protected  int | 
optionFlag
 | 
| Constructor Summary | |
|---|---|
ChannelInterceptorBase()
 | 
|
| Method Summary | |
|---|---|
 boolean | 
accept(ChannelMessage msg)
 | 
 void | 
fireInterceptorEvent(ChannelInterceptor.InterceptorEvent event)
 | 
 Member | 
getLocalMember(boolean incAlive)
Return the member that represents this node.  | 
 Member | 
getMember(Member mbr)
Intercepts the code>Channel.getMember(Member) method  | 
 Member[] | 
getMembers()
Get all current cluster members  | 
 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()
has members  | 
 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 | 
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. | 
 boolean | 
okToProcess(int messageFlags)
 | 
 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 optionFlag)
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 class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected int optionFlag
| Constructor Detail | 
|---|
public ChannelInterceptorBase()
| Method Detail | 
|---|
public boolean okToProcess(int messageFlags)
public final void setNext(ChannelInterceptor next)
ChannelInterceptor
setNext in interface ChannelInterceptornext - ChannelInterceptorpublic final ChannelInterceptor getNext()
ChannelInterceptor
getNext in interface ChannelInterceptorpublic final void setPrevious(ChannelInterceptor previous)
ChannelInterceptor
setPrevious in interface ChannelInterceptorprevious - ChannelInterceptorpublic void setOptionFlag(int optionFlag)
ChannelInterceptor
setOptionFlag in interface ChannelInterceptoroptionFlag - intChannelInterceptor.getOptionFlag()public final ChannelInterceptor getPrevious()
ChannelInterceptor
getPrevious in interface ChannelInterceptorpublic int getOptionFlag()
ChannelInterceptorboolean react = (getOptionFlag() == (getOptionFlag() & ChannelMessage.getOptions()));
getOptionFlag in interface ChannelInterceptorChannelMessage.getOptions()
public void sendMessage(Member[] destination,
                        ChannelMessage msg,
                        InterceptorPayload payload)
                 throws ChannelException
ChannelInterceptorsendMessage 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 ChannelInterceptordestination - 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, 
InterceptorPayloadpublic void messageReceived(ChannelMessage msg)
ChannelInterceptormessageReceived 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 ChannelInterceptormsg - ChannelMessagepublic boolean accept(ChannelMessage msg)
public void memberAdded(Member member)
MembershipListener
memberAdded in interface MembershipListenermember - Member - the member that was addedpublic void memberDisappeared(Member member)
MembershipListener
memberDisappeared in interface MembershipListenermember - MemberMember.SHUTDOWN_PAYLOADpublic void heartbeat()
ChannelInterceptorheartbeat() 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 ChannelInterceptorheartbeat in interface Heartbeatpublic boolean hasMembers()
hasMembers in interface ChannelInterceptorChannel.hasMembers()public Member[] getMembers()
getMembers in interface ChannelInterceptorChannel.getMembers()public Member getMember(Member mbr)
ChannelInterceptor
getMember in interface ChannelInterceptormbr - Member
Channel.getMember(Member)public Member getLocalMember(boolean incAlive)
getLocalMember in interface ChannelInterceptorincAlive - boolean
Channel.getLocalMember(boolean)
public void start(int svc)
           throws ChannelException
start in interface ChannelInterceptorsvc - int value of ChannelException - if a startup error occurs or the service is already started.Channel
public void stop(int svc)
          throws ChannelException
stop in interface ChannelInterceptorsvc - int value of ChannelException - if a startup error occurs or the service is already started.Channelpublic void fireInterceptorEvent(ChannelInterceptor.InterceptorEvent event)
fireInterceptorEvent in interface ChannelInterceptor
  | 
Apache Tomcat 7.0.28 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||