PageBoxLib
Class TokenImpl.TokenThread

java.lang.Object
  extended byjava.lang.Thread
      extended byPageBoxLib.TokenImpl.TokenThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
TokenImpl

class TokenImpl.TokenThread
extends java.lang.Thread

Thread class sending frames to the next station on the ring.


Field Summary
(package private)  java.util.LinkedList queue
          Queue used to pass frames.
(package private)  boolean started
          True when thread started
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) TokenImpl.TokenThread()
           
 
Method Summary
(package private)  void frameForward(java.lang.String url, TokenFrame frame)
          Forward the frame to the next running PageBox or to the Repository.
(package private)  void generateToken(java.lang.String url)
          Generate a new token.
 void run()
          Main method of the TokenThread thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

queue

java.util.LinkedList queue
Queue used to pass frames. Elements: TokenFrame objects.


started

boolean started
True when thread started

Constructor Detail

TokenImpl.TokenThread

TokenImpl.TokenThread()
Method Detail

run

public void run()
Main method of the TokenThread thread.


generateToken

void generateToken(java.lang.String url)

Generate a new token.

No token received may be due to
  1. a Repository failure
    can be checked with a frameSend("ping")
    => reissue a token
  2. the failure of a station before
  3. Pb: how to avoid that all stations generate a new token?

    Solution: wait for a url-dependent time before generating a new token.

    Parameters:
    url - RL of the DeployIF web service of the subscribed PageBox

frameForward

void frameForward(java.lang.String url,
                  TokenFrame frame)
Forward the frame to the next running PageBox or to the Repository.

Parameters:
url - PageBox url
frame - frame to forward