fr.inria.peerunit.base
Class AbstractTester

java.lang.Object
  extended by fr.inria.peerunit.base.AbstractTester
All Implemented Interfaces:
StorageTester, Tester, java.rmi.Remote
Direct Known Subclasses:
DistributedTesterImpl, TesterImpl

public abstract class AbstractTester
extends java.lang.Object
implements Tester

Author:
sunye

Field Summary
protected  TesterUtil defaults
           
protected  GlobalVariables globals
           
protected  int id
           
 
Constructor Summary
AbstractTester()
          No arguments constructor.
AbstractTester(GlobalVariables gv)
           
 
Method Summary
 void clear()
          Used to clear the Collection of testing global variables
 boolean containsKey(java.lang.Integer key)
          Returns true if the key key can be map in the global variables cache, return false else.
 java.lang.Object get(java.lang.Integer key)
          Used to retrieve a testing global variable.
 java.util.Map<java.lang.Integer,java.lang.Object> getCollection()
          Used to retrieve all the peer of the testing global variables.
 int getId()
          Returns this tester's id
 int getPeerName()
           
protected  GlobalVariables globalTable()
           
protected  void initializeLogger()
           
 void put(java.lang.Integer key, java.lang.Object object)
          Allow to stock global variables who will accessed by all others participants.
 void setId(int i)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fr.inria.peerunit.Tester
execute, kill, setCoordinator, start
 

Field Detail

id

protected int id

globals

protected transient GlobalVariables globals

defaults

protected transient TesterUtil defaults
Constructor Detail

AbstractTester

public AbstractTester()
No arguments constructor. Needed for serialization/deserialization of subclasses.


AbstractTester

public AbstractTester(GlobalVariables gv)
Method Detail

getId

public int getId()
Returns this tester's id

Specified by:
getId in interface Tester
Returns:
the tester's id

setId

public void setId(int i)

getPeerName

public int getPeerName()
                throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

put

public void put(java.lang.Integer key,
                java.lang.Object object)
         throws java.rmi.RemoteException
Description copied from interface: StorageTester
Allow to stock global variables who will accessed by all others participants.

Specified by:
put in interface StorageTester
Parameters:
key - the key of object
object - the variable to stock
Throws:
java.rmi.RemoteException

getCollection

public java.util.Map<java.lang.Integer,java.lang.Object> getCollection()
                                                                throws java.rmi.RemoteException
Description copied from interface: StorageTester
Used to retrieve all the peer of the testing global variables.

Specified by:
getCollection in interface StorageTester
Returns:
all the peer of the testing global variables
Throws:
java.rmi.RemoteException - because the method is distant

get

public java.lang.Object get(java.lang.Integer key)
                     throws java.rmi.RemoteException
Description copied from interface: StorageTester
Used to retrieve a testing global variable.

Specified by:
get in interface StorageTester
Parameters:
key - a key
Returns:
object a variable corresponding to the key
Throws:
java.rmi.RemoteException

containsKey

public boolean containsKey(java.lang.Integer key)
                    throws java.rmi.RemoteException
Description copied from interface: StorageTester
Returns true if the key key can be map in the global variables cache, return false else.

Specified by:
containsKey in interface StorageTester
Parameters:
key - a key
Returns:
true if we can map the key key, return false else
Throws:
java.rmi.RemoteException - because the method is distant

clear

public void clear()
           throws java.rmi.RemoteException
Description copied from interface: StorageTester
Used to clear the Collection of testing global variables

Specified by:
clear in interface StorageTester
Throws:
java.rmi.RemoteException

globalTable

protected final GlobalVariables globalTable()

initializeLogger

protected void initializeLogger()


Copyright © 2010. All Rights Reserved.