1 23 24 package org.continuent.sequoia.common.util; 25 26 import java.io.IOException ; 27 import java.util.Properties ; 28 29 35 public class Constants 36 { 37 static Properties getVersionProperties() 38 { 39 Properties versionProperties = new Properties (); 40 try 41 { 42 versionProperties.load(Constants.class 43 .getResourceAsStream("version.properties")); 44 } 45 catch (IOException e) 46 { } 48 catch (NullPointerException e) 49 { } 51 return versionProperties; 52 } 53 54 57 58 public static final String VERSION = getVersionProperties().getProperty( 59 "sequoia.version", "@VERSION@"); 60 61 66 public static final int getMajorVersion() 67 { 68 int ind = VERSION.indexOf('.'); 69 if (ind > 0) 70 return Integer.parseInt(VERSION.substring(0, ind)); 71 else 72 return 1; 73 } 74 75 80 public static final int getMinorVersion() 81 { 82 int ind = VERSION.indexOf('.'); 83 if (ind > 0) 84 return Integer.parseInt(VERSION.substring(ind + 1, ind + 2)); 85 else 86 return 0; 87 } 88 89 93 94 public static final int SHUTDOWN_WAIT = 1; 95 96 100 public static final int SHUTDOWN_SAFE = 2; 101 102 106 public static final int SHUTDOWN_FORCE = 3; 107 108 } | Popular Tags |