|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.jonas_lib.JWorkManager
public class JWorkManager
Jonas Implementation of the Resource Work Manager
Field Summary | |
---|---|
protected static long |
FEW_MORE_SECONDS
|
protected int |
freeThreads
|
protected int |
maxpoolsz
|
protected int |
minpoolsz
|
protected static int |
poolnumber
|
protected int |
poolsz
|
protected static int |
threadnumber
|
protected boolean |
valid
|
protected long |
waitingTime
|
protected java.util.LinkedList |
workList
|
Fields inherited from interface javax.resource.spi.work.WorkManager |
---|
IMMEDIATE, INDEFINITE, UNKNOWN |
Constructor Summary | |
---|---|
JWorkManager(int minsz,
int maxsz,
org.objectweb.transaction.jta.TransactionManager tm,
long threadwait)
Constructor |
Method Summary | |
---|---|
void |
doWork(javax.resource.spi.work.Work work)
Accepts a Work instance for processing. |
void |
doWork(javax.resource.spi.work.Work work,
long timeout,
javax.resource.spi.work.ExecutionContext ectx,
javax.resource.spi.work.WorkListener listener)
Accepts a Work instance for processing. |
int |
getCurrentPoolSize()
|
int |
getMaxPoolSize()
|
int |
getMinPoolSize()
|
void |
nextWork()
Get the next JWork object to be run. |
void |
scheduleWork(javax.resource.spi.work.Work work)
Accepts a Work instance for processing. |
void |
scheduleWork(javax.resource.spi.work.Work work,
long timeout,
javax.resource.spi.work.ExecutionContext ectx,
javax.resource.spi.work.WorkListener listener)
Accepts a Work instance for processing. |
void |
setMaxPoolSize(int maxsz)
Set the max pool size |
void |
setMinPoolSize(int minsz)
Set the min pool size |
long |
startWork(javax.resource.spi.work.Work work)
Accepts a Work instance for processing. |
long |
startWork(javax.resource.spi.work.Work work,
long timeout,
javax.resource.spi.work.ExecutionContext ectx,
javax.resource.spi.work.WorkListener listener)
Accepts a Work instance for processing. |
void |
stopThreads()
Remove this WorkManager : Stop all threads |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.LinkedList workList
protected static int poolnumber
protected static int threadnumber
protected int maxpoolsz
protected int minpoolsz
protected int poolsz
protected int freeThreads
protected long waitingTime
protected boolean valid
protected static final long FEW_MORE_SECONDS
Constructor Detail |
---|
public JWorkManager(int minsz, int maxsz, org.objectweb.transaction.jta.TransactionManager tm, long threadwait)
threadwait
- max time in seconds a thread will waitMethod Detail |
---|
public int getCurrentPoolSize()
public int getMinPoolSize()
public int getMaxPoolSize()
public void setMinPoolSize(int minsz)
minsz
- public void setMaxPoolSize(int maxsz)
maxsz
- public void doWork(javax.resource.spi.work.Work work) throws javax.resource.spi.work.WorkException
doWork
in interface javax.resource.spi.work.WorkManager
work
- The unit of work to be done. Could be long or short-lived.
javax.resource.spi.work.WorkRejectedException
- a Work instance has been rejected from further processing.
javax.resource.spi.work.WorkCompletedException
- a Work instance has completed execution with an exception.
javax.resource.spi.work.WorkException
public void doWork(javax.resource.spi.work.Work work, long timeout, javax.resource.spi.work.ExecutionContext ectx, javax.resource.spi.work.WorkListener listener) throws javax.resource.spi.work.WorkException
doWork
in interface javax.resource.spi.work.WorkManager
work
- The unit of work to be done. Could be long or short-lived.timeout
- a time duration (in milliseconds) within which the
execution of the Work instance must start. Otherwise, the Work
instance is rejected with a WorkRejectedException set to an
appropriate error code (WorkRejectedException.TIMED_OUT).ectx
- an object containing the execution context with which the
submitted Work instance must be executed.listener
- an object which would be notified when the various Work
processing events (work accepted, work rejected, work started,
work completed) occur.
javax.resource.spi.work.WorkRejectedException
- a Work instance has been rejected from
further processing.
javax.resource.spi.work.WorkCompletedException
- a Work instance has completed execution
with an exception.
javax.resource.spi.work.WorkException
public long startWork(javax.resource.spi.work.Work work) throws javax.resource.spi.work.WorkException
startWork
in interface javax.resource.spi.work.WorkManager
work
- The unit of work to be done. Could be long or short-lived.
javax.resource.spi.work.WorkRejectedException
- a Work instance has been rejected from
further processing.
javax.resource.spi.work.WorkException
public long startWork(javax.resource.spi.work.Work work, long timeout, javax.resource.spi.work.ExecutionContext ectx, javax.resource.spi.work.WorkListener listener) throws javax.resource.spi.work.WorkException
startWork
in interface javax.resource.spi.work.WorkManager
work
- The unit of work to be done. Could be long or short-lived.timeout
- a time duration (in milliseconds) within which the
execution of the Work instance must start. Otherwise, the Work
instance is rejected with a WorkRejectedException set to an
appropriate error code (WorkRejectedException.TIMED_OUT).ectx
- an object containing the execution context with which the
submitted Work instance must be executed.listener
- an object which would be notified when the various Work
processing events (work accepted, work rejected, work started,
work completed) occur.
javax.resource.spi.work.WorkRejectedException
- a Work instance has been rejected from
further processing.
javax.resource.spi.work.WorkException
public void scheduleWork(javax.resource.spi.work.Work work) throws javax.resource.spi.work.WorkException
scheduleWork
in interface javax.resource.spi.work.WorkManager
work
- The unit of work to be done. Could be long or short-lived.timeout
- a time duration (in milliseconds) within which the
execution of the Work instance must start. Otherwise, the Work
instance is rejected with a WorkRejectedException set to an
appropriate error code (WorkRejectedException.TIMED_OUT).ectx
- an object containing the execution context with which the
submitted Work instance must be executed.listener
- an object which would be notified when the various Work
processing events (work accepted, work rejected, work started,
work completed) occur.
javax.resource.spi.work.WorkRejectedException
- a Work instance has been rejected from
further processing.
javax.resource.spi.work.WorkException
public void scheduleWork(javax.resource.spi.work.Work work, long timeout, javax.resource.spi.work.ExecutionContext ectx, javax.resource.spi.work.WorkListener listener) throws javax.resource.spi.work.WorkException
scheduleWork
in interface javax.resource.spi.work.WorkManager
work
- The unit of work to be done. Could be long or short-lived.timeout
- a time duration (in milliseconds) within which the
execution of the Work instance must start. Otherwise, the Work
instance is rejected with a WorkRejectedException set to an
appropriate error code (WorkRejectedException.TIMED_OUT).ectx
- an object containing the execution context with which the
submitted Work instance must be executed.listener
- an object which would be notified when the various Work
processing events (work accepted, work rejected, work started,
work completed) occur.
javax.resource.spi.work.WorkRejectedException
- a Work instance has been rejected from
further processing.
javax.resource.spi.work.WorkException
public void nextWork() throws javax.resource.spi.work.WorkException, java.lang.InterruptedException
javax.resource.spi.work.WorkException
java.lang.InterruptedException
public void stopThreads()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |