Java Doc for JWorkManager.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas_lib » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » JOnAS 4.8.6 » org.objectweb.jonas_lib 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.objectweb.jonas_lib.JWorkManager

JWorkManager
public class JWorkManager implements WorkManager(Code)
Jonas Implementation of the Resource Work Manager
author:
   durieuxp

Inner Class :class JWork
Inner Class :class WorkThread extends Thread

Field Summary
final protected static  longFEW_MORE_SECONDS
    
protected  intfreeThreads
    
protected  intmaxpoolsz
    
protected  intminpoolsz
    
protected static  intpoolnumber
    
protected  intpoolsz
    
protected static  intthreadnumber
    
protected  booleanvalid
    
protected  longwaitingTime
    
protected  LinkedListworkList
    

Constructor Summary
public  JWorkManager(int minsz, int maxsz, TransactionManager tm, long threadwait)
    

Method Summary
public  voiddoWork(Work work)
     Accepts a Work instance for processing. This call blocks until the Work instance completes execution. There is no guarantee on when the accepted Work instance would start execution ie., there is no time constraint to start execution.
Parameters:
  work - The unit of work to be done.
public  voiddoWork(Work work, long timeout, ExecutionContext ectx, WorkListener listener)
     Accepts a Work instance for processing.
public  intgetCurrentPoolSize()
    
public  intgetMaxPoolSize()
    
public  intgetMinPoolSize()
    
public  voidnextWork()
     Get the next JWork object to be run.
public  voidscheduleWork(Work work)
     Accepts a Work instance for processing.
public  voidscheduleWork(Work work, long timeout, ExecutionContext ectx, WorkListener listener)
     Accepts a Work instance for processing.
public  voidsetMaxPoolSize(int maxsz)
    
public  voidsetMinPoolSize(int minsz)
    
public  longstartWork(Work work)
     Accepts a Work instance for processing.
public  longstartWork(Work work, long timeout, ExecutionContext ectx, WorkListener listener)
     Accepts a Work instance for processing.
public synchronized  voidstopThreads()
    

Field Detail
FEW_MORE_SECONDS
final protected static long FEW_MORE_SECONDS(Code)



freeThreads
protected int freeThreads(Code)



maxpoolsz
protected int maxpoolsz(Code)



minpoolsz
protected int minpoolsz(Code)



poolnumber
protected static int poolnumber(Code)



poolsz
protected int poolsz(Code)



threadnumber
protected static int threadnumber(Code)



valid
protected boolean valid(Code)



waitingTime
protected long waitingTime(Code)



workList
protected LinkedList workList(Code)




Constructor Detail
JWorkManager
public JWorkManager(int minsz, int maxsz, TransactionManager tm, long threadwait)(Code)
Constructor
Parameters:
  threadwait - max time in seconds a thread will wait




Method Detail
doWork
public void doWork(Work work) throws WorkException(Code)
Accepts a Work instance for processing. This call blocks until the Work instance completes execution. There is no guarantee on when the accepted Work instance would start execution ie., there is no time constraint to start execution.
Parameters:
  work - The unit of work to be done. Could be long or short-lived.
throws:
  WorkRejectedException - a Work instance has been rejected from further processing.
throws:
  WorkCompletedException - a Work instance has completed execution with an exception.
throws:
  WorkException -



doWork
public void doWork(Work work, long timeout, ExecutionContext ectx, WorkListener listener) throws WorkException(Code)
Accepts a Work instance for processing. This call blocks until the Work instance completes execution.
Parameters:
  work - The unit of work to be done. Could be long or short-lived.
Parameters:
  timeout - a time duration (in milliseconds) within which theexecution of the Work instance must start. Otherwise, the Workinstance is rejected with a WorkRejectedException set to anappropriate error code (WorkRejectedException.TIMED_OUT).
Parameters:
  ectx - an object containing the execution context with which thesubmitted Work instance must be executed.
Parameters:
  listener - an object which would be notified when the various Workprocessing events (work accepted, work rejected, work started,work completed) occur.
throws:
  WorkRejectedException - a Work instance has been rejected fromfurther processing.
throws:
  WorkCompletedException - a Work instance has completed executionwith an exception.
throws:
  WorkException -



getCurrentPoolSize
public int getCurrentPoolSize()(Code)
current pool size



getMaxPoolSize
public int getMaxPoolSize()(Code)
max pool size



getMinPoolSize
public int getMinPoolSize()(Code)
min pool size



nextWork
public void nextWork() throws WorkException, InterruptedException(Code)
Get the next JWork object to be run. next JWork object to be run, or null if thread must end.



scheduleWork
public void scheduleWork(Work work) throws WorkException(Code)
Accepts a Work instance for processing. This call does not block and returns immediately once a Work instance has been accepted for processing. There is no guarantee on when the submitted Work instance would start execution ie., there is no time constraint to start execution.
Parameters:
  work - The unit of work to be done. Could be long or short-lived.
Parameters:
  timeout - a time duration (in milliseconds) within which theexecution of the Work instance must start. Otherwise, the Workinstance is rejected with a WorkRejectedException set to anappropriate error code (WorkRejectedException.TIMED_OUT).
Parameters:
  ectx - an object containing the execution context with which thesubmitted Work instance must be executed.
Parameters:
  listener - an object which would be notified when the various Workprocessing events (work accepted, work rejected, work started,work completed) occur.
throws:
  WorkRejectedException - a Work instance has been rejected fromfurther processing.
throws:
  WorkException -



scheduleWork
public void scheduleWork(Work work, long timeout, ExecutionContext ectx, WorkListener listener) throws WorkException(Code)
Accepts a Work instance for processing. This call does not block and returns immediately once a Work instance has been accepted for processing. There is no guarantee on when the submitted Work instance would start execution ie., there is no time constraint to start execution.
Parameters:
  work - The unit of work to be done. Could be long or short-lived.
Parameters:
  timeout - a time duration (in milliseconds) within which theexecution of the Work instance must start. Otherwise, the Workinstance is rejected with a WorkRejectedException set to anappropriate error code (WorkRejectedException.TIMED_OUT).
Parameters:
  ectx - an object containing the execution context with which thesubmitted Work instance must be executed.
Parameters:
  listener - an object which would be notified when the various Workprocessing events (work accepted, work rejected, work started,work completed) occur.
throws:
  WorkRejectedException - a Work instance has been rejected fromfurther processing.
throws:
  WorkException -



setMaxPoolSize
public void setMaxPoolSize(int maxsz)(Code)
Set the max pool size
Parameters:
  maxsz -



setMinPoolSize
public void setMinPoolSize(int minsz)(Code)
Set the min pool size
Parameters:
  minsz -



startWork
public long startWork(Work work) throws WorkException(Code)
Accepts a Work instance for processing. This call blocks until the Work instance starts execution but not until its completion. There is no guarantee on when the accepted Work instance would start execution ie., there is no time constraint to start execution.
Parameters:
  work - The unit of work to be done. Could be long or short-lived. the time elapsed (in milliseconds) from Work acceptance untilstart of execution. Note, this does not offer real-timeguarantees. It is valid to return -1, if the actual start delayduration is unknown.
throws:
  WorkRejectedException - a Work instance has been rejected fromfurther processing.
throws:
  WorkException -



startWork
public long startWork(Work work, long timeout, ExecutionContext ectx, WorkListener listener) throws WorkException(Code)
Accepts a Work instance for processing. This call blocks until the Work instance starts execution but not until its completion. There is no guarantee on when the accepted Work instance would start execution ie., there is no time constraint to start execution.
Parameters:
  work - The unit of work to be done. Could be long or short-lived.
Parameters:
  timeout - a time duration (in milliseconds) within which theexecution of the Work instance must start. Otherwise, the Workinstance is rejected with a WorkRejectedException set to anappropriate error code (WorkRejectedException.TIMED_OUT).
Parameters:
  ectx - an object containing the execution context with which thesubmitted Work instance must be executed.
Parameters:
  listener - an object which would be notified when the various Workprocessing events (work accepted, work rejected, work started,work completed) occur. the time elapsed (in milliseconds) from Work acceptance untilstart of execution. Note, this does not offer real-timeguarantees. It is valid to return -1, if the actual start delayduration is unknown.
throws:
  WorkRejectedException - a Work instance has been rejected fromfurther processing.
throws:
  WorkException -



stopThreads
public synchronized void stopThreads()(Code)
Remove this WorkManager : Stop all threads



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.