db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r420465 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/services/daemon/DaemonService.java impl/services/daemon/BasicDaemon.java
Date Mon, 10 Jul 2006 09:05:00 GMT
Author: kahatlen
Date: Mon Jul 10 02:04:57 2006
New Revision: 420465

URL: http://svn.apache.org/viewvc?rev=420465&view=rev
Log:
DERBY-989: unit/daemonService.unit fails intermittently: 'ran out of time'

Updated the javadoc for DaemonService and BasicDaemon with information about
the case where unsubscribe() is called when the client is being serviced.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/daemon/DaemonService.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/daemon/DaemonService.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/daemon/DaemonService.java?rev=420465&r1=420464&r2=420465&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/daemon/DaemonService.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/daemon/DaemonService.java
Mon Jul 10 02:04:57 2006
@@ -28,10 +28,18 @@
   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.  These performWork method is defined by the
+  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.
+
+  <P>It is up to each <code>DaemonService</code> implementation to define
its
+  level of service, including
+  <UL>
+  <LI>how quickly and how often the clients should expect to be be serviced
+  <LI>how the clients are prioritized
+  <LI>whether the clients need to tolerate spurious services
+  </UL>
  
   <P>MT - all routines on the interface must be MT-safe.
 
@@ -66,7 +74,12 @@
 
 
 	/**
-		Get rid of a client from the daemon.
+		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
+		<code>performWork()</code> method even after <code>unsubscribe()</code>
+		has returned.
 
 		@param clientNumber the number that uniquely identify the client
 	*/

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java?rev=420465&r1=420464&r2=420465&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java
Mon Jul 10 02:04:57 2006
@@ -43,7 +43,7 @@
 	recoverable, they are all lost when the system crashes or is shutdown.
 	System shutdown, even orderly ones, do not wait for daemons to finish its
 	work or empty its queue.  Furthermore, any Serviceable subscriptions,
-	including onDemandOnly, must tolerate spurrious services.  The BasicDaemon
+	including onDemandOnly, must tolerate spurious services.  The BasicDaemon
 	will setup a context manager with no context on it.  The Serviceable
 	object's performWork must provide useful context on the context manager to
 	do its work.  The BasicDaemon will wrap performWork call with try / catch
@@ -161,6 +161,15 @@
 		return clientNumber;
 	}
 
+	/**
+	 * Removes a client from the list of subscribed clients. The call does not
+	 * wait for the daemon to finish the work it is currently performing.
+	 * Therefore, the client must tolerate that its <code>performWork()</code>
+	 * method could be invoked even after the call to
+	 * <code>unsubscribe()</code> has returned (but not more than once).
+	 *
+	 * @param clientNumber client identifier
+	 */
 	public void unsubscribe(int clientNumber)
 	{
 		if (clientNumber < 0 || clientNumber > subscription.size())



Mime
View raw message