Java Doc for DaemonService.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » services » daemon » 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 » Database DBMS » db derby 10.2 » org.apache.derby.iapi.services.daemon 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.derby.iapi.services.daemon.DaemonService

All known Subclasses:   org.apache.derby.impl.services.daemon.BasicDaemon,
DaemonService
public interface DaemonService (Code)
A DaemonService provides a background service which is suitable for asynchronous I/O and general clean up. It should not be used as a general worker thread for parallel execution. A DaemonService can be subscribe to by many Serviceable objects and a DaemonService will call that object's performWork from time to time. The performWork method is defined by the client object and should be well behaved - in other words, it should not take too long or hog too many resources or deadlock with anyone else. And it cannot (should not) error out.

It is up to each DaemonService implementation to define its level of service, including

  • how quickly and how often the clients should expect to be be serviced
  • how the clients are prioritized
  • whether the clients need to tolerate spurious services

MT - all routines on the interface must be MT-safe.
See Also:   Serviceable



Field Summary
final public static  StringDaemonOff
     Trace flag that can be used to turn off background daemons If DaemonOff is set, background Daemon will not attempt to do anything.
final public static  StringDaemonTrace
    
public static  intTIMER_DELAY
    


Method Summary
public  voidclear()
     Clear all the queued up work from this daemon.
public  booleanenqueue(Serviceable newClient, boolean serviceNow)
     Request a one time service from the Daemon.
public  voidpause()
     Pause.
public  voidresume()
    
public  voidserviceNow(int clientNumber)
     Service this subscription ASAP.
public  voidstop()
    
public  intsubscribe(Serviceable newClient, boolean onDemandOnly)
    
public  voidunsubscribe(int clientNumber)
     Get rid of a client from the daemon.
public  voidwaitUntilQueueIsEmpty()
    

Field Detail
DaemonOff
final public static String DaemonOff(Code)
Trace flag that can be used to turn off background daemons If DaemonOff is set, background Daemon will not attempt to do anything.



DaemonTrace
final public static String DaemonTrace(Code)
Trace flag that can be used by Daemons to print stuff out



TIMER_DELAY
public static int TIMER_DELAY(Code)





Method Detail
clear
public void clear()(Code)
Clear all the queued up work from this daemon. Subscriptions are not affected.



enqueue
public boolean enqueue(Serviceable newClient, boolean serviceNow)(Code)
Request a one time service from the Daemon. Unless performWork returns REQUEUE (see Serviceable), the daemon will service this client once and then it will get rid of this client. Since no client number is associated with this client, it cannot request to be serviced or be unsubscribed. The work is always added to the deamon, regardless of the state it returns.
Parameters:
  newClient - the object that needs a one time service
Parameters:
  serviceNow - if true, this client should be serviced ASAP, as if aserviceNow has been issued. If false, then this client will beserviced with the normal scheduled. true if the daemon indicates it is being overloaded,false it's happy.



pause
public void pause()(Code)
Pause. No new service is performed until a resume is issued.



resume
public void resume()(Code)
Resume service after a pause



serviceNow
public void serviceNow(int clientNumber)(Code)
Service this subscription ASAP. Does not guarantee that the daemon will actually do anything about it.
Parameters:
  clientNumber - the number that uniquely identify the client



stop
public void stop()(Code)
End this daemon service



subscribe
public int subscribe(Serviceable newClient, boolean onDemandOnly)(Code)
Add a new client that this daemon needs to service
Parameters:
  newClient - a Serviceable object this daemon will service from time to time
Parameters:
  onDemandOnly - only service this client when it ask for service with a serviceNow request a client number that uniquely identifies this client (this subscription)



unsubscribe
public void unsubscribe(int clientNumber)(Code)
Get rid of a client from the daemon. If a client is being serviced when the call is made, the implementation may choose whether or not the call should block until the client has completed its work. If the call does not block, the client must be prepared to handle calls to its performWork() method even after unsubscribe() has returned.
Parameters:
  clientNumber - the number that uniquely identify the client



waitUntilQueueIsEmpty
public void waitUntilQueueIsEmpty()(Code)



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