home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)csimplemno.tcl /main/hindenburg/10
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)csimplemno.tcl /main/hindenburg/10 18 Oct 1996 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"
- # 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 canChangeParams 1
- $this canShutdown 1
- $this activated "$this changeParameters"
-
- # 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 [osort pid -integer [[$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]
- $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 "Shutdown All Servers Of '$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
-
-