Where in the world is com.ibm.ws.scripting.adminCommand.AdminTask?

元气小坏坏 提交于 2019-12-23 15:33:48

问题


Frustrated with the damn awful API provided by WebSphere Admin Server, I'm writing my own Java DSL wrapper. My jython files now simply read:

from my.package import MyDSL
config = MyDSL(AdminConfig, AdminTask)
config.goGoGadgetSkates() # or something like that

The essential part is that I send through the (#%$$!@#) god objects AdminConfig and AdminTask so that the DSL can use them to perform operations in WAS.

In order to compile the DSL I need to include the class files for this two objects. I find them by first setting the constructor as:

public MyDSL(Object a, Object b) {
    System.out.println(a.getClass());
    System.out.println(b.getClass());
}

The output showed that the AdminConfig object is an instance of com.ibm.ws.scripting.AdminConfigClient. I easily located the jar that contains this class and all is well.

But AdminTask is an instance of com.ibm.ws.scripting.adminCommand.AdminTask. Despite being present at runtime, this class does not exist anywhere in my classpath or indeed anywhere on my computer's hard drive.

I can only assume com.ibm.ws.scripting.adminCommand.AdminTask is constructed magically by WSAdmin in the jython layer. Perhaps it is defined as a python class?

Before I resort to reflection, can someone please explain where com.ibm.ws.scripting.adminCommand.AdminTask might live and how I might extract a copy of the class file?


回答1:


The AdminConfigClient class is not API/SPI, so you are creating a fragile infrastructure by relying on that class. The API/SPI entry point is ConfigServiceFactory.

The AdminTask object is backed by the data in CommandMgr. It should be possible to use CommandMgr to do anything you can do with AdminTask.



来源:https://stackoverflow.com/questions/9578490/where-in-the-world-is-com-ibm-ws-scripting-admincommand-admintask

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!