如何在 WebSphere 的 jython 中导入 AdminControl?

How do I import AdminControl in WebSphere's jython?

当 运行 websphere 的 Jython 我无法调用 AdminControl 命令

Jython 2.1 on java1.6.0 (JIT: j9jit26)
Type "copyright", "credits" or "license" for more information.
>>> cellName = AdminControl.getCell()
Traceback (innermost last):
  File "<console>", line 1, in ?
NameError: AdminControl

我没有从 IBM 或其他地方看到任何表明需要导入 AdminControl 的信息,所以我不确定为什么上面的方法不起作用。

备注
WebSphere 8.5
我是 运行 jython,命令是:

"$WAS_8_5_HOME"/java/jre/bin/java.exe -jar "$WAS_8_5_HOME"/optionalLibraries/jython/jython.jar

你不能。 AdminControl 对象由内部类型支持,并且在启动时由 wsadmin 注册。使用它的唯一方法是通过 wsadmin -lang jython(可能使用 -f script.py)。