Here is a sample Java program that submits a STAX LIST JOBS request,
iterates through the result, and submits a STAX TERMINATE JOB request for
each running job.
import com.ibm.staf.*;
import java.util.*;
public class Terminate
{
public static void main(String[] args)
{
STAFHandle handle = null;
try
{
handle = new STAFHandle("Test");
}
catch(STAFException e)
{
e.printStackTrace();
System.exit(1);
}
STAFResult result = handle.submit2("local", "STAX",
"LIST JOBS ");
STAFMarshallingContext mc = STAFMarshallingContext.unmarshall(
result.result);
List jobList = (List)mc.getRootObject();
Iterator iter = jobList.iterator();
while (iter.hasNext())
{
Map jobMap = (Map)iter.next();
String jobID = (String)jobMap.get("jobID");
System.out.println("JobID: " + jobID);
result = handle.submit2("local", "STAX",
"TERMINATE JOB " + jobID);
System.out.println("STAX TERMINATE JOB " + jobID + " RC="
+
result.rc + ", Result=" + result.result);
}
}
}
Here is an example of running this program when 2 STAX jobs are executing:
$ java Terminate
JobID: 3
STAX TERMINATE JOB 3 RC=0, Result=
JobID: 4
STAX TERMINATE JOB 4 RC=0, Result=
Thanks,
David
David Bender
STAF/STAX Development
IBM Software Group, WPLC
11501 Burnet Rd.
Bldg. 903-5B002
Austin, TX 78758-3400
Phone (T/L): 1-512-286-5315 (363-5315)
ITN: 23635315
Email: bda...@us.ibm.com
Li Wiston <wiston.l...@gmail.com>
07/27/2009 08:35 PM
To
David Bender/Austin/i...@ibmus
cc
staf-users@lists.sourceforge.net, sha...@acmet.com
Subject
Re: [staf-users] How to get all job and terminate them?
Okay,
Now the question is how to iterate through the results and get the field
value of each job id by after execute the request?
any good methods provider for this?
2009/7/27 David Bender <bda...@us.ibm.com>
STAF provides APIs (for Java, Python, Perl, and Tcl) that allow you to
submit requests to STAF services. So, in your program you could submit a
STAX LIST JOBS request, then iterate through the results for each Job ID,
and then submit a STAX TERMINATE JOB xx request.
Thanks,
David
David Bender
STAF/STAX Development
IBM Software Group, WPLC
11501 Burnet Rd.
Bldg. 903-5B002
Austin, TX 78758-3400
Phone (T/L): 1-512-286-5315 (363-5315)
ITN: 23635315
Email: bda...@us.ibm.com
Li Wiston <wiston.l...@gmail.com>
07/27/2009 08:26 AM
To
sha...@acmet.com
cc
staf-users@lists.sourceforge.net, David Bender/Austin/i...@ibmus
Subject
Re: [staf-users] How to get all job and terminate them?
Yes, I known his.
whether i can get the job IDs and assign them to variable or not ? so that
terminate the job one by one in my program?
or any other way can retrieve each of iDs?
thanks.
-Wiston
2009/7/27 Shahid <sha...@acmet.com>
>> But, I want to terminate all jobs by program. so, I have to get the
lists for pending job ids by program or need to terminate all jobs
>> if STAF provides such a command?
I think STAF does not provide any command for terminating all pending
jobs. But if you will re-start STAF framework, then all the pending jobs
will be terminated automatically.
Without re-starting STAF framework, you can terminate all pending jobs
with the help of program by using following alog:
1. List all the pending jobs
2. Extract pending job ID
3. Terminate the job with the help of job ID [This should be done
one by one]
With Regards,
Mohammad Shahid Jamal
From: Li Wiston [mailto:wiston.l...@gmail.com]
Sent: Sunday, July 26, 2009 6:44 AM
To: sha...@acmet.com
Cc: David Bender; staf-users@lists.sourceforge.net
Subject: Re: [staf-users] How to get all job and terminate them?
Thanks Shahid
But, I want to terminate all jobs by program. so, I have to get the lists
for pending job ids by program or need to terminate all jobs
if STAF provides such a command?
2009/7/24 Shahid <sha...@acmet.com>
You can get the pending jobs with the help of following command:
STAF <MACHINE NAME> STAX LIST JOBS
Above command will list all the pending job submitted to STAX execution
engine.
You can terminate the pending STAX Job execution with the help of
following command:
STAF <MACHINE NAME> STAX TERMINATE JOB <JOB ID>
>> Which reason can result in the block jobs?
Currently I don’t know the exact reason behind it.
But before few months, we have also faced similar problem. The reason of
the problem was, using the DOS command in STAX Job, at the time of
executing the DOS command in STAX Job, Job gets hanged. Please check this
might be the case.
With Regards,
Mohammad Shahid Jamal
From: Li Wiston [mailto:wiston.l...@gmail.com]
Sent: Friday, July 24, 2009 11:50 AM
To: sha...@acmet.com
Cc: David Bender; staf-users@lists.sourceforge.net
Subject: Re: [staf-users] How to get all job and terminate them?
Hi, all
For unknown issues, there are some blocked jobs for the STAX execution, my
question is How to get all job and terminate them? and which reason can
result in the block jobs?
can anyone give us some clue?
thanks in advance.
2009/7/21 Shahid <sha...@acmet.com>
>> Can you clarify exactly what you mean by "profiling" STAX job
execution?
Profiling of STAX Job means to gather following information about STAX Job
execution:
1. Memory / CPU usage by services / methods written in STAX Job
2. Checking the memory leak during STAX Job execution
3. Checking the dead lock condition during STAX Job execution
4. Time taken by STAF services used in STAX Job and method written
in STAX Job for completing the request
Hope, now you got the purpose of profiling of STAX Job.
>>The following Help forum thread has some more information:
>>
>>http://sourceforge.net/forum/message.php?msg_id=7421451
Thanks for providing the link. I will check information present at:
http://sourceforge.net/forum/message.php?msg_id=7421451 and let you know
it status.
Thanks and Regards,
Mohammad Shahid Jamal
From: David Bender [mailto:bda...@us.ibm.com]
Sent: Monday, July 20, 2009 7:22 PM
To: sha...@acmet.com
Cc: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] How to profile STAX Job Execution?
Can you clarify exactly what you mean by "profiling" STAX job execution?
If you mean analyzing memory usage, performance, etc., there is no
software provided with STAF/STAX to do that. However, STAX is written in
Java, so you could use Java profiling tools to do the analysis.
The following Help forum thread has some more information:
http://sourceforge.net/forum/message.php?msg_id=7421451
Thanks,
David
David Bender
STAF/STAX Development
IBM Software Group, WPLC
11501 Burnet Rd.
Bldg. 903-5B002
Austin, TX 78758-3400
Phone (T/L): 1-512-286-5315 (363-5315)
ITN: 23635315
Email: bda...@us.ibm.com
"Shahid" <sha...@acmet.com>
07/20/2009 12:42 AM
Please respond to
sha...@acmet.com
To
<staf-users@lists.sourceforge.net>
cc
Subject
[staf-users] How to profile STAX Job Execution?
How we can profile the STAX Job execution? Is there any software available
for profiling STAX Job execution?
With Regards,
Mohammad Shahid Jamal
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users