You can use WebSphere Application Server to define, start,
stop, and monitor generic servers.
About this task
A generic server is a server that the WebSphere Application
Server manages but did not supply.
Procedure
- To define a generic server, use the following example:
Using Jacl:
$AdminTask createGenericServer mynode {-name generic1 -ConfigProcDef
{{"/mydir1/myStartCommand" "arg1 arg2" "" "" "/tmp/workingDirectory"
"/mydir2/stopCommand" "argy argz"}}}
$AdminConfig save
Using Jython:
AdminTask.createGenericServer('mynode', '[-name generic1 -ConfigProcDef
[[/mydir1/myStartCommand "a b c" "" "" /tmp/workingDirectory
/mydir2/myStopCommand "x y z"]]]')
AdminConfig.save()
- To start a generic server, use the launchProcess parameter,
for example:
Using Jacl:
set nodeagent [$AdminControl queryNames *:*,type=NodeAgent]
$AdminControl invoke $nodeagent launchProcess generic1
Using Jython:
nodeagent = AdminControl.queryNames ('*:*,type=NodeAgent')
AdminControl.invoke(nodeagent, 'launchProcess', 'generic1')
Example output:
true
or
false
- To stop a generic server, use the terminate parameter,
for example:
Using Jacl:
set nodeagent [$AdminControl queryNames *:*,type=NodeAgent]
$AdminControl invoke $nodeagent terminate generic1
Using Jython:
nodeagent = AdminControl.queryNames ('*:*,type=NodeAgent')
AdminControl.invoke(nodeagent, 'terminate', 'generic1')
Example output:
true
or
false
- To monitor the server state, use the getProcessStatus parameter,
for example:
Using Jacl:
$AdminControl invoke $nodeagent getProcessStatus generic1
Using
Jython:
AdminControl.invoke(nodeagent, 'getProcessStatus', 'generic1')
Example output:
RUNNING
or
STOPPED