Parent

Files

Class Index [+]

Quicksearch

TaskJuggler::ProjectRecord

The ProjectRecord objects are used to manage the loaded projects. There is one entry for each project in the @projects list.

Attributes

authKey[RW]
uri[RW]
id[RW]
state[RW]
readySince[RW]
tag[R]

Public Class Methods

new(tag) click to toggle source
     # File lib/daemon/ProjectBroker.rb, line 393
393:     def initialize(tag)
394:       # Before we know the project ID we use this tag to uniquely identify the
395:       # project.
396:       @tag = tag
397:       # The authentication key for the ProjectServer process.
398:       @authKey = nil
399:       # The DRb URI where the ProjectServer process is listening.
400:       @uri = nil
401:       # The ID of the project.
402:       @id = nil
403:       # The state of the project. :new, :loading, :ready, :failed
404:       # and :obsolete are supported.
405:       @state = :new
406:       # A time stamp when the project became ready for service.
407:       @readySince = nil
408: 
409:       @log = LogFile.instance
410:       @projectServer = nil
411:     end

Public Instance Methods

ping() click to toggle source
     # File lib/daemon/ProjectBroker.rb, line 413
413:     def ping
414:       return true unless @uri
415: 
416:       @log.debug("Sending ping to ProcessServer #{@uri}")
417:       begin
418:         @projectServer = DRbObject.new(nil, @uri) unless @projectServer
419:         @projectServer.ping(@authKey)
420:       rescue
421:         @log.error("Ping failed: #{$!}")
422:         return false
423:       end
424:       true
425:     end
terminateServer() click to toggle source

Call this function to terminate the ProjectServer.

     # File lib/daemon/ProjectBroker.rb, line 428
428:     def terminateServer
429:       return unless @uri
430: 
431:       begin
432:         @log.debug("Sending termination request to ProcessServer #{@uri}")
433:         @projectServer = DRbObject.new(nil, @uri) unless @projectServer
434:         @projectServer.terminate(@authKey)
435:       rescue
436:         @log.error("Termination of ProjectServer failed: #{$!}")
437:       end
438:       @uri = nil
439:     end
to_s(format, index) click to toggle source

This is used to generate the status table.

     # File lib/daemon/ProjectBroker.rb, line 442
442:     def to_s(format, index)
443:       sprintf(format, index, @id, @state,
444:               @readySince ? @readySince.to_s('%Y-%m-%d %H:%M:%S') : '')
445:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.