Tizen 2.0 Release
[sdk/emulator/qemu.git] / tizen / src / skin / client / src / org / tizen / emulator / skin / EmulatorShutdownhook.java
1 /**
2  * 
3  *
4  * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  * HyunJun Son <hj79.son@samsung.com>
8  * GiWoong Kim <giwoong.kim@samsung.com>
9  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24  *
25  * Contributors:
26  * - S-Core Co., Ltd
27  *
28  */
29
30 package org.tizen.emulator.skin;
31
32 import java.util.logging.Logger;
33
34 import org.tizen.emulator.skin.comm.ICommunicator;
35 import org.tizen.emulator.skin.log.SkinLogger;
36
37 /**
38  * 
39  *
40  */
41 public class EmulatorShutdownhook extends Thread {
42
43         private Logger logger = SkinLogger.getSkinLogger( EmulatorShutdownhook.class ).getLogger();
44         private ICommunicator communicator;
45         
46         public EmulatorShutdownhook( ICommunicator communicator ) {
47                 this.communicator = communicator;
48         }
49
50         @Override
51         public void run() {
52                 logger.info( " EmulatorShutdownhook run by a signal." );
53                 communicator.terminate();
54         }
55         
56 }