How to kill a JChemSearch

ChemAxon 587f88acea

31-08-2004 14:38:52

I would like to stop the JChemSearch when the search never ends (if a combinatorial explosion occurs for instance)





I suppose JChemSearch is implemanted as a Thread but I don't find any method to kill it such as stop or suspend





How can I do this ?





Thank you

ChemAxon 9c0afc9aaf

01-09-2004 10:47:17

Hi,





There should be no such search case when the search "never ends" in recent JChem versions.


If some huge molecule would cause combinatoric explosion, there is a timeout within a reasonable period, and the search goes on.


(Are you using some older version ?)





You can limit the search time with JChemSearch.setMaxTime() :





http://www.jchem.com/doc/api/chemaxon/jchem/db/JChemSearch.html#setMaxTime(long)





After the search finished, you can examine whether maximum time was reached with JChemSearch.isMaxTimeReached() :





http://www.jchem.com/doc/api/chemaxon/jchem/db/JChemSearch.html#isMaxTimeReached()





If the search running in thread has to be interrupted, you should call JChemSearch.setRunning(false) :





http://www.jchem.com/doc/api/chemaxon/jchem/db/JChemSearch.html#setRunning(boolean)