【发布时间】:2014-02-10 14:10:42
【问题描述】:
我正在编写一个工具来验证 Web 应用程序的 WebSphere 设置。我希望能够通过 java AdminClient 对象远程连接到服务器来查找 WebSphere 变量(所有范围)的所有可能值。我已经阅读了another post about this,尽管我认为我现在拥有正确的代码,但我无法使用 AdminOperations MBean,因为我必须使用的 WebSphere 帐户没有被授予管理员权限。我想知道是否有一种方法可以在不使用 AdminOperations 的情况下解析 WebSphere 变量。谢谢!
到目前为止,这是我的代码(同样,由于权限问题而无法使用):
private static String expandVariable(AdminClient client, String s)
throws Exception
{
Set result = client.queryNames(new ObjectName("*:*,type=AdminOperations,process=exampleProcess"), null);
return (String)client.invoke((javax.management.ObjectName)
result.iterator().next(),"expandVariable",new Object[]
{"${"+s+"}"}, new String[] {"java.lang.String"});
}
【问题讨论】:
标签: java websphere remote-access