KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > threads > ShutdownHookThread


1 package com.dotmarketing.threads;
2
3 import com.dotmarketing.portlets.contentlet.factories.ContentletFactory;
4 import com.dotmarketing.util.Logger;
5
6 public class ShutdownHookThread extends Thread JavaDoc {
7
8
9     public void run() {
10         Logger.info("Running dotCMS shutdown cleanup sequence.");
11         ContentletFactory.shuttingDown = true;
12         try {
13             //Sleeping a second to wait for any index write not flushed yet
14
Thread.sleep(1000);
15         } catch (Exception JavaDoc e) {
16             Logger.error(this, "A error ocurred trying to close the lucene writer, maybe be the lucene index would be corrupted at the next startup.");
17         }
18     }
19
20
21 }
22
Popular Tags