Bug 180523 - addRecursiveListener call may take some time - make it interruptible
addRecursiveListener call may take some time - make it interruptible
Product: platform
Classification: Unclassified
Component: Filesystems
Other Linux
: P1 (vote)
: 6.x
Assigned To: Jaroslav Tulach
Depends on:
  Show dependency treegraph
Reported: 2010-02-10 00:55 UTC by Jaroslav Tulach
Modified: 2010-03-18 10:08 UTC (History)
2 users (show)

See Also:

FileUtil.addRecursiveListener(..., Callable<Boolean>) (10.70 KB, patch)
2010-03-10 00:51 UTC, Jaroslav Tulach
Details | Diff
Test for the new behavior (5.05 KB, text/x-java)
2010-03-10 02:40 UTC, Jaroslav Tulach

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2010-02-10 00:55:26 UTC
On large trees of directories the call to FileObject.addRecursiveListener can be quite expensive. See bug 178999 for an example. Although the problem can be workarounded by rescheduling to the call to addRL to some background thread, it may need nicer API. One option is

public boolean addRecusiveListener(FCL, Callable<Boolean> callback);

which will allow the client to provide a callback and return false from it, to immediately stop further execution, effectively removing the listener.
Comment 1 Jaroslav Tulach 2010-03-10 00:51:17 UTC
Created attachment 94953 [details]
FileUtil.addRecursiveListener(..., Callable<Boolean>)
Comment 2 Jaroslav Tulach 2010-03-10 02:40:26 UTC
Created attachment 94959 [details]
Test for the new behavior
Comment 3 Jaroslav Tulach 2010-03-17 17:22:46 UTC
Let's integrate tomorrow.
Comment 4 Jesse Glick 2010-03-17 17:42:59 UTC
[JG01] Do not copy every detail of Javadoc; we cannot maintain duplicated specs. Refer to the simple overload for details, and only document the stop param.
Comment 5 Jaroslav Tulach 2010-03-18 10:08:56 UTC

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo