Flexible Architecture
Default Environment Initialization
- Since: 0.8
It is not necessary to manually start broker and workers. When the connection to the cajoBroker or jmsBroker located on the local machine fail, the new processes are started automatically:
- cajoBroker/jmsBroker with exactly the same parameters at the one we was trying to connect to
- worker connected to the new broker instance
Please look at the log fragment from the DAC session without any previous environment preparation:
- cajoBroker
CajoBroker - Unable to connect to broker - schedule lazy initialization CajoBroker - Scheduled broker initialization: CajoBroker - host: localhost CajoBroker - port: 1198 CajoBroker - name: broker CajoBrokerServer - Starting server.. (hostName=localhost, port=1198, name=broker) CajoBrokerServer - ..Done CajoBrokerServer - Listening at: //localhost:1198/broker WorkerSingleThreaded - Single threaded worker 15cbe3a6-acb1-4518-add7-b544c6fa2f2f started WorkerSingleThreaded - Worker 15cbe3a6-acb1-4518-add7-b544c6fa2f2f is receiving agent... AgentBrokerStub - New session: 84eede3f-1d45-4612-ac12-115561f0b52e (started: Mon Sep 28 10:19:05 CEST 2009, pending results: 0, waiting agents: 0) WorkerSingleThreaded - Worker 15cbe3a6-acb1-4518-add7-b544c6fa2f2f is executing agent: <org.dacframe.agent.AgentStub 84eede3f-1d45-4612-ac12-115561f0b52e> WorkerSingleThreaded - Stub agent 0 is doing execute()
- jmsBroker
Unable to connect to JMS broker - schedule lazy initialization JMS broker ready at: tcp://localhost:61616 Single threaded worker 3136154e-ad6d-4e95-a449-dea2a48fed32 started
You can use the newly created broker in the same way as any other brokers started manually. In particular you can:
- send new agents
- connect new workers
Dynamic Code Execution
Every session runs in its own environment. Moreover, if the class definitions are missing on some nodes (broker/workers) they are automatically and transparently transferred.
Distribution of missing class files:
- When agent is sent to broker, it is checked if every class needed to execute agent is available in the broker. If not, all the dependencies are automatically and transparently transferred to the broker.
- When agent is sent to worker, the worker download all needed dependencies from broker (if needed).
The above algorithm denotes three things:
- Every session has its own environment. In particular there can be several sessions with different versions of the same classes.
- You do not have to manually distribute classes between nodes - it is done automatically.
- All classes available in the broker environment should be also available in the workers environments. The bottom line is if the broker couldn't catch the missing class, then the workers wouldn't be able to execute broken agents.
Transferred class files are stored in the directory given by "org.dacframe.class.repository" property. The default value is ".sessions".
Prioritization
Utilising prioritization feature reduces the overall computing time and therefore optimizes the whole process. Without prioritization most of the Agents appeare in task queue several times as they are only moved to the end of the queue while waiting for some data. The number of their appearance depends mostly on the size of population. Taking advantage of prioritization feature enables to schedule Agents' turns away when most necessary data are available. This way significantly reduces number of appearance of each Agent.



