fr.dyade.aaa.agent

Class 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

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

Method Summary

void
close()
protected void
end()
Finalizes the driver.
protected void
react(Notification m)
Reacts to notifications from proxy.
void
run()
Actually executes the driver code.
String
toString()
Provides a string image for this object.

Methods inherited from class fr.dyade.aaa.agent.Driver

close, end, getName, run, sendTo, start, stop, toString

Field Details

mq

protected Queue mq
queue of Notification objects to be sent


proxy

protected AgentId proxy
id of associated proxy agent

Constructor Details

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 Details

close

public void close()
Overrides:
close in interface Driver


end

protected void end()
Finalizes the driver. Reports driver end to the proxy agent, with a DriverDone notification.
Overrides:
end in interface Driver

Parameters:


react

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

Parameters:


run

public void run()
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.

Overrides:
run in interface Driver


toString

public String toString()
Provides a string image for this object.
Overrides:
toString in interface Driver


Copyright B) 2004 Scalagent - All rights reserved