|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 static Log |
log
|
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 static Log log
protected int optionFlag
Constructor Detail |
---|
public ChannelInterceptorBase()
Method Detail |
---|
public boolean okToProcess(int messageFlags)
public final void setNext(ChannelInterceptor next)
ChannelInterceptor
setNext
in interface ChannelInterceptor
next
- ChannelInterceptorpublic final ChannelInterceptor getNext()
ChannelInterceptor
getNext
in interface ChannelInterceptor
public final void setPrevious(ChannelInterceptor previous)
ChannelInterceptor
setPrevious
in interface ChannelInterceptor
previous
- ChannelInterceptorpublic void setOptionFlag(int optionFlag)
ChannelInterceptor
setOptionFlag
in interface ChannelInterceptor
optionFlag
- intChannelInterceptor.getOptionFlag()
public final ChannelInterceptor getPrevious()
ChannelInterceptor
getPrevious
in interface ChannelInterceptor
public int getOptionFlag()
ChannelInterceptor
boolean react = (getOptionFlag() == (getOptionFlag() & ChannelMessage.getOptions()));
getOptionFlag
in interface ChannelInterceptor
ChannelMessage.getOptions()
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
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
ChannelException
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
msg
- ChannelMessagepublic boolean accept(ChannelMessage msg)
public void memberAdded(Member member)
MembershipListener
memberAdded
in interface MembershipListener
member
- Member - the member that was addedpublic void memberDisappeared(Member member)
MembershipListener
memberDisappeared
in interface MembershipListener
member
- MemberMember.SHUTDOWN_PAYLOAD
public void heartbeat()
ChannelInterceptor
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 ChannelInterceptor
heartbeat
in interface Heartbeat
public boolean hasMembers()
hasMembers
in interface ChannelInterceptor
Channel.hasMembers()
public Member[] getMembers()
getMembers
in interface ChannelInterceptor
Channel.getMembers()
public Member getMember(Member mbr)
ChannelInterceptor
getMember
in interface ChannelInterceptor
mbr
- Member
Channel.getMember(Member)
public Member getLocalMember(boolean incAlive)
getLocalMember
in interface ChannelInterceptor
incAlive
- boolean
Channel.getLocalMember(boolean)
public void start(int svc) throws ChannelException
start
in interface ChannelInterceptor
svc
- 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 ChannelInterceptor
svc
- int value of ChannelException
- if a startup error occurs or the service is already started.Channel
public void fireInterceptorEvent(ChannelInterceptor.InterceptorEvent event)
fireInterceptorEvent
in interface ChannelInterceptor
|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |