home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)csbrokerno.tcl /main/hindenburg/8
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)csbrokerno.tcl /main/hindenburg/8 18 Oct 1996 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- require csimplemno.tcl
- # End user added include file section
-
- require "csserverno.tcl"
-
- Class CSBrokerNode : {CSServerNode} {
- constructor
- method destructor
- method childObjects
- method createChild
- method changeableParameters
- method shutdown
- method doUpdate
- }
-
- constructor CSBrokerNode {class this name i_server} {
- set this [CSServerNode::constructor $class $this $name $i_server]
- # Start constructor user section
-
- $this label [$i_server name]
- $this icon rep_broker_16
-
- # End constructor user section
- return $this
- }
-
- method CSBrokerNode::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this CSServerNode::destructor
- }
-
- method CSBrokerNode::childObjects {this} {
- set implems {}
- set broker [$this server]
- foreach implem [osort fullId -integer [$broker implementations]] {
- # Skip lockcallbacks for now.
- #
- if {[$implem id] == 99} {
- continue
- }
- lappend implems $implem
- }
- return $implems
- }
-
- method CSBrokerNode::createChild {this object} {
- return [CSImplemNode new $this.[$this childName $object] $object]
- }
-
- method CSBrokerNode::changeableParameters {this} {
- return [list orb_timeout]
- }
-
- method CSBrokerNode::shutdown {this {confirm 1}} {
- set ns [ORB::nameServer]
- set broker [$this server]
-
- if $confirm {
- set name [$this name]
- set host [$broker host]
- set includingNameServer ""
- if {$host == [$ns host] && [$broker pid] == [$ns pid]} {
- set includingNameServer ", including the nameserver"
- }
-
- $this confirmShutdown "Shutdown Broker On '$host'" \
- "Are you sure you want to shutdown the broker on host '$host'\
- \nand all of its servers${includingNameServer}?" shutdownBroker
- return
- }
-
- # Shutdown all servers started by this broker.
- #
- set shutdownCount 0
- foreach implem [$broker implementations] {
- foreach server [$implem servers] {
- if [catch {$server shutdown} shutdownError] {
- [$this view] error $shutdownError
- } else {
- incr shutdownCount
- }
- }
- }
-
- # Shutdown the broker itself.
- #
- if [catch {$broker shutdown} shutdownError] {
- [$this view] error $shutdownError
- } else {
- incr shutdownCount
- }
-
- if {$shutdownCount > 0} {
- set brokers [$this parent]
- $brokers update 0
- }
- }
-
- method CSBrokerNode::doUpdate {this {rebuild 1}} {
- $this CSServerNode::doUpdate $rebuild
- }
-
- # Do not delete this line -- regeneration end marker
-
-