1 /**
2 * 2014, Digitalis Informatica. All rights reserved. Distribuicao e Gestao de Informatica, Lda. Estrada de Paco de Arcos
3 * num.9 - Piso -1 2780-666 Paco de Arcos Telefone: (351) 21 4408990 Fax: (351) 21 4408999 http://www.digitalis.pt
4 */
5
6 package pt.digitalis.dif.sanitycheck.manager;
7
8 import pt.digitalis.dif.controller.interfaces.IDIFContext;
9
10 /**
11 * @author Luis Pinto <a href="mailto:lpinto@digitalis.pt">lpinto@digitalis.pt</a><br/>
12 * @created May 30, 2014
13 */
14 public class SanityCheckThread extends Thread {
15
16 /** The Constant SANITY_CHECK_RESULT. */
17 public static final String SANITY_CHECK_RESULT = "SANITY_CHECK_RESULT";
18
19 /** The context. */
20 private final IDIFContext context;
21
22 /**
23 * Instantiates a new sanity check thread.
24 *
25 * @param context
26 * the context
27 */
28 public SanityCheckThread(IDIFContext context)
29 {
30 super();
31 this.context = context;
32 }
33
34 /**
35 * @see java.lang.Thread#run()
36 */
37 @Override
38 public void run()
39 {
40 context.getSession().addAttribute(SANITY_CHECK_RESULT, null);
41
42 boolean result = SanityCheckManager.runAllTests(this.context, true);
43
44 context.getSession().addAttribute(SANITY_CHECK_RESULT, result);
45
46 super.run();
47 }
48 }