我正在尝试使用wlst监视域中托管服务器上的部署状态 .
我使用的是Weblogic 10.3
这是我到目前为止:
domainRuntime()
applnRtStEuntimeBean = cmo.getAppRuntimeStateRuntime()
servers=domainRuntimeService.getServerRuntimes()
for server in servers:
serverName = server.getName()
applns = server.getApplicationRuntimes();
for appln in applns:
print 'Application Name #', appln.getApplicationName()
print 'Applican Current State #', applnRtStEuntimeBean.getCurrentState(appName,serverName)
print 'Applican Intended State #', applnRtStEuntimeBean.getIntendedState(appName)
This gives me the current state of all applications irrespective of its "type" . Is there a way one can filter applications by its type using wlst ?
例如,我只想检查“企业应用程序”和“Web应用程序”的状态,并忽略所有“库”
我查看了MBeans Java文档但我没有看到任何可以使我获得应用程序类型的内容 .
对于参考应用程序名称,类型,运行状况和状态将在管理控制台的“部署”页面中列出 .
感谢您的反馈/建议/意见!!
1 回答
Mohan是的你可以分两步过滤掉它 . 您可以在for循环中使用if条件,并在遇到库文件时使用'continue'忽略 .
请注意,您必须在此处遵循每个块的正确缩进 . HTH