FileDocCategorySizeDatePackage
SenderState.javaAPI DocApache Tomcat 6.0.143149Fri Jul 20 04:20:34 BST 2007org.apache.catalina.tribes.transport

SenderState

public class SenderState extends Object
author
Filip Hanik
version
1.0
since
5.5.16

Fields Summary
public static final int
READY
public static final int
SUSPECT
public static final int
FAILING
private static final String
info
The descriptive information about this implementation.
protected static HashMap
memberStates
private int
state
Constructors Summary
private SenderState()


    //  ----------------------------------------------------- Constructor

    
      
        this(READY);
    
private SenderState(int state)

        this.state = state;
    
Methods Summary
public static org.apache.catalina.tribes.transport.SenderStategetSenderState(org.apache.catalina.tribes.Member member)

    
         
        return getSenderState(member,true);
    
public static org.apache.catalina.tribes.transport.SenderStategetSenderState(org.apache.catalina.tribes.Member member, boolean create)

        SenderState state = (SenderState)memberStates.get(member);
        if ( state == null && create) {
            synchronized ( memberStates ) {
                state = (SenderState)memberStates.get(member);
                if ( state == null ) {
                    state = new SenderState();
                    memberStates.put(member,state);
                }
            }
        }
        return state;
    
public booleanisFailing()

        return state == FAILING;
    
public booleanisReady()

        return state == READY;
    
public booleanisSuspect()

return
boolean

        return (state == SUSPECT) || (state == FAILING);
    
public static voidremoveSenderState(org.apache.catalina.tribes.Member member)

        synchronized ( memberStates ) {
            memberStates.remove(member);
        }
    
public voidsetFailing()

        state = FAILING;
    
public voidsetReady()

        state = READY;
    
public voidsetSuspect()

        state = SUSPECT;