首页 > 代码库 > Java Service Wrapper配置详解

Java Service Wrapper配置详解

  1 #encoding=UTF-8  2 # Configuration files must begin with a line specifying the encoding  3 #  of the the file.  4   5 #********************************************************************  6 # Wrapper License Properties (Ignored by Community Edition)  7 #********************************************************************  8 # Professional and Standard Editions of the Wrapper require a valid  9 #  License Key to start.  Licenses can be purchased or a trial license 10 #  requested on the following pages: 11 # http://wrapper.tanukisoftware.com/purchase 12 # http://wrapper.tanukisoftware.com/trial 13  14 # Include file problems can be debugged by removing the first ‘#‘ 15 #  from the following line: 16 ##include.debug 17  18 # The Wrapper will look for either of the following optional files for a 19 #  valid License Key.  License Key properties can optionally be included 20 #  directly in this configuration file. 21 #include ../conf/wrapper-license.conf 22 #include ../conf/wrapper-license-%WRAPPER_HOST_NAME%.conf 23  24 # The following property will output information about which License Key(s) 25 #  are being found, and can aid in resolving any licensing problems. 26 #wrapper.license.debug=TRUE 27  28 #******************************************************************** 29 # Wrapper Localization 30 #******************************************************************** 31 # Specify the locale which the Wrapper should use.  By default the system 32 #  locale is used. 33 #wrapper.lang=en_US # en_US or ja_JP 34  35 # Specify the location of the Wrapper‘s language resources.  If these are 36 #  missing, the Wrapper will default to the en_US locale. 37 wrapper.lang.folder=../lang 38  39 #******************************************************************** 40 # Wrapper Java Properties 41 #******************************************************************** 42 # Java Application 43 #  Locate the java binary on the system PATH: 44 wrapper.java.command=java 45 #  Specify a specific java binary: 46 #set.JAVA_HOME=/java/path 47 #wrapper.java.command=%JAVA_HOME%/bin/java 48  49 # Tell the Wrapper to log the full generated Java command line. 50 #wrapper.java.command.loglevel=INFO 51  52 # Java Main class.  This class must implement the WrapperListener interface 53 #  or guarantee that the WrapperManager class is initialized.  Helper 54 #  classes are provided to do this for you.  See the Integration section 55 #  of the documentation for details. 56 wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp 57  58 # Java Classpath (include wrapper.jar)  Add class path elements as 59 #  needed starting from 1 60  61 wrapper.java.classpath.1=../lib/wrapper.jar 62 wrapper.java.classpath.2=../application/TestService.jar 63  64  65 # Java Library Path (location of Wrapper.DLL or libwrapper.so) 66 wrapper.java.library.path.1=../lib 67  68 # Java Bits.  On applicable platforms, tells the JVM to run in 32 or 64-bit mode. 69 wrapper.java.additional.auto_bits=TRUE 70  71 # Java Additional Parameters 72 wrapper.java.additional.1= 73  74 # Initial Java Heap Size (in MB) 75 #wrapper.java.initmemory=3 76  77 # Maximum Java Heap Size (in MB) 78 #wrapper.java.maxmemory=64 79  80 # Application parameters.  Add parameters as needed starting from 1 81 wrapper.app.parameter.1=fs.HelloWorld 82  83 #******************************************************************** 84 # Wrapper Logging Properties 85 #******************************************************************** 86 # Enables Debug output from the Wrapper. 87 # wrapper.debug=TRUE 88  89 # Format of output for the console.  (See docs for formats) 90 wrapper.console.format=PM 91  92 # Log Level for console output.  (See docs for log levels) 93 wrapper.console.loglevel=INFO 94  95 # Log file to use for wrapper output logging. 96 wrapper.logfile=../logs/wrapper.log 97  98 # Format of output for the log file.  (See docs for formats) 99 wrapper.logfile.format=LPTM100 101 # Log Level for log file output.  (See docs for log levels)102 wrapper.logfile.loglevel=INFO103 104 # Maximum size that the log file will be allowed to grow to before105 #  the log is rolled. Size is specified in bytes.  The default value106 #  of 0, disables log rolling.  May abbreviate with the ‘k‘ (kb) or107 #  ‘m‘ (mb) suffix.  For example: 10m = 10 megabytes.108 wrapper.logfile.maxsize=0109 110 # Maximum number of rolled log files which will be allowed before old111 #  files are deleted.  The default value of 0 implies no limit.112 wrapper.logfile.maxfiles=0113 114 # Log Level for sys/event log output.  (See docs for log levels)115 wrapper.syslog.loglevel=NONE116 117 #********************************************************************118 # Wrapper General Properties119 #********************************************************************120 # Allow for the use of non-contiguous numbered properties121 wrapper.ignore_sequence_gaps=TRUE122 123 # Do not start if the pid file already exists.124 wrapper.pidfile.strict=TRUE125 126 # Title to use when running as a console127 wrapper.console.title=Test Wrapper Sample Application128 129 #********************************************************************130 # Wrapper JVM Checks131 #********************************************************************132 # Detect DeadLocked Threads in the JVM. (Requires Standard Edition)133 wrapper.check.deadlock=TRUE134 wrapper.check.deadlock.interval=10135 wrapper.check.deadlock.action=RESTART136 wrapper.check.deadlock.output=FULL137 138 # Out Of Memory detection.139 # (Ignore output from dumping the configuration to the console.  This is only needed by the TestWrapper sample application.)140 wrapper.filter.trigger.999=wrapper.filter.trigger.*java.lang.OutOfMemoryError141 wrapper.filter.allow_wildcards.999=TRUE142 wrapper.filter.action.999=NONE143 #  Ignore -verbose:class output to avoid false positives.144 wrapper.filter.trigger.1000=[Loaded java.lang.OutOfMemoryError145 wrapper.filter.action.1000=NONE146 # (Simple match)147 wrapper.filter.trigger.1001=java.lang.OutOfMemoryError148 # (Only match text in stack traces if -XX:+PrintClassHistogram is being used.)149 #wrapper.filter.trigger.1001=Exception in thread "*" java.lang.OutOfMemoryError150 #wrapper.filter.allow_wildcards.1001=TRUE151 wrapper.filter.action.1001=RESTART152 wrapper.filter.message.1001=The JVM has run out of memory.153 154 #********************************************************************155 # Wrapper Email Notifications. (Requires Professional Edition)156 #********************************************************************157 # Common Event Email settings.158 #wrapper.event.default.email.debug=TRUE159 #wrapper.event.default.email.smtp.host=<SMTP_Host>160 #wrapper.event.default.email.smtp.port=25161 #wrapper.event.default.email.subject=[%WRAPPER_HOSTNAME%:%WRAPPER_NAME%:%WRAPPER_EVENT_NAME%] Event Notification162 #wrapper.event.default.email.sender=<Sender email>163 #wrapper.event.default.email.recipient=<Recipient email>164 165 # Configure the log attached to event emails.166 #wrapper.event.default.email.attach_log=TRUE167 #wrapper.event.default.email.maillog.lines=50168 #wrapper.event.default.email.maillog.format=LPTM169 #wrapper.event.default.email.maillog.loglevel=INFO170 171 # Enable specific event emails.172 #wrapper.event.wrapper_start.email=TRUE173 #wrapper.event.jvm_prelaunch.email=TRUE174 #wrapper.event.jvm_start.email=TRUE175 #wrapper.event.jvm_started.email=TRUE176 #wrapper.event.jvm_deadlock.email=TRUE177 #wrapper.event.jvm_stop.email=TRUE178 #wrapper.event.jvm_stopped.email=TRUE179 #wrapper.event.jvm_restart.email=TRUE180 #wrapper.event.jvm_failed_invocation.email=TRUE181 #wrapper.event.jvm_max_failed_invocations.email=TRUE182 #wrapper.event.jvm_kill.email=TRUE183 #wrapper.event.jvm_killed.email=TRUE184 #wrapper.event.jvm_unexpected_exit.email=TRUE185 #wrapper.event.wrapper_stop.email=TRUE186 187 # Specify custom mail content188 wrapper.event.jvm_restart.email.body=The JVM was restarted.\n\nPlease check on its status.\n189 190 #********************************************************************191 # Wrapper Windows NT/2000/XP Service Properties192 #********************************************************************193 # WARNING - Do not modify any of these properties when an application194 #  using this configuration file has been installed as a service.195 #  Please uninstall the service before modifying this section.  The196 #  service can then be reinstalled.197 198 # Name of the service199 wrapper.name=testwrapper200 201 # Display name of the service202 wrapper.displayname=Test Wrapper Sample Application203 204 # Description of the service205 wrapper.description=Test Wrapper Sample Application Description206 207 # Service dependencies.  Add dependencies as needed starting from 1208 wrapper.ntservice.dependency.1=209 210 # Mode in which the service is installed.  AUTO_START, DELAY_START or DEMAND_START211 wrapper.ntservice.starttype=AUTO_START212 213 # Allow the service to interact with the desktop.214 wrapper.ntservice.interactive=false

精简:

 1 wrapper.lang.folder=../lang 2  3 wrapper.java.command=java 4  5 wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp 6  7 wrapper.java.classpath.1=../lib/wrapper.jar 8 wrapper.java.classpath.2=../application/TestService.jar 9 10 wrapper.java.library.path.1=../lib11 12 wrapper.java.additional.auto_bits=TRUE13 14 wrapper.java.additional.1=15 16 wrapper.app.parameter.1=fs.HelloWorld17 18 wrapper.console.format=PM19 20 wrapper.console.loglevel=INFO21 22 wrapper.logfile=../logs/wrapper.log23 24 wrapper.logfile.format=LPTM25 26 wrapper.logfile.loglevel=INFO27 28 wrapper.logfile.maxsize=029 30 wrapper.logfile.maxfiles=031 32 wrapper.syslog.loglevel=NONE33 34 wrapper.ignore_sequence_gaps=TRUE35 36 37 wrapper.pidfile.strict=TRUE38 39 wrapper.console.title=Test Wrapper Sample Application40 41 42 wrapper.check.deadlock=TRUE43 wrapper.check.deadlock.interval=1044 wrapper.check.deadlock.action=RESTART45 wrapper.check.deadlock.output=FULL46 47 48 wrapper.filter.trigger.999=wrapper.filter.trigger.*java.lang.OutOfMemoryError49 wrapper.filter.allow_wildcards.999=TRUE50 wrapper.filter.action.999=NONE51 52 wrapper.filter.trigger.1000=[Loaded java.lang.OutOfMemoryError53 wrapper.filter.action.1000=NONE54 55 wrapper.filter.trigger.1001=java.lang.OutOfMemoryError56 57 wrapper.filter.action.1001=RESTART58 wrapper.filter.message.1001=The JVM has run out of memory.59 60 wrapper.event.jvm_restart.email.body=The JVM was restarted.\n\nPlease check on its status.\n61 62 63 wrapper.name=testwrapper64 65 wrapper.displayname=Test Wrapper Sample Application66 67 wrapper.description=Test Wrapper Sample Application Description68 69 wrapper.ntservice.dependency.1=70 71 wrapper.ntservice.starttype=AUTO_START72 73 wrapper.ntservice.interactive=false

关键点:

wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

wrapper.java.classpath.1=../lib/wrapper.jar
wrapper.java.classpath.2=../application/TestService.jar

wrapper.java.additional.1=

wrapper.app.parameter.1=fs.HelloWorld