Java Doc for TileScheduler.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » media » jai » 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 » 6.0 JDK Modules » Java Advanced Imaging » javax.media.jai 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.media.jai.TileScheduler

TileScheduler
public interface TileScheduler (Code)
A class implementing a mechanism for scheduling tile calculation. In various implementations tile computation may make use of multithreading and multiple simultaneous network connections for improved performance.

If multithreading is used then the implementation of the interface must be thread-safe. In particular it must be possible to invoke any of the tile scheduling methods on the same image simultaneously from different threads and obtain the same results as if all invocations had been from the same thread.

Errors and exceptions which occur within the scheduler and which prevent tile computation will be thrown via the usual mechanism for all blocking methods, i.e., those which perform the computations while the invoking thread blocks. Failure conditions encountered in computations effected via non-blocking methods will be indicated by notifying any listeners. In neither case is it expected that the tiles will be re-scheduled for computation this instead being left to the application.





Method Summary
 voidcancelTiles(TileRequest request, Point[] tileIndices)
     Issues an advisory cancellation request to the TileScheduler stating that the indicated tiles of the specified request should not be processed.
 intgetParallelism()
     Returns the degree of parallelism of the scheduler.
 intgetPrefetchParallelism()
     Identical to getParallelism() but applies only to prefetchTiles().
 intgetPrefetchPriority()
     Identical to getPriority() but applies only to prefetchTiles().
 intgetPriority()
     Returns the priority of scheduleTiles() processing.
 voidprefetchTiles(PlanarImage target, Point[] tileIndices)
     Hints to the TileScheduler that the specified tiles from the given PlanarImage might be needed in the near future. Some TileScheduler implementations may spawn a low priority thread to compute the tiles while others may ignore the hint.
Parameters:
  target - The OpImage from which to prefetch tiles.
 RasterscheduleTile(OpImage target, int tileX, int tileY)
     Schedules a tile for computation.
 Raster[]scheduleTiles(OpImage target, Point tileIndices)
     Schedules a list of tiles for computation.
 TileRequestscheduleTiles(PlanarImage target, Point[] tileIndices, TileComputationListener[] tileListeners)
     Schedule a list of tiles for computation.
 voidsetParallelism(int parallelism)
     Suggests to the scheduler the degree of parallelism to use in processing invocations of scheduleTiles().
 voidsetPrefetchParallelism(int parallelism)
     Identical to setParallelism() but applies only to prefetchTiles().
 voidsetPrefetchPriority(int priority)
     Identical to setPriority() but applies only to prefetchTiles().

In the Sun Microsystems reference implementation of TileScheduler, this method sets the priority of any threads spawned to prefetch tiles.

 voidsetPriority(int priority)
     Suggests to the scheduler the priority to assign to processing effected by scheduleTiles().



Method Detail
cancelTiles
void cancelTiles(TileRequest request, Point[] tileIndices)(Code)
Issues an advisory cancellation request to the TileScheduler stating that the indicated tiles of the specified request should not be processed. The handling of cancellation is at the discretion of the scheduler which may cancel tile processing in progress and remove tiles from its internal queue, remove tiles from the queue but not terminate current processing, or simply do nothing.

In the Sun Microsystems reference implementation of TileScheduler the second tile cancellation option is implemented, i.e., tiles are removed from the internal queue but computation already in progress is not terminated. If there is at least one worker thread this method should be non-blocking. Any tiles allowed to complete computation subsequent to this call are complete and will be treated as if they had not been cancelled, e.g., with respect to caching, notification of registered listeners, etc. Furthermore, cancelling a tile request in no way invalidates the tile as a candidate for future recomputation.
Parameters:
  request - The request for which tiles are to be cancelled.
Parameters:
  tileIndices - The tiles to be cancelled; may be null.Any tiles not actually in the TileRequest will beignored.
throws:
  IllegalArgumentException - if request isnull.
since:
   JAI 1.1




getParallelism
int getParallelism()(Code)
Returns the degree of parallelism of the scheduler.
since:
   JAI 1.1



getPrefetchParallelism
int getPrefetchParallelism()(Code)
Identical to getParallelism() but applies only to prefetchTiles().
since:
   JAI 1.1



getPrefetchPriority
int getPrefetchPriority()(Code)
Identical to getPriority() but applies only to prefetchTiles().
since:
   JAI 1.1



getPriority
int getPriority()(Code)
Returns the priority of scheduleTiles() processing.
since:
   JAI 1.1



prefetchTiles
void prefetchTiles(PlanarImage target, Point[] tileIndices)(Code)
Hints to the TileScheduler that the specified tiles from the given PlanarImage might be needed in the near future. Some TileScheduler implementations may spawn a low priority thread to compute the tiles while others may ignore the hint.
Parameters:
  target - The OpImage from which to prefetch tiles.
Parameters:
  tileIndices - A list of tile indices indicating which tilesto prefetch.
throws:
  IllegalArgumentException - if target ortileIndices is null.



scheduleTile
Raster scheduleTile(OpImage target, int tileX, int tileY)(Code)
Schedules a tile for computation. Called by OpImage.getTile(), this method makes OpImage.computeTile() calls to calculate the destination tile. This will provoke the computation of any required source tiles as well.
Parameters:
  target - An OpImage whose tile is to be computed.
Parameters:
  tileX - The X index of the tile to be computed.
Parameters:
  tileY - The Y index of the tile to be computed. A Raster containing the contents of the tile.
throws:
  IllegalArgumentException - if target isnull.



scheduleTiles
Raster[] scheduleTiles(OpImage target, Point tileIndices)(Code)
Schedules a list of tiles for computation. Called by OpImage.getTiles, this method makes OpImage.computeTile() calls to calculate the destination tiles. This will provoke the computation of any required source tiles as well.
Parameters:
  target - An OpImage whose tiles are to be computed.
Parameters:
  tileIndices - A list of tile indices indicating which tilesto schedule for computation. An array of Rasters containing a computedraster for every tile index passed in.
throws:
  IllegalArgumentException - if target ortileIndices is null.



scheduleTiles
TileRequest scheduleTiles(PlanarImage target, Point[] tileIndices, TileComputationListener[] tileListeners)(Code)
Schedule a list of tiles for computation. The supplied listeners will be notified of the status of each tile, i.e., when each tile is computed, cancelled, or encounters an error. This method ideally should be non-blocking. If the TileScheduler implementation uses multithreading, it is at the discretion of the implementation which thread invokes the TileComputationListener methods. The event source parameter passed to each listener will be the TileScheduler itself and the image parameter will be the specified target image.

In the Sun Microsystems reference implementation of TileScheduler the TileComputationListener methods are invoked by the thread which performs the actual tile computation. This will be the primary thread if the parallelism is zero, or a worker thread if it is positive.
Parameters:
  target - A PlanarImage whose tiles are to be computed.
Parameters:
  tileIndices - A list of tile indices indicating which tilesto schedule for computation.
Parameters:
  tileListeners - TileComputationListeners to beinformed of tile computation status; may be null. The TileRequest for this set of tiles.
throws:
  IllegalArgumentException - if target ortileIndices is null.
since:
   JAI 1.1




setParallelism
void setParallelism(int parallelism)(Code)
Suggests to the scheduler the degree of parallelism to use in processing invocations of scheduleTiles(). For example, this might set the number of threads to spawn. It is legal to implement this method as a no-op.

In the Sun Microsystems reference implementation of TileScheduler this method sets the number of worker threads actually used for tile computation. Ideally this number should equal the number of processors actually available on the system. It is the responsibility of the application to set this value as the number of processors is not available via the virtual machine. A parallelism value of zero indicates that all tile computation will be effected in the primary thread. A parallelism value of N indicates that there will be N worker threads in addition to the primary scheduler thread. In JAI the parallelism defaults to a value of 2 unless explicity set by the application.
Parameters:
  parallelism - The suggested degree of parallelism.
throws:
  IllegalArgumentException - if parallelismis negative.
since:
   JAI 1.1




setPrefetchParallelism
void setPrefetchParallelism(int parallelism)(Code)
Identical to setParallelism() but applies only to prefetchTiles().
since:
   JAI 1.1



setPrefetchPriority
void setPrefetchPriority(int priority)(Code)
Identical to setPriority() but applies only to prefetchTiles().

In the Sun Microsystems reference implementation of TileScheduler, this method sets the priority of any threads spawned to prefetch tiles. Its initial value is Thread.MIN_PRIORITY.
since:
   JAI 1.1




setPriority
void setPriority(int priority)(Code)
Suggests to the scheduler the priority to assign to processing effected by scheduleTiles(). For example, this might set thread priority. Values outside of the accepted priority range will be clamped to the nearest extremum. An implementation may clamp the prefetch priority to less than the scheduling priority. It is legal to implement this method as a no-op.

In the Sun Microsystems reference implementation of TileScheduler this method sets the priority of the worker threads used for tile computation. Its initial value is Thread.NORM_PRIORITY.
Parameters:
  priority - The suggested priority.
since:
   JAI 1.1




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