home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
csserverno.tcl
< prev
next >
Wrap
Text File
|
1997-11-05
|
4KB
|
133 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1996
#
# File: @(#)csserverno.tcl /main/titanic/9
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)csserverno.tcl /main/titanic/9 5 Nov 1997 Copyright 1996 Cayenne Software Inc.
# Start user added include file section
require csclientno.tcl
require csparamdia.tcl
# End user added include file section
require "csprocessn.tcl"
Class CSServerNode : {CSProcessNode} {
constructor
method destructor
method childName
method changeParameters
method changeableParameters
method shutdown
method doUpdate
attribute server
attribute paramDialog
}
constructor CSServerNode {class this name i_server} {
set this [CSProcessNode::constructor $class $this $name]
$this server $i_server
# Start constructor user section
$this process $i_server
set info [ORB::decodeObjectId [$i_server identity]]
set implemId [ORB::makeImplemId [lindex $info 1] [lindex $info 2]]
set def [[ORB::nameServer] findServerDefinition $implemId]
$this label [lindex $def 0]
$this icon rep_dbsrv_16
$this activeIcon rep_dbsrv_16
$this canChangeParams 1
$this canShutdown 1
# End constructor user section
return $this
}
method CSServerNode::destructor {this} {
# Start destructor user section
# End destructor user section
$this CSProcessNode::destructor
}
method CSServerNode::childName {this object} {
set nodeName [$object identity]
regsub -all {\.} $nodeName {_} nodeName
return $nodeName
}
method CSServerNode::changeParameters {this} {
if {[$this paramDialog] == ""} {
set server [$this server]
set name "paramdlg-[[$server broker] name]-[$server name]"
regsub -all {\.} $name {_} name
$this paramDialog [CSParamDialog new [$this view].$name \
[$this view] \
$this \
"list [$this server]" \
[$this changeableParameters]]
}
[$this paramDialog] popUp
}
method CSServerNode::changeableParameters {this} {
return [list orb_timeout orb_linger orb_report]
}
method CSServerNode::shutdown {this {confirm 1}} {
if $confirm {
set name [$this name]
$this confirmShutdown "Server '$name'" \
"Are you sure you want to shutdown server '$name'?" \
shutdownServer
return
}
if [catch {[$this server] shutdown} shutdownError] {
[$this view] error $shutdownError
} else {
set broker [[$this parent] parent]
$broker update 1
}
}
method CSServerNode::doUpdate {this {rebuild 1}} {
$this CSProcessNode::doUpdate $rebuild
set info [$this info]
set server [$this server]
ORB::splitImplemId [$server implemId] implemId implemVersion
set fullId ${implemId}.${implemVersion}
set upTime [Repository::formatSeconds [$server upTime]]
set idleTime [Repository::formatSeconds [$server idleTime]]
$info addHeader "Server"
$info addItem "Name" [$server name]
$info addItem "Implementation Id" [format "%10s" $fullId]
$info addItem "Port" [format "%10d" [$server port]]
$info addItem "Up Time" [format "%10s" $upTime]
$info addItem "Idle Time" [format "%10s" $idleTime]
$info addItem "Requests Handled" [format "%10d" [$server requests]]
$info addItem "Heartbeat Interval" [format "%10d" [$server beatInterval]]
$info addItem "Max Missed Heartbeats" \
[format "%10d" [$server maxMissedBeats]]
$info addItem "Busyness" [format "%10.3f" [$server busyness]]
$info addHeader "Parameters"
$info addParameter orb_timeout [$server getParameter orb_timeout]
$info addParameter orb_linger [$server getParameter orb_linger]
$info addParameter orb_report [$server getParameter orb_report]
$info addParameter orb_maxclients [$server getParameter orb_maxclients]
$info addParameter orb_maxinstances [$server getParameter orb_maxinstances]
}
# Do not delete this line -- regeneration end marker