home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)csrootnode.tcl /main/hindenburg/11
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)csrootnode.tcl /main/hindenburg/11 4 Jun 1997 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- require "repdbms.tcl"
- require "csservices.tcl"
- require "csbrokersn.tcl"
- # End user added include file section
-
- require "csnode.tcl"
-
- Class CSRootNode : {CSNode} {
- constructor
- method destructor
- method shutdown
- method doUpdate
- }
-
- constructor CSRootNode {class this name} {
- set this [CSNode::constructor $class $this $name]
- # Start constructor user section
-
- $this label "ObjectTeam"
- $this icon rep_pepper_16
- $this canShutdown 1
-
- # End constructor user section
- return $this
- }
-
- method CSRootNode::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this CSNode::destructor
- }
-
- method CSRootNode::shutdown {this {confirm 1}} {
- if $confirm {
- $this confirmShutdown "Shutdown ObjectTeam" \
- "Are you sure you want to shutdown\
- the entire ObjectTeam environment?" shutdownObjectTeam
- return
- }
-
- # Shutdown the entire ObjectTeam environment: all servers, brokers
- # and nameserver.
- #
- set shutdownCount 0
- set ns [ORB::nameServer]
- set nsBroker [$ns broker]
- set nsShutdown 0
-
- foreach broker [$ns brokers] {
- # Shutdown all servers of this broker.
- #
- foreach implem [$broker implementations] {
- foreach server [$implem servers] {
- # Skip nameserver, because that fails if its broker is
- # still running.
- #
- if {$server == $ns} {
- continue
- }
-
- if [catch {$server shutdown} shutdownError] {
- [$this view] error $shutdownError
- } else {
- incr shutdownCount
- }
- }
- }
-
- if [catch {$broker shutdown} shutdownError] {
- [$this view] error $shutdownError
- } else {
- incr shutdownCount
-
- # If name_server broker was shutdown, don't try to update,
- # since that will time-out for sure.
- #
- if {$broker == $nsBroker} {
- set nsShutdown 1
- }
- }
- }
-
- if $nsShutdown {
- $this.services removeChildren
- $this.services hasChildren 0
-
- $this.brokers removeChildren
- $this.brokers hasChildren 0
- } elseif {$shutdownCount > 0} {
- $this update 0
- }
- }
-
- method CSRootNode::doUpdate {this {rebuild 1}} {
- if [lempty [$this childSet]] {
- CSServicesNode new $this.services
- CSBrokersNode new $this.brokers
- }
- $this.services update $rebuild
- $this.brokers update $rebuild
-
- set info [$this info]
-
- $info addHeader "ObjectTeam"
- $info addItem "Package" [m4_var get M4_package]
- $info addItem "Version" [versionInfo versionLabel]
- $info addItem "Date" [versionInfo dateLabel]
- $info addItem "M4 Home" [m4_var get M4_home]
- $info addItem "Meta4UserEnv" [m4_var meta4UserEnv]
-
- $info addHeader "C/S Variables In Environment"
- set orbVar(M4_brokerport) {}
- set orbVar(M4_dblockmode) {}
- set orbVar(M4_dbms) {}
- set orbVar(M4_dbtracesql) {}
- set orbVar(M4_imphost) {}
- set orbVar(M4_nameserverhost) {}
- set orbVar(M4_nameserverport) {}
- set orbVar(M4_orb_linger) {}
- set orbVar(M4_orb_maxclients) {}
- set orbVar(M4_orb_maxinstances) {}
- set orbVar(M4_orb_report) {}
- set orbVar(M4_orb_timeout) {}
- set orbVar(M4_protocol) {}
- set orbVar(M4_services) {}
-
- set orbVars {}
- m4_var foreach var {
- set context ""
- set name $var
- regexp {(.*)__(.*)} $var dummy name context
-
- if [info exists orbVar($name)] {
- lappend orbVars $var
- }
- }
-
- foreach var [lsort $orbVars] {
- if {$var == "M4_orb_timeout"} {
- set value [[[$this view] rep] orbTimeOut]
- } else {
- set value [m4_var get $var]
- }
- $info addItem $var $value
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-