The following example starts a listener port on an application server.
Using Jacl:
set lPorts [$AdminControl queryNames type=ListenerPort,cell=mycell,node=mynode,process=server1,*]This command returns a list of listener port MBeans.
Example output:
WebSphere:cell=mycell,name=ListenerPort,mbeanIdentifier=server.xml#ListenerPort_1,type=ListenerPort,node=mynode,process=server1 WebSphere:cell=mycell,name=listenerPort,mbeanIdentifier=ListenerPort,type=server.xml#ListenerPort_2,node=mynode,process=server1
Using Jacl:
foreach lPort $lPorts { set state [$AdminControl getAttribute $lport started] if {$state == "false"} { $AdminControl invoke $lPort start } }
This
piece of Jacl code loops through the listener port MBeans. For each listener
port MBean, get the attribute value for the started attribute. If the attribute
value is set to false, then start the listener port by invoking the
start operation on the MBean.