1
2
3
4
5
6
7 package org.mule.module.boot;
8
9 import org.mule.config.i18n.CoreMessages;
10
11 import org.tanukisoftware.wrapper.WrapperListener;
12 import org.tanukisoftware.wrapper.WrapperManager;
13
14
15
16
17
18 public class VersionWrapper implements WrapperListener
19 {
20 public Integer start(String[] args)
21 {
22 try
23 {
24 System.out.println(CoreMessages.productInformation());
25 }
26 catch (Exception e)
27 {
28 e.printStackTrace();
29 return Integer.valueOf(1);
30 }
31 return null;
32 }
33
34 public int stop(int exitCode)
35 {
36 return exitCode;
37 }
38
39 public void controlEvent(int event)
40 {
41 if (WrapperManager.isControlledByNativeWrapper())
42 {
43
44 }
45 else
46 {
47
48
49 if ((event == WrapperManager.WRAPPER_CTRL_C_EVENT) ||
50 (event == WrapperManager.WRAPPER_CTRL_CLOSE_EVENT) ||
51 (event == WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT))
52 {
53 WrapperManager.stop(0);
54 }
55 }
56 }
57 }