|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wm.app.tn.delivery.JobMgr
public class JobMgr
Implemented as a singleton in order to provide only one job store, job list and background processing thread (for job processing and expiration).
Method Summary | |
---|---|
void |
access()
Register with the job manager |
void |
changeServerForJob(java.lang.String jobId,
java.lang.String serverId)
Changes the job from one server to another server. |
void |
changeSweepTime(long t)
Change the time to wait between runs of the main processing thread. |
boolean |
enabled()
Job manager singleton has been initialized and is referenced. |
int |
getActiveJobCount()
|
GuaranteedJob |
getAnyJob(java.lang.String jobId,
boolean content)
Used to get any GuaranteedJob regardless of the server it is on. |
GuaranteedJob |
getJob(java.lang.String jobId,
boolean content)
|
java.lang.String[] |
getJobIds()
|
static JobMgr |
getJobMgr()
Use this method to get a handle to the job manager in order to manage jobs. |
com.wm.data.IData |
getJobOutput(java.lang.String jobId,
long maxWaitTime)
Gets the output of a job. |
java.lang.String |
getJobStatus(java.lang.String jobId)
|
int |
getMaxJobs()
|
double |
getMaxThreadPoolPct()
|
java.lang.String |
getServerId()
|
long |
getSweepTime()
|
boolean |
hasJobs()
|
static JobMgr |
init()
Initialize the singleton job manager if not already initialized and start background thread. |
boolean |
jobExists(java.lang.String jobId)
|
void |
release()
Deregister from job manager. |
void |
removeJob(java.lang.String jobId)
Remove a job from the job manager. |
void |
reset()
Reset the job manager. |
void |
restartJob(java.lang.String jobId)
Restart a job that has failed or been stopped. |
void |
run()
Background Thread |
void |
setMaxThreadPoolPct(double max)
Sets the portion of the server's threadpool that will be used by the JobMgr. |
boolean |
shutdown(boolean force)
Terminate the job manager if no users are registered or if force is specified. |
int |
size()
|
void |
startDbUpdaterThread()
|
void |
startJob(GuaranteedJob job,
boolean hold)
Start a new job |
void |
stopJob(java.lang.String jobId)
Stop a job that is running. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JobMgr init() throws DeliveryException
DeliveryException
- Unable to initialize job managerpublic void access()
public static JobMgr getJobMgr()
public java.lang.String getServerId()
public void changeSweepTime(long t)
t
- Time to wait (in seconds). If 0 (zero), the current value of tn.task.sweepTime
is used.public long getSweepTime()
public void release()
public boolean enabled()
public void reset() throws DeliveryException
DeliveryException
public boolean shutdown(boolean force) throws DeliveryException
force
- force a shutdown even if jobs are being processed
DeliveryException
- Active jobs without a forceful shutdownpublic void changeServerForJob(java.lang.String jobId, java.lang.String serverId) throws DeliveryException
jobId
- id of the job to moveserverId
- id of the server to move the job to
DeliveryException
public java.lang.String[] getJobIds()
public GuaranteedJob getJob(java.lang.String jobId, boolean content)
jobId
- Id of job to retrievecontent
- indicate whether or not to retrieve the content of the associated bizdoc
public GuaranteedJob getAnyJob(java.lang.String jobId, boolean content)
jobId
- Id of job to retrievecontent
- indicate whether or not to retrieve the content of the associated bizdoc
public com.wm.data.IData getJobOutput(java.lang.String jobId, long maxWaitTime) throws DeliveryException
jobId
- Id of job to retrieve output frommaxWaitTime
- maximum time (in millisec) to block waiting for job output
DeliveryException
public java.lang.String getJobStatus(java.lang.String jobId) throws DeliveryException
jobId
- id of the job to check
DeliveryException
public boolean hasJobs()
public boolean jobExists(java.lang.String jobId)
jobId
- id of job
public void removeJob(java.lang.String jobId) throws DeliveryException
jobId
- id of the job to remove
DeliveryException
public void restartJob(java.lang.String jobId) throws DeliveryException
jobId
- id of the job to restart
DeliveryException
public void startJob(GuaranteedJob job, boolean hold) throws DeliveryException
job
- GuaranteedJob to be runhold
- boolean - indicating whether the job is to be held as the profile is set for Routing being switched
off
com.wm.tn.app.delivery.DeliveryException
DeliveryException
public void stopJob(java.lang.String jobId) throws DeliveryException
jobId
- id of the job to stop
com.wm.tn.app.delivery.DeliveryException
DeliveryException
public int size()
public int getActiveJobCount()
public double getMaxThreadPoolPct()
public int getMaxJobs()
public void setMaxThreadPoolPct(double max)
max
- Specify a value from .25 to .8. If max is too small or too large, its value is reset to .25 or
.8 and a warning is logged. If you pass 0 (zero), the value will be read from tn.task.threadpool.pct.public void run()
run
in interface java.lang.Runnable
public void startDbUpdaterThread()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |