System, Nodes, and Processes in the JADE Database
A JADE system consists of the database and the collections of nodes and processes that go to make up the system. There is one
A persistent
Each process running in a JADE system is represented by a persistent
An application process can directly access its own process object through the use of the JADE reserved word
The
If you want to know whether any node is executing a specific application, you could write a method like that shown in the following example.
findApp(appName: String): Boolean serverExecution; //more efficient on server vars allNodes: NodeDict; allProcesses: ProcessDict; nod: Node; proc: Process; begin allNodes := system.nodes.cloneSelf(true); foreach nod in allNodes do allProcesses := nod.processes.cloneSelf(true); foreach proc in allProcesses do if proc.persistentApp.name = appName then return true; endif; endforeach; delete allProcesses; endforeach; return false; epilog delete allNodes; delete allProcesses; end;
It is important not to use
In actual use, the method in the previous example should arm an exception handler, to protect against the possibility of a node or process terminating while the code is executing.