fr.dyade.aaa.agent
Class AgentDriver

java.lang.Object
  extended byfr.dyade.aaa.agent.Driver
      extended byfr.dyade.aaa.agent.AgentDriver

public abstract class AgentDriver
extends Driver


Field Summary
protected  Queue mq
          queue of Notification objects to be sent
protected  AgentId proxy
          id of associated proxy agent
 
Fields inherited from class fr.dyade.aaa.agent.Driver
canStop, drivers, id, isRunning, logmon, name, thread
 
Constructor Summary
protected AgentDriver(int id, Agent proxy, Queue mq)
          Constructor.
 
Method Summary
 void close()
           
protected  void end()
          Finalizes the driver.
protected abstract  void react(Notification m)
          Reacts to notifications from proxy.
 void run()
          Actually executes the driver code.
 java.lang.String toString()
          Provides a string image for this object.
 
Methods inherited from class fr.dyade.aaa.agent.Driver
getName, sendTo, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

proxy

protected AgentId proxy
id of associated proxy agent


mq

protected Queue mq
queue of Notification objects to be sent

Constructor Detail

AgentDriver

protected AgentDriver(int id,
                      Agent proxy,
                      Queue mq)
Constructor.

Parameters:
proxy - id of associated proxy agent
mq - queue of Notification objects to be sent
Method Detail

toString

public java.lang.String toString()
Provides a string image for this object.

Overrides:
toString in class Driver
Returns:
printable image of this object

run

public void run()
Description copied from class: Driver
Actually executes the driver code. To be defined in derived classes.

Beware: this code is executed in a separate thread, outside from any transaction. Notifications may be sent using function sendTo, and they will actually be sent as soon as the function is called; there is no atomic treatment as there is in an agent reaction.

Specified by:
run in class Driver

close

public void close()
Specified by:
close in class Driver

react

protected abstract void react(Notification m)
                       throws java.lang.Exception
Reacts to notifications from proxy.

Throws:
java.lang.Exception - unspecialized exception

end

protected void end()
Finalizes the driver. Reports driver end to the proxy agent, with a DriverDone notification.

Overrides:
end in class Driver


Copyright ? 2004 Scalagent - All rights reserved