Class GlassFish::Server
In: lib/server.rb
Parent: Object

Methods

name   new   start   start   start!   stop   to_s  

Attributes

opts  [RW] 

Public Class methods

[Source]

     # File lib/server.rb, line 61
 61:     def initialize(args, &block)
 62: 
 63:       unless args[:log_level].nil?
 64:         if args[:log_level] > 4
 65:           puts "Arguments: "
 66:           args.each do |k, v|
 67:             puts "\t#{k}=>#{v}"
 68:           end
 69:         end
 70: 
 71:         if args[:log_level] > 3
 72:           debug = true
 73:         end
 74: 
 75:       end
 76: 
 77:       java.lang.System.getProperties().put("jruby.runtime", JRuby.runtime) unless args[:daemon]
 78: 
 79:       @opts = Options.new
 80:       @opts.runtimes = args[:runtimes]
 81:       @opts.runtimes_min = args[:runtimes_min]
 82:       @opts.runtimes_max = args[:runtimes_max]
 83:       @opts.environment = args[:environment]
 84:       @opts.port = args[:port]
 85:       @opts.address = args[:address]
 86:       @opts.contextRoot = args[:contextroot]
 87:       @opts.appDir = args[:app_dir]
 88:       @opts.daemon = args[:daemon]
 89:       @opts.pid = args[:pid]
 90:       @opts.log = args[:log]
 91:       @opts.log_console = args[:log_console]
 92:       @opts.domainDir = args[:domain_dir]
 93:       @opts.log_level = args[:log_level]
 94:       @opts.jvm_opts = args[:jvm_options]
 95: 
 96: 
 97:       unless args[:grizzly_config].nil?
 98:         args[:grizzly_config].each do |key, val|
 99:           case key
100:             when "chunking-enabled"
101:               @opts.grizzlyConfig.chunkingEnabled = val unless val.nil?
102:             when "request-timeout"
103:               @opts.grizzlyConfig.requestTimeout = val unless val.nil?
104:             when "send-buffer-size"
105:               @opts.grizzlyConfig.sendBufferSize = val unless val.nil?
106:             when "max-keepalive-connextions"
107:               @opts.grizzlyConfig.maxKeepaliveConnections = val unless val.nil?
108:             when "keepalive-timeout"
109:               @opts.grizzlyConfig.keepaliveTimeout = val unless val.nil?
110:             when "thread-pool"
111:               unless val.nil?
112:                 val.each do |k, v|
113:                   case k
114:                     when "idle-thread-timeout-seconds"
115:                       @opts.grizzlyConfig.threadPool.idleThreadTimeoutSeconds = v unless v.nil?
116:                     when "max-queue-size"
117:                       @opts.grizzlyConfig.threadPool.maxQueueSize = v unless v.nil?
118:                     when "max-thread-pool-size"
119:                       @opts.grizzlyConfig.threadPool.maxThreadPoolSize = v unless v.nil?
120:                     when "min-thread-pool-size"
121:                       @opts.grizzlyConfig.threadPool.minThreadPoolSize = v unless v.nil?
122:                   end
123:                 end
124:               end
125:           end
126:         end
127:       end
128: 
129:       #Create the app using Rack builder
130:       if(block)
131:         app = Rack::Builder.new(&block).to_app
132:         app = Rack::CommonLogger.new(@app) if debug
133:         if app.nil?
134:           app = block
135:         end
136:         @opts.app = app;
137: 
138:         java.lang.System.getProperties().put("glassfish.rackupApp", app)
139:       end
140:     end

[Source]

     # File lib/server.rb, line 142
142:     def self.start(args, &block)
143:       #Validate the command line options
144:       args = GlassFish::Config.init_opts.merge! args
145:       Config.new.validate! args
146:       new(args, &block).start!
147:     end

Public Instance methods

[Source]

     # File lib/server.rb, line 158
158:     def name
159:       "GlassFish v3 server"
160:     end

[Source]

     # File lib/server.rb, line 149
149:     def start
150:       GlassFishMain.start @opts
151:     end
start!()

Alias for start

[Source]

     # File lib/server.rb, line 154
154:     def stop
155:       GlassFishMain.start @opts
156:     end
to_s()

Alias for name

[Validate]