Java Doc for RunnableQueue.java in  » Graphic-Library » batik » org » apache » batik » util » 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 » Graphic Library » batik » org.apache.batik.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.batik.util.RunnableQueue

RunnableQueue
public class RunnableQueue implements Runnable(Code)
This class represents an object which queues Runnable objects for invocation in a single thread.
author:
   Stephane Hillion
version:
   $Id: RunnableQueue.java 501495 2007-01-30 18:00:36Z dvholten $

Inner Class :final public static class RunnableQueueState
Inner Class :public interface IdleRunnable extends Runnable
Inner Class :public interface RunHandler
Inner Class :public static class RunHandlerAdapter implements RunHandler
Inner Class :protected static class Link extends DoublyLinkedList.Node
Inner Class :protected static class LockableLink extends Link

Field Summary
final public static  RunnableQueueStateRUNNING
     The queue is in the process of running tasks.
final public static  RunnableQueueStateSUSPENDED
     The queue is no longer running any tasks and will not run any tasks until resumeExecution is called.
final public static  RunnableQueueStateSUSPENDING
     The queue may still be running tasks but as soon as possible will go to SUSPENDED state.
protected  intpreemptCount
     Count of preempt entries in queue, so preempt entries can be kept properly ordered.
protected  RunHandlerrunHandler
     The object which handle run events.
protected volatile  HaltingThreadrunnableQueueThread
     The current thread.
protected volatile  RunnableQueueStatestate
     The Suspension state of this thread.
final protected  ObjectstateLock
     Object to synchronize/wait/notify for suspension issues.
protected  booleanwasResumed
     Used to indicate if the queue was resumed while still running, so a 'resumed' event can be sent.


Method Summary
public static  RunnableQueuecreateRunnableQueue()
     Creates a new RunnableQueue started in a new thread.
protected synchronized  voidexecutionResumed()
     Called when execution is being resumed.
protected synchronized  voidexecutionSuspended()
     Called when execution is being suspended.
public  ObjectgetIteratorLock()
     Returns iterator lock to use to work with the iterator returned by iterator().
public  RunnableQueueStategetQueueState()
    
public synchronized  RunHandlergetRunHandler()
     Returns the RunHandler or null.
public  HaltingThreadgetThread()
     Returns the thread in which the RunnableQueue is currently running.
public  voidinvokeAndWait(Runnable r)
     Waits until the given Runnable's run() has returned.
public  voidinvokeLater(Runnable r)
     Schedules the given Runnable object for a later invocation, and returns.
public  Iteratoriterator()
     Returns an iterator over the runnables.
public  voidpreemptAndWait(Runnable r)
     Waits until the given Runnable's run() has returned.
public  voidpreemptLater(Runnable r)
     Schedules the given Runnable object for a later invocation, and returns.
public  voidresumeExecution()
     Resumes the execution of this queue.
public  voidrun()
     Runs this queue.
protected synchronized  voidrunnableInvoked(Runnable rable)
     Called when a Runnable completes.
protected synchronized  voidrunnableStart(Runnable rable)
     Called just prior to executing a Runnable.
public  voidsetIdleRunnable(IdleRunnable r)
     Sets a Runnable to be run whenever the queue is empty.
public synchronized  voidsetRunHandler(RunHandler rh)
     Sets the RunHandler for this queue.
public  voidsuspendExecution(boolean waitTillSuspended)
     Suspends the execution of this queue after the current runnable completes.
Parameters:
  waitTillSuspended - if true this method will not returnuntil the queue has suspended (no runnable in progressor about to be in progress).

Field Detail
RUNNING
final public static RunnableQueueState RUNNING(Code)
The queue is in the process of running tasks.



SUSPENDED
final public static RunnableQueueState SUSPENDED(Code)
The queue is no longer running any tasks and will not run any tasks until resumeExecution is called.



SUSPENDING
final public static RunnableQueueState SUSPENDING(Code)
The queue may still be running tasks but as soon as possible will go to SUSPENDED state.



preemptCount
protected int preemptCount(Code)
Count of preempt entries in queue, so preempt entries can be kept properly ordered.



runHandler
protected RunHandler runHandler(Code)
The object which handle run events.



runnableQueueThread
protected volatile HaltingThread runnableQueueThread(Code)
The current thread.



state
protected volatile RunnableQueueState state(Code)
The Suspension state of this thread.



stateLock
final protected Object stateLock(Code)
Object to synchronize/wait/notify for suspension issues.



wasResumed
protected boolean wasResumed(Code)
Used to indicate if the queue was resumed while still running, so a 'resumed' event can be sent.





Method Detail
createRunnableQueue
public static RunnableQueue createRunnableQueue()(Code)
Creates a new RunnableQueue started in a new thread. a RunnableQueue which is guaranteed to have entered itsrun() method.



executionResumed
protected synchronized void executionResumed()(Code)
Called when execution is being resumed. Currently just notifies runHandler



executionSuspended
protected synchronized void executionSuspended()(Code)
Called when execution is being suspended. Currently just notifies runHandler



getIteratorLock
public Object getIteratorLock()(Code)
Returns iterator lock to use to work with the iterator returned by iterator().



getQueueState
public RunnableQueueState getQueueState()(Code)



getRunHandler
public synchronized RunHandler getRunHandler()(Code)
Returns the RunHandler or null.



getThread
public HaltingThread getThread()(Code)
Returns the thread in which the RunnableQueue is currently running. null if the RunnableQueue has not entered hisrun() method.



invokeAndWait
public void invokeAndWait(Runnable r) throws InterruptedException(Code)
Waits until the given Runnable's run() has returned. Note: invokeAndWait() must not be called from the current thread (for example from the run() method of the argument).
throws:
  IllegalStateException - if getThread() is null or if thethread returned by getThread() is the current one.



invokeLater
public void invokeLater(Runnable r)(Code)
Schedules the given Runnable object for a later invocation, and returns. An exception is thrown if the RunnableQueue was not started.
throws:
  IllegalStateException - if getThread() is null.



iterator
public Iterator iterator()(Code)
Returns an iterator over the runnables.



preemptAndWait
public void preemptAndWait(Runnable r) throws InterruptedException(Code)
Waits until the given Runnable's run() has returned. The given runnable preempts any runnable that is not currently executing (ie the next runnable started will be the one given). Note: preemptAndWait() must not be called from the current thread (for example from the run() method of the argument).
throws:
  IllegalStateException - if getThread() is null or if thethread returned by getThread() is the current one.



preemptLater
public void preemptLater(Runnable r)(Code)
Schedules the given Runnable object for a later invocation, and returns. The given runnable preempts any runnable that is not currently executing (ie the next runnable started will be the one given). An exception is thrown if the RunnableQueue was not started.
throws:
  IllegalStateException - if getThread() is null.



resumeExecution
public void resumeExecution()(Code)
Resumes the execution of this queue.
throws:
  IllegalStateException - if getThread() is null.



run
public void run()(Code)
Runs this queue.



runnableInvoked
protected synchronized void runnableInvoked(Runnable rable)(Code)
Called when a Runnable completes. Currently just notifies runHandler
Parameters:
  rable - The runnable that just completed.



runnableStart
protected synchronized void runnableStart(Runnable rable)(Code)
Called just prior to executing a Runnable. Currently just notifies runHandler
Parameters:
  rable - The runnable that is about to start



setIdleRunnable
public void setIdleRunnable(IdleRunnable r)(Code)
Sets a Runnable to be run whenever the queue is empty.



setRunHandler
public synchronized void setRunHandler(RunHandler rh)(Code)
Sets the RunHandler for this queue.



suspendExecution
public void suspendExecution(boolean waitTillSuspended)(Code)
Suspends the execution of this queue after the current runnable completes.
Parameters:
  waitTillSuspended - if true this method will not returnuntil the queue has suspended (no runnable in progressor about to be in progress). If resumeExecution iscalled while waiting will simply return (this reallyindicates a race condition in your code). This mayreturn before an associated RunHandler is notified.
throws:
  IllegalStateException - if getThread() is null.



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.