FileDocCategorySizeDatePackage
ChannelInterceptorBase.javaAPI DocApache Tomcat 6.0.145683Fri Jul 20 04:20:32 BST 2007org.apache.catalina.tribes.group

ChannelInterceptorBase

public abstract class ChannelInterceptorBase extends Object implements org.apache.catalina.tribes.ChannelInterceptor
Abstract class for the interceptor base class.
author
Filip Hanik
version
$Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
protected static org.apache.juli.logging.Log
log
private org.apache.catalina.tribes.ChannelInterceptor
next
private org.apache.catalina.tribes.ChannelInterceptor
previous
protected int
optionFlag
Constructors Summary
public ChannelInterceptorBase()


      

    
Methods Summary
public booleanaccept(org.apache.catalina.tribes.ChannelMessage msg)

        return true;
    
public voidfireInterceptorEvent(InterceptorEvent event)

        //empty operation
    
public org.apache.catalina.tribes.MembergetLocalMember(boolean incAlive)
Return the member that represents this node.

return
Member

        if ( getNext()!=null ) return getNext().getLocalMember(incAlive);
        else return null;
    
public org.apache.catalina.tribes.MembergetMember(org.apache.catalina.tribes.Member mbr)

param
mbr Member
return
Member

        if ( getNext()!=null) return getNext().getMember(mbr);
        else return null;
    
public org.apache.catalina.tribes.Member[]getMembers()
Get all current cluster members

return
all members or empty array

        if ( getNext()!=null ) return getNext().getMembers();
        else return null;
    
public final org.apache.catalina.tribes.ChannelInterceptorgetNext()

        return next;
    
public intgetOptionFlag()

        return optionFlag;
    
public final org.apache.catalina.tribes.ChannelInterceptorgetPrevious()

        return previous;
    
public booleanhasMembers()
has members

        if ( getNext()!=null )return getNext().hasMembers();
        else return false;
    
public voidheartbeat()

        if (getNext() != null) getNext().heartbeat();
    
public voidmemberAdded(org.apache.catalina.tribes.Member member)

        //notify upwards
        if (getPrevious() != null) getPrevious().memberAdded(member);
    
public voidmemberDisappeared(org.apache.catalina.tribes.Member member)

        //notify upwards
        if (getPrevious() != null) getPrevious().memberDisappeared(member);
    
public voidmessageReceived(org.apache.catalina.tribes.ChannelMessage msg)

        if (getPrevious() != null) getPrevious().messageReceived(msg);
    
public booleanokToProcess(int messageFlags)

 
        if (this.optionFlag == 0 ) return true;
        return ((optionFlag&messageFlags) == optionFlag);
    
public voidsendMessage(org.apache.catalina.tribes.Member[] destination, org.apache.catalina.tribes.ChannelMessage msg, InterceptorPayload payload)

        if (getNext() != null) getNext().sendMessage(destination, msg, payload);
    
public final voidsetNext(org.apache.catalina.tribes.ChannelInterceptor next)

        this.next = next;
    
public voidsetOptionFlag(int optionFlag)

        this.optionFlag = optionFlag;
    
public final voidsetPrevious(org.apache.catalina.tribes.ChannelInterceptor previous)

        this.previous = previous;
    
public voidstart(int svc)
Starts up the channel. This can be called multiple times for individual services to start The svc parameter can be the logical or value of any constants

param
svc int value of
DEFAULT - will start all services
MBR_RX_SEQ - starts the membership receiver
MBR_TX_SEQ - starts the membership broadcaster
SND_TX_SEQ - starts the replication transmitter
SND_RX_SEQ - starts the replication receiver
throws
ChannelException if a startup error occurs or the service is already started.

        if ( getNext()!=null ) getNext().start(svc);
    
public voidstop(int svc)
Shuts down the channel. This can be called multiple times for individual services to shutdown The svc parameter can be the logical or value of any constants

param
svc int value of
DEFAULT - will shutdown all services
MBR_RX_SEQ - stops the membership receiver
MBR_TX_SEQ - stops the membership broadcaster
SND_TX_SEQ - stops the replication transmitter
SND_RX_SEQ - stops the replication receiver
throws
ChannelException if a startup error occurs or the service is already started.

        if (getNext() != null) getNext().stop(svc);