lib/ajp-rails/rails-runner.rb in ajp-rails-0.0.2 vs lib/ajp-rails/rails-runner.rb in ajp-rails-0.0.3

- old
+ new

@@ -48,10 +48,12 @@ 'environment' => 'RAILS_ENV', 'location' => 'APP_LOCATION', 'directory' => 'APP_DIRECTORY', 'prefix' => 'DISPATCHER_PREFIX', 'suffix' => 'DISPATCHER_SUFFIX', + 'jvm-route' => 'LOAD_BALANCE_ID', + 'serverid' => 'LOAD_BALANCE_ID', 'daemon' => 'IS_DAEMON' } DEFAULT_OPTIONS = { OPTION_NAMES_TO_INTERNAL_NAMES['environment'] => @@ -102,9 +104,23 @@ cmd_opts[OPTION_NAMES_TO_INTERNAL_NAMES['prefix']] = v } parser.on('--suffix=SUFFIX', "The suffix of the ajp-mounted URLs.") { |v| cmd_opts[OPTION_NAMES_TO_INTERNAL_NAMES['suffix']] = v + } + parser.on('--serverid=ID', + "The unique ID to identify this rails process," + + " which is for sticky session. The ID can contain only" + + " [a-z][A-Z][0-9], and case insensitive.") { |id| + raise ArgumentError, 'Server ID can contain only [a-z][A-Z][0-9].' unless + /\A[[:alnum:]]+\Z/ =~ id + cmd_opts[OPTION_NAMES_TO_INTERNAL_NAMES['serverid']] = id + } + parser.on('--jvm-route=ID', + "This is equal to --serverid") { |id| + raise ArgumentError, 'Server ID can contain only [a-z][A-Z][0-9].' unless + /\A[[:alnum:]]+\Z/ =~ id + cmd_opts[OPTION_NAMES_TO_INTERNAL_NAMES['jvm-route']] = id } parser.on('--daemon', "Makes Rails run as a daemon") {|v| cmd_opts[OPTION_NAMES_TO_INTERNAL_NAMES['daemon']] = v }