JSPservletPkg
Class Mapper.Checker

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--JSPservletPkg.Mapper.Checker

class Mapper.Checker
extends java.lang.Thread

Checker thread class.


Field Summary
private  int action
          Equals NOOP or CHECK.
private  java.util.HashMap allSubscribers
          Map of subscribers.
private  boolean completed
          Used to check request completion.
private  boolean isStarted
          Protects again startup race condition.
private  boolean rc
          Used in case of check.
private  java.lang.String subscrib
          Used in case of check.
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
(package private) Mapper.Checker()
          Starts the thread.
 
Method Summary
private  java.lang.String[] available(java.lang.String[] subscribers)
          Returns available subscribers among a list.
private  boolean check(java.lang.String subscriber)
          Checks if a subscriber is up.
private  void checkAll(int counterForPing)
          Require allSubscribers update.
 void run()
          Main method of Thread.
private  boolean threadCheck(java.lang.String subscriber)
          Checks if a subscriber is up.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

allSubscribers

private java.util.HashMap allSubscribers
Map of subscribers. Validated with mapper.testMisc.
  • Key: subscriber.
  • Value: Boolean true: UP, false: DOWN.

  • action

    private int action
    Equals NOOP or CHECK.

    subscrib

    private java.lang.String subscrib
    Used in case of check.

    rc

    private boolean rc
    Used in case of check.

    completed

    private boolean completed
    Used to check request completion.

    isStarted

    private boolean isStarted
    Protects again startup race condition.
    Constructor Detail

    Mapper.Checker

    Mapper.Checker()
    Starts the thread.
    Method Detail

    checkAll

    private void checkAll(int counterForPing)
    Require allSubscribers update.
    Parameters:
    counterForPing - hint between to update only a part of allSubscribers.

    check

    private boolean check(java.lang.String subscriber)
    Checks if a subscriber is up.
    Parameters:
    subscriber - subscriber url.
    Returns:
    boolean true if subscriber is up.

    run

    public void run()
    Main method of Thread.
    Overrides:
    run in class java.lang.Thread

    available

    private final java.lang.String[] available(java.lang.String[] subscribers)
    Returns available subscribers among a list.
    Parameters:
    subscribers - array of subscribers.

    threadCheck

    private boolean threadCheck(java.lang.String subscriber)
    Checks if a subscriber is up.
    Parameters:
    subscriber - subscriber url.
    Returns:
    boolean true if subscriber is up.