Java Doc for WorkManagerTaskExecutor.java in  » J2EE » spring-framework-2.5 » org » springframework » scheduling » commonj » 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 » spring framework 2.5 » org.springframework.scheduling.commonj 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.jndi.JndiLocatorSupport
   org.springframework.scheduling.commonj.WorkManagerTaskExecutor

WorkManagerTaskExecutor
public class WorkManagerTaskExecutor extends JndiLocatorSupport implements SchedulingTaskExecutor,WorkManager,InitializingBean(Code)
TaskExecutor implementation that delegates to a CommonJ WorkManager, implementing the commonj.work.WorkManager interface, which either needs to be specified as reference or through the JNDI name.

This is the central convenience class for setting up a CommonJ WorkManager in a Spring context.

Also implements the CommonJ WorkManager interface itself, delegating all calls to the target WorkManager. Hence, a caller can choose whether it wants to talk to this executor through the Spring TaskExecutor interface or the CommonJ WorkManager interface.

The CommonJ WorkManager will usually be retrieved from the application server's JNDI environment, as defined in the server's management console.

Note: At the time of this writing, the CommonJ WorkManager facility is only supported on IBM WebSphere 6.0+ and BEA WebLogic 9.0+, despite being such a crucial API for an application server. (There is a similar facility available on WebSphere 5.0 Enterprise, though, which we will discuss below.)

A similar facility is available on WebSphere 5.0/5.1, under the name "Asynch Beans". Its central interface is called WorkManager too and is also obtained from JNDI, just like a standard CommonJ WorkManager. However, this WorkManager variant is notably different: The central execution method is called "startWork" instead of "schedule", and takes a slightly different Work interface as parameter.

Support for this WebSphere 5 variant can be built with this class and its helper DelegatingWork as template: Call the WorkManager's startWork(Work) instead of schedule(Work) in the execute(Runnable) implementation. Furthermore, for simplicity's sake, drop the entire "Implementation of the CommonJ WorkManager interface" section (and the corresponding implements WorkManager clause at the class level). Of course, you also need to change all commonj.work imports in your WorkManagerTaskExecutor and DelegatingWork variants to the corresponding WebSphere API imports (com.ibm.websphere.asynchbeans.WorkManager and com.ibm.websphere.asynchbeans.Work, respectively). This should be sufficient to get a TaskExecutor adapter for WebSphere 5.
author:
   Juergen Hoeller
since:
   2.0





Method Summary
public  voidafterPropertiesSet()
    
public  voidexecute(Runnable task)
    
public  booleanprefersShortLivedTasks()
     This task executor prefers short-lived work units.
public  WorkItemschedule(Work work)
    
public  WorkItemschedule(Work work, WorkListener workListener)
    
public  voidsetWorkListener(WorkListener workListener)
     Specify a CommonJ WorkListener to apply, if any.
public  voidsetWorkManager(WorkManager workManager)
     Specify the CommonJ WorkManager to delegate to.
public  voidsetWorkManagerName(String workManagerName)
     Set the JNDI name of the CommonJ WorkManager.
public  booleanwaitForAll(Collection workItems, long timeout)
    
public  CollectionwaitForAny(Collection workItems, long timeout)
    



Method Detail
afterPropertiesSet
public void afterPropertiesSet() throws NamingException(Code)



execute
public void execute(Runnable task)(Code)



prefersShortLivedTasks
public boolean prefersShortLivedTasks()(Code)
This task executor prefers short-lived work units.



schedule
public WorkItem schedule(Work work) throws WorkException, IllegalArgumentException(Code)



schedule
public WorkItem schedule(Work work, WorkListener workListener) throws WorkException, IllegalArgumentException(Code)



setWorkListener
public void setWorkListener(WorkListener workListener)(Code)
Specify a CommonJ WorkListener to apply, if any.

This shared WorkListener instance will be passed on to the WorkManager by all WorkManagerTaskExecutor.execute calls on this TaskExecutor.




setWorkManager
public void setWorkManager(WorkManager workManager)(Code)
Specify the CommonJ WorkManager to delegate to.

Alternatively, you can also specify the JNDI name of the target WorkManager.
See Also:   WorkManagerTaskExecutor.setWorkManagerName




setWorkManagerName
public void setWorkManagerName(String workManagerName)(Code)
Set the JNDI name of the CommonJ WorkManager.

This can either be a fully qualified JNDI name, or the JNDI name relative to the current environment naming context if "resourceRef" is set to "true".
See Also:   WorkManagerTaskExecutor.setWorkManager
See Also:   WorkManagerTaskExecutor.setResourceRef




waitForAll
public boolean waitForAll(Collection workItems, long timeout) throws InterruptedException, IllegalArgumentException(Code)



waitForAny
public Collection waitForAny(Collection workItems, long timeout) throws InterruptedException, IllegalArgumentException(Code)



Fields inherited from org.springframework.jndi.JndiLocatorSupport
final public static String CONTAINER_PREFIX(Code)(Java Doc)

Methods inherited from org.springframework.jndi.JndiLocatorSupport
protected String convertJndiName(String jndiName)(Code)(Java Doc)
public boolean isResourceRef()(Code)(Java Doc)
protected Object lookup(String jndiName) throws NamingException(Code)(Java Doc)
protected Object lookup(String jndiName, Class requiredType) throws NamingException(Code)(Java Doc)
public void setResourceRef(boolean resourceRef)(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.