In this example, the Java class file HelloWorld was compiled with a no-args constructor and contains a method called sayHello. The Java class file is contained in a Java package called hello that is saved to a JAR file called hello-world.jar.
The custom action is available at the cell scope for a network deployment WebSphere® Application Server cell.
The custom action is saved to the build file: custom_configure_was_common_nd.xml.
The hello-world.jar file is compiled using the JDK V1.4 so that it can be executed by the wsadmin client on a WebSphere V6.0 target system.
import hello.HelloWorld as HelloWorld ## parse any arguments from wsadmin and say hello optDict, args = SystemUtils.getopt(sys.argv, 'who:') recv= optDict['who'] talker = HelloWorld() talker.sayHello(recv)
<target name="user_say_hello" description="Use wsadmin to say hello">
<antcall target="call_wsadmin">
<param name="TASK" value="user_say_hello"/>
<param name="SCRIPT_NAME" value="${RAFW_HOME}/user/actions/configure/
was/common/nd/scripts/hello.py"/>
<param name="ARGS" value="-who World"/>
</antcall>
</target>
rafw.sh -e env_name -c cell_name -list
rafw.sh -e env_name -c cell_name -t user_say_hello