home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
csrootnode.tcl
< prev
next >
Wrap
Text File
|
1997-11-05
|
6KB
|
203 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1996
#
# File: @(#)csrootnode.tcl /main/titanic/15
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)csrootnode.tcl /main/titanic/15 5 Nov 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 setConfiguration
method saveConfiguration
method shutdown
method beginUpdate
method doUpdate
attribute configurationSet
attribute servicesFolded
attribute brokersFolded
}
constructor CSRootNode {class this name} {
set this [CSNode::constructor $class $this $name]
# Start constructor user section
$this label "Cayenne"
$this icon rep_pepper_16
$this activeIcon rep_pepper_16
$this canShutdown 1
$this configurationSet 0
$this servicesFolded 0
$this brokersFolded 0
# End constructor user section
return $this
}
method CSRootNode::destructor {this} {
# Start destructor user section
# End destructor user section
$this CSNode::destructor
}
method CSRootNode::setConfiguration {this} {
set folded [m4_var get M4_cstree_folded -context services]
if {$folded != ""} {
$this.services foldState $folded
}
set folded [m4_var get M4_cstree_folded -context brokers]
if {$folded != ""} {
$this.brokers foldState $folded
}
}
method CSRootNode::saveConfiguration {this} {
m4_var set M4_cstree_folded [$this.services foldState] -context services
m4_var set M4_cstree_folded [$this.brokers foldState] -context brokers
}
method CSRootNode::shutdown {this {confirm 1}} {
if $confirm {
$this confirmShutdown "Cayenne Installation" \
"Are you sure you want to shutdown\
the entire Cayenne installation?" shutdownCayenne
return
}
# Shutdown the entire Cayenne installation: 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::beginUpdate {this {rebuild 1}} {
if [isCommand $this.services] {
$this servicesFolded [$this.services foldState]
$this brokersFolded [$this.brokers foldState]
}
$this CSNode::beginUpdate $rebuild
}
method CSRootNode::doUpdate {this {rebuild 1}} {
if [lempty [$this childSet]] {
CSServicesNode new $this.services
CSBrokersNode new $this.brokers
if [$this configurationSet] {
$this.services foldState [$this servicesFolded]
$this.brokers foldState [$this brokersFolded]
} else {
$this setConfiguration
$this configurationSet 1
}
}
$this.services update $rebuild
$this.brokers update $rebuild
set info [$this info]
$info addHeader "Cayenne"
$info addItem "Version" [versionInfo versionLabel]
$info addItem "Build Date" [versionInfo dateLabel]
$info addItem "M4 Home" [m4_var get M4_home]
$info addItem "Meta4UserEnv" [m4_var meta4UserEnv]
$info addHeader "FlexLM Licensing"
set licenseFile "<not set>"
global env
if [info exists env(LM_LICENSE_FILE)] {
set licenseFile $env(LM_LICENSE_FILE)
}
$info addItem "LM_LICENSE_FILE" $licenseFile
$info addHeader "C/S Variables In Environment"
foreach var [Repository::orbOptions] {
set orbVar($var) {}
}
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