Coverage Report - org.mule.modules.boot.VersionWrapper
 
Classes in this File Line Coverage Branch Coverage Complexity
VersionWrapper
0%
0/12
0%
0/8
2.333
 
 1  
 /*
 2  
  * $Id: VersionWrapper.java 9969 2007-12-03 23:13:14Z aguenther $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 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  
  * There is a need to exit from wrapper
 19  
  * This is a good place for other information message
 20  
  */
 21  0
 public class VersionWrapper implements WrapperListener
 22  
 {
 23  
     public Integer start(String[] args)
 24  
     {
 25  
         try
 26  
         {
 27  0
             System.out.println(CoreMessages.productInformation());
 28  
         }
 29  0
         catch (Exception e)
 30  
         {
 31  0
             e.printStackTrace();
 32  0
             return new Integer(1);
 33  0
         }
 34  0
         return null;
 35  
     }
 36  
 
 37  
     public int stop(int exitCode)
 38  
     {
 39  0
         return exitCode;
 40  
     }
 41  
 
 42  
     public void controlEvent(int event)
 43  
     {
 44  0
         if (WrapperManager.isControlledByNativeWrapper())
 45  
         {
 46  
             // The Wrapper will take care of this event
 47  
         }
 48  
         else
 49  
         {
 50  
             // We are not being controlled by the Wrapper, so
 51  
             //  handle the event ourselves.
 52  0
             if ((event == WrapperManager.WRAPPER_CTRL_C_EVENT) ||
 53  
                 (event == WrapperManager.WRAPPER_CTRL_CLOSE_EVENT) ||
 54  
                 (event == WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT))
 55  
             {
 56  0
                 WrapperManager.stop(0);
 57  
             }
 58  
         }
 59  0
     }
 60  
 }