Parent

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]
files[RW]
id[RW]
state[RW]
readySince[RW]
modified[RW]
reloading[RW]
tag[R]

Public Class Methods

new(tag) click to toggle source
     # File lib/daemon/ProjectBroker.rb, line 521
521:     def initialize(tag)
522:       # Before we know the project ID we use this tag to uniquely identify the
523:       # project.
524:       @tag = tag
525:       # Array of [ workingDir, tjp file, ... tji files ]
526:       @files = nil
527:       # The authentication key for the ProjectServer process.
528:       @authKey = nil
529:       # The DRb URI where the ProjectServer process is listening.
530:       @uri = nil
531:       # The ID of the project.
532:       @id = nil
533:       # The state of the project. :new, :loading, :ready, :failed
534:       # and :obsolete are supported.
535:       @state = :new
536:       # A time stamp when the project became ready for service.
537:       @readySince = nil
538:       # True if any of the input files have been modified after the load.
539:       @modified = false
540:       # True if the reload has already been triggered.
541:       @reloading = false
542: 
543:       @log = LogFile.instance
544:       @projectServer = nil
545:     end

Public Instance Methods

ping() click to toggle source
     # File lib/daemon/ProjectBroker.rb, line 547
547:     def ping
548:       return true unless @uri
549: 
550:       @log.debug("Sending ping to ProjectServer #{@uri}")
551:       begin
552:         @projectServer = DRbObject.new(nil, @uri) unless @projectServer
553:         @projectServer.ping(@authKey)
554:       rescue
555:         @log.error("Ping failed: #{$!}")
556:         return false
557:       end
558:       true
559:     end
terminateServer() click to toggle source

Call this function to terminate the ProjectServer.

     # File lib/daemon/ProjectBroker.rb, line 562
562:     def terminateServer
563:       return unless @uri
564: 
565:       begin
566:         @log.debug("Sending termination request to ProjectServer #{@uri}")
567:         @projectServer = DRbObject.new(nil, @uri) unless @projectServer
568:         @projectServer.terminate(@authKey)
569:       rescue
570:         @log.error("Termination of ProjectServer failed: #{$!}")
571:       end
572:       @uri = nil
573:     end
to_s(format, index) click to toggle source

This is used to generate the status table.

     # File lib/daemon/ProjectBroker.rb, line 576
576:     def to_s(format, index)
577:       sprintf(format, index, @id, @state, @modified ? '*' : ' ',
578:               @readySince ? @readySince.to_s('%Y-%m-%d %H:%M:%S') : '')
579:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.