com.sun.faban.driver.engine
Interface Agent

All Superinterfaces:
Remote
All Known Implementing Classes:
AgentImpl

public interface Agent
extends Remote

The methods in this interface are the public face of all benchmark agents. The agents reregister with the Registry on startup. The Master gets a reference to all the agents from the Registry and can then communicate with them using this (the Agent) interface.

Author:
Shanti Subrmanyam
See Also:
MasterImpl

Method Summary
 void configure(Master master, RunInfo runInfo, int driverType, Timer timer)
          Configures each agents with the properties passed.
 int getId()
          Obtains the id of this agent.
 Metrics getResults()
          Report stats from a run, aggregating across all threads of the Agent.
 void join()
          Waits for all the agentImpl's threads to terminate.
 void kill()
          This method is responsible for aborting a run.
 void postRun()
          Invokes the post run method on thread 0 of each driver agent 0, if the annotation @onceAfter is used.
 void setStartTime(int msTime)
          Sets the actual run start time.
 void startThreads()
          Start all the driver threads.
 void terminate()
          Terminates all leftover threads remaining at the end of the run.
 void waitForThreadStart()
          Wait until all threads are started.
 

Method Detail

configure

void configure(Master master,
               RunInfo runInfo,
               int driverType,
               Timer timer)
               throws RemoteException
Configures each agents with the properties passed.

Parameters:
master - the remote interface to the Master
runInfo - run information passed by Master
driverType - the driver type id
timer - BenchmarkDefinition Start time
Throws:
RemoteException - A network error occurred

getId

int getId()
          throws RemoteException
Obtains the id of this agent.

Returns:
The id of this agent.
Throws:
RemoteException - A network error occurred

startThreads

void startThreads()
                  throws RemoteException
Start all the driver threads.

Throws:
RemoteException - A network error occurred

waitForThreadStart

void waitForThreadStart()
                        throws RemoteException
Wait until all threads are started.

Throws:
RemoteException - A network error occurred

setStartTime

void setStartTime(int msTime)
                  throws RemoteException
Sets the actual run start time.

Parameters:
msTime - The relative millisec time of the benchmark start.
Throws:
RemoteException - A network error occurred

getResults

Metrics getResults()
                   throws RemoteException
Report stats from a run, aggregating across all threads of the Agent. The stats object is actually different for each Agent.

Returns:
The stats of the run.
Throws:
RemoteException - A network error occurred
See Also:
Metrics

join

void join()
          throws RemoteException
Waits for all the agentImpl's threads to terminate.

Throws:
RemoteException - A network error occurred

kill

void kill()
          throws RemoteException
This method is responsible for aborting a run.

Throws:
RemoteException - A network error occurred

terminate

void terminate()
               throws RemoteException
Terminates all leftover threads remaining at the end of the run. Logs the stack trace for all these threads but does not actually wait for the threads to terminate (join). Terminate is called while join is hanging on some thread that refuses to terminate.

Throws:
RemoteException - A network error occurred

postRun

void postRun()
             throws RemoteException
Invokes the post run method on thread 0 of each driver agent 0, if the annotation @onceAfter is used.

Throws:
RemoteException - A network error occurred