PageBoxLib
Class TokenFrame

java.lang.Object
  extended byPageBoxLib.TokenFrame
All Implemented Interfaces:
java.io.Serializable

public class TokenFrame
extends java.lang.Object
implements java.io.Serializable

Token ring frame.

Changes:

alexis.grandemange@pagebox.net

Copyright (c) 2002-2004 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 1, 1
Author:
Alexis Grandemange
See Also:
Serialized Form

Field Summary
 java.util.LinkedList adjacencyList
          Contains PageBoxInfo objects.
 java.util.LinkedList msgList
          Contains TokenMsg objects.
 int nb
          Frame number
 java.lang.String repUrl
          URL of the RepoQueryIF Web service of the Repository
 
Constructor Summary
TokenFrame()
          Default constructor.
TokenFrame(java.lang.String repUrl, java.util.LinkedList al)
          Constructor.
 
Method Summary
 void cleanup()
          Cleanup a frame (repository side).
(package private)  void cleanup(java.lang.String o)
          Cleanup a frame (origin side).
(package private)  void processMessage(Log log, java.lang.String t, java.lang.String a, TokenCallbackIF tci)
          Calls the callbacks of a PageBox (target side).
(package private)  void processResponse(Log log, java.lang.String o, java.lang.String a, TokenCallbackIF tci)
          Get responses for a PageBox (origin side).
(package private)  void trace(Log log, java.lang.String step)
          Trace the frame content for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

repUrl

public java.lang.String repUrl
URL of the RepoQueryIF Web service of the Repository


nb

public int nb
Frame number


adjacencyList

public java.util.LinkedList adjacencyList
Contains PageBoxInfo objects.


msgList

public java.util.LinkedList msgList
Contains TokenMsg objects.

Constructor Detail

TokenFrame

public TokenFrame()
Default constructor.


TokenFrame

public TokenFrame(java.lang.String repUrl,
                  java.util.LinkedList al)
Constructor. Called by RepoTokenImpl.

Parameters:
repUrl - URL of the RepoQueryIF Web service of the Repository
al - adjacency list
Method Detail

processMessage

void processMessage(Log log,
                    java.lang.String t,
                    java.lang.String a,
                    TokenCallbackIF tci)
Calls the callbacks of a PageBox (target side). Called by TokenCallbackImpl.

Parameters:
log - logging object
t - URL of the Deploy Web service of the target PageBox
a - archive name
tci - TokenCallbackIF object

processResponse

void processResponse(Log log,
                     java.lang.String o,
                     java.lang.String a,
                     TokenCallbackIF tci)
Get responses for a PageBox (origin side). Called by TokenCallbackImpl.

Parameters:
log - logging object
o - URL of the Deploy Web service of the origin PageBox
a - archive name
tci - TokenCallbackIF object

cleanup

void cleanup(java.lang.String o)
Cleanup a frame (origin side).

Parameters:
o - URL of the Deploy Web service of the origin PageBox

cleanup

public void cleanup()
Cleanup a frame (repository side). Drawback:
  1. if the origin was AFTER the target in the adjacency list and was subsequently removed from the adjacency list the message is removed without being processed by the target
  2. if the origin was BEFORE the target in the adjacency list and was subsequently removed from the adjacency list the message is processed by the target before being removed.
  3. in case of broadcast targets after the origin in the adjacency list process the message and targets BEFORE the origin in the adjacency list don't receive the message


trace

void trace(Log log,
           java.lang.String step)
Trace the frame content for debugging. Called by TokenCallbackImpl.

Parameters:
log - logging object
step - tracing time before of after