~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Open Mash Cross Reference
mash/tcl/indiva/lib/indiva-service-application.tcl

Component: ~ [ mash ] ~ [ apps ] ~ [ gsm ] ~ [ lib ] ~ [ otcl ] ~ [ srm ] ~ [ tcl8.3 ] ~ [ tclcl ] ~ [ tk8.3 ] ~ [ tutorials ] ~

  1 import Dp
  2 import ActiveServiceApplication 
  3 import Application
  4 import ASCP/Service
  5 import MashRemoteObject 
  6 Class IndivaServiceApplication -superclass ActiveServiceApplication
  7 
  8 IndivaServiceApplication instproc init { argv name } {
  9     set o [$self options]
 10     $o register_option "-imgr" "imgr"
 11     $o add_default     "imgr"  ""
 12 
 13     $self next $argv $name
 14 
 15     # Open RPC Connection to Indiva Manager
 16     $self instvar imgr_rpc_
 17     if {[$self get_option imgr] != ""} {
 18         set list [split [$self get_option imgr] :]
 19         set host [lindex $list 0]
 20         set port [lindex $list 1]
 21         if {[catch {dp_MakeRPCClient $host $port} imgr_rpc_]} {
 22             puts "WARNING: unable to connect to indiva manager at $host:$port"
 23             puts "$imgr_rpc_"
 24             set imgr_rpc_ ""
 25         }
 26         # Create a remote IndivaManager object.
 27         $self instvar manager_
 28         set manager_ [new MashRemoteObject $imgr_rpc_ new IndivaManager]
 29         set sid [$self get_option sid]
 30         $manager_ servent register $sid $self
 31 
 32         $self instvar ascp_
 33         if [info exists ascp_($sid)] {
 34             $ascp_($sid) on_exit "catch {$manager_ servent unregister $sid}"
 35             #$ascp_($sid) on_exit {catch {delete [$self get_service $sid]}}
 36         }
 37     }
 38 }
 39 
 40 IndivaServiceApplication instproc new_service { service_instance } {
 41     # Subclass must create service and returned.
 42     return ""
 43 }
 44 
 45 IndivaServiceApplication instproc get_service { service_instance } {
 46     # Subclass must return service.
 47     return ""
 48 }
 49 
 50 IndivaServiceApplication instproc on_exit { cb } {
 51     $self instvar ascp_
 52     if [info exists ascp_([$self get_option sid])] {
 53         $ascp_([$self get_option sid]) on_exit $cb
 54     }
 55 }
 56 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.