home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
csimplemno.tcl
< prev
next >
Wrap
Text File
|
1997-11-06
|
6KB
|
187 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1996
#
# File: @(#)csimplemno.tcl /main/titanic/8
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)csimplemno.tcl /main/titanic/8 5 Nov 1997 Copyright 1996 Cayenne Software Inc.
# Start user added include file section
require "csbrokerno.tcl"
require "csnameserv.tcl"
require "csdbserver.tcl"
require "cslockserv.tcl"
require "csparamdia.tcl"
proc CSImplemNode::cmpObject {obj1 obj2} {
set info [ORB::decodeObjectId [$obj1 identity]]
set implemId [ORB::makeImplemId [lindex $info 1] [lindex $info 2]]
set def [[ORB::nameServer] findServerDefinition $implemId]
set name1 [lindex $def 0]
set info [ORB::decodeObjectId [$obj2 identity]]
set implemId [ORB::makeImplemId [lindex $info 1] [lindex $info 2]]
set def [[ORB::nameServer] findServerDefinition $implemId]
set name2 [lindex $def 0]
return [string compare $name1 $name2]
}
# End user added include file section
require "csnode.tcl"
Class CSImplemNode : {CSNode} {
constructor
method destructor
method childName
method childObjects
method createChild
method changeParameters
method shutdown
method doUpdate
attribute implem
attribute paramDialog
}
constructor CSImplemNode {class this name i_implem} {
set this [CSNode::constructor $class $this $name]
$this implem $i_implem
# Start constructor user section
$this label [$i_implem name]
$this icon rep_implem_16
$this activeIcon rep_implem_16
$this canChangeParams 1
$this canShutdown 1
# End constructor user section
return $this
}
method CSImplemNode::destructor {this} {
# Start destructor user section
# End destructor user section
$this CSNode::destructor
}
method CSImplemNode::childName {this object} {
set nodeName [$object identity]
regsub -all {\.} $nodeName {_} nodeName
return $nodeName
}
method CSImplemNode::childObjects {this} {
return [lsort -command CSImplemNode::cmpObject [[$this implem] servers]]
}
method CSImplemNode::createChild {this object} {
set name $this.[$this childName $object]
set implem [$this implem]
set id [$implem id]
switch $id {
1 { CSBrokerNode new $name $object }
2 { CSNameServerNode new $name $object }
100 { CSLockServerNode new $name $object }
default {
if {$id > 100 && $id < 1000} {
CSDbServerNode new $name $object
} else {
# For lockcallback (99), BrokerProxy plus
# BrokerImplemServer (> 1000) implementations.
#
CSServerNode new $name $object
}
}
}
return $name
}
method CSImplemNode::changeParameters {this} {
if {[$this paramDialog] == ""} {
set implem [$this implem]
set name paramdlg-[[$implem broker] name]-[$implem name]
regsub -all {\.} $name {_} name
$this paramDialog [CSParamDialog new .main.$name \
[$this view] \
$this \
"concat [list $implem] \[$implem servers]" \
[list orb_timeout \
orb_linger \
orb_report \
orb_maxclients \
orb_maxinstances]]
}
[$this paramDialog] popUp
}
method CSImplemNode::shutdown {this {confirm 1}} {
if $confirm {
set name [$this name]
set host [[[$this implem] broker] host]
$this confirmShutdown "All Servers Of Implementation '$name' On '$host'" \
"Are you sure you want to shutdown all servers\
of implementation '$name' on host '$host'?" shutdownImplem
return
}
set shutdownCount 0
set implem [$this implem]
foreach server [$implem servers] {
if [catch {$server shutdown} shutdownError] {
[$this view] error $shutdownError
} else {
incr shutdownCount
}
}
if {$shutdownCount > 0} {
set broker [$this parent]
$broker update 1
}
}
method CSImplemNode::doUpdate {this {rebuild 1}} {
$this CSNode::doUpdate $rebuild
set implem [$this implem]
set info [$this info]
$info addHeader "Implementation"
$info addItem "Name" [$implem name]
$info addItem "Id" [$implem id].[$implem version]
$info addItem "Policy" [$implem policy]
$info addItem "Protocol" [$implem protocol]
if {[$implem executable] != ""} {
$info addItem "Executable Path" [$implem executable]
}
if {[$implem commandLine] != ""} {
$info addItem "Command Line" [$implem commandLine]
}
if {[$implem host] != ""} {
$info addItem "Host" [$implem host]
}
if {[$implem object] != [[ORB::nil] identity]} {
$info addItem "Object" [$implem object]
}
if {[$implem method] != 0} {
$info addItem "Method" [$implem method]
}
$info addHeader "Parameters"
$info addParameter orb_timeout [$implem getParameter orb_timeout]
$info addParameter orb_linger [$implem getParameter orb_linger]
$info addParameter orb_report [$implem getParameter orb_report]
$info addParameter orb_maxclients [$implem getParameter orb_maxclients]
$info addParameter orb_maxinstances [$implem getParameter orb_maxinstances]
}
# Do not delete this line -- regeneration end marker