diongillard 05/11/02 15:17:32
Added: was5config/plugin-resources nodesync.jacl
Log:
Added from previous
Revision Changes Path
1.1 maven-plugins/was5config/plugin-resources/nodesync.jacl
Index: nodesync.jacl
===================================================================
proc nodesync {nodes} {
#--------------------------------------------------------------
# set up globals
#--------------------------------------------------------------
global AdminConfig
global AdminControl
global AdminApp
#---------------------------------------------------------
# We assume that there is only one cell, and we are on it
#---------------------------------------------------------
set cellname [$AdminControl getCell]
set index 1
foreach nodeName $nodes {
set node [$AdminConfig getid /Cell:$cellname/Node:$nodeName/]
puts "Checking for the existence of a NodeSync MBean on node $nodeName"
set nodeSync [$AdminControl completeObjectName type=NodeSync,node=$nodeName,*]
if {[llength $nodeSync] == 0} {
puts "Error -- NodeSync MBean not found for name $nodeName"
return
}
set enabled [$AdminControl getAttribute $nodeSync serverStartupSyncEnabled]
if {[string compare $enabled "false"] == 0} {
puts "Invoking synchronization for node because serverStartupSyncEnabled is set to false..."
$AdminControl invoke $nodeSync sync
puts "Done with synchronization."
}
}
}
#-----------------------------------------------------------------
# Main
#-----------------------------------------------------------------
if { !($argc == 1) } {
puts "This script requires 1 parameter: nodes"
puts "e.g.: nodesync 'node1 node2'"
} else {
set nodes [lindex $argv 0]
nodesync $nodes
}
|