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