On 23 January 2015 at 14:17, Kevin Smith <[email protected]> wrote:

> On 23 January 2015 at 13:30, Jody Garnett <[email protected]> wrote:
>
>>
>> As for FileSystemWatcher, the javadoc says:
>>>>
>>>> " * This implementation currently polls the file system and should be
>>>> updated with Java 7 WatchService when available. The internal design is
>>>> similar
>>>>  * to WatchService, WatchKey and WatchEvent in order to facilitate this
>>>> transition."
>>>>
>>>> We are on Java 7 now so... time to upgrade?
>>>>
>>>
>>> Yes, I looked at that, unfortunately it needs to be shut down as well.
>>> You have to call the close method on the WatchService when done with it or
>>> risk having it leave threads lying around as well. I'm also not sure enough
>>> of the details of WatchService particularly how it's tied to a specific
>>> "FileSystem" which may complicate implementing FileSystemWatcher in terms
>>> of it.
>>>
>>
>> Implementing using an internal FileSystemWatcher should be pretty
>> straightforward since I *did* match the design. I got the impression the
>> JVM would hook into operating system file change notification (or take care
>> of polling like we do with a thread pool).
>> --
>> Jody
>>
>
> The WatchService is created from a specific FileSystem object where
> FileSystemWatcher has no concept of specific file systems.  It looks like
> maybe a "File System" in Java is a context for file paths (in which case
> it's doing pretty much the same thing ResourceStore API does) rather than a
> specific OS level file system.  The Java documentation just uses the term
> without defining it though.  I'm a little worried that the dependence on
> file systems means the whole thing will break when traversing a mount point
> or a symlink to another mounted filesystem.
>
>
I talked to Jody and it looks like this isn't an issue.

The remaining issue is how to best go about shutting things down safely.
Maybe use a "Disposer" object, DisposableBean objects can be registered
with it and when the context shuts down it destroys them all.  Anything
that needs to arrange to have something it created cleaned up can then grab
the Disposer from GeoServerExtensions (still not ideal but it's been used
this way plenty of times before)


-- 

Kevin Smith

Software Engineer | Boundless <http://boundlessgeo.com/>

[email protected]

+1-778-785-7459

@boundlessgeo <http://twitter.com/boundlessgeo/>


<http://twitter.com/boundlessgeo/>

[image: http://boundlessgeo.com/]
<http://boundlessgeo.com/>
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to