Agreed, proposal is a tool for discussion and resolution.

Java7FileWatcher - yeah we upgraded to Java 7 right as the ResourceStore
API was being written so I made the internal FileWatcher class compatible -
so if it listens to things a directory at a time that is probably what I
did as well:

Resource.addListener( listener )
<https://github.com/geoserver/geoserver/blob/master/src/platform/src/main/java/org/geoserver/platform/resource/Resource.java#L96>
 has:

     Listeners can be configured to check for changes to individual files
> or directory contents.

     * styles: listener receives events for any change to the contents of
> the styles directory
>      * user_projections/epsg.properties: listener notified for any change
> to the epsg.properties resource

     Notification is course grained, often just based on change of last
> modified time stamp, as such they are issued after the change has
> been performed.


I also like your suggestion for a get/set ResourceNotificationDispatcher
which better communicates intent.

--
Jody Garnett

On 17 January 2016 at 13:54, Andrea Aime <andrea.a...@geo-solutions.it>
wrote:

> Hi Jody,
> I've just had a quick conversation with you about the proposal and we
> discussed it,
> now I'm sharing my feedback with the rest of the community.
>
> Personally, I find it redundant that there is and add/remove listener
> method in both
> the resource and the store, given that the Resource can be created out of
> a non
> yet existing file/directory, I would be happy about just having the
> methods in the resource
> itself, maybe with some javadoc explaining that it's ok to to listen to a
> non yet existing
> resource yet (one will get events if the resource pop up in existence).
>
> I'm also looking at the API and wondering where's the recursive behavior.
> You told
> me it's part of the pre-existing behavior, and I've checked
>  ResourceListener/ResourceNotification,
> but the best I could find is in ResourceNotification stating:
>
> "Listeners on a directory will be notified on any resource change in the
> directory. The delta will include any modified directories"
>
> Still does not tell me if the notification is about directly children of
> the directory, or if includes
> also all sub-directories at all levels. I was looking at Java 7 file
> watching API and the tutorial states that
> if you want to watch and entire file tree, you have to register a watcher
> for each and every directory in
> it.
> I was actually looking at how FileSystemWatcher is implemented, I'm not
> seeing any recursive
> behavior (and it's not using java 7 file watching api either, it's
> polling), so I mean, not sure
> this is actually going to work correctly in recursive mode... if anything,
> it seems to be working
> at single level... which would mean there is no way to "watch everything".
> Fair enough,
> but then the API should be clear and the proposal too about it :-)
>
> Final feedback, if you want to be up front that there is a central
> notification hub,
> imho, better to remove the add/remove listener methods from the store, and
> add a getResourceNotificationDispatcher/setResourceNotificationDispatcher
> at the ResourceStore level instead: this would make it evident that there
> is a centralized
> one, and offer an opportunity to programmatically plug in a custom one
> (for clusters).
> Though... hum... thinking out loud, for standard vs non standard
> implementations
> of a interface, we normally go for a "lookup in spring, if none is found,
> instantiate a
> default one programmatically approach". Which would be fine for this case
> too, just
> document it (and describe it in the proposal)
>
> Sorry it's not a +1 yet, at the moment the proposal is leaving me with
> questions :-)
>
> Cheers
> Andrea
>
>
> On Wed, Jan 6, 2016 at 6:46 PM, Jody Garnett <jody.garn...@gmail.com>
> wrote:
>
>> This is a follow up to pull request #1361
>> <https://github.com/geoserver/geoserver/pull/1361> introducing some new
>> public API:
>>
>> https://github.com/geoserver/geoserver/wiki/GSIP-136
>>
>> Niels I have changed your proposed interface a bit, to use paths rather
>> than a resource when adding/removing listeners.
>> --
>> Jody Garnett
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> Geoserver-devel mailing list
>> Geoserver-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>
>>
>
>
> --
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39  339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> *AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
>
> Le informazioni contenute in questo messaggio di posta elettronica e/o
> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
> darcene notizia via e-mail e di procedere alla distruzione del messaggio
> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
> principi dettati dal D.Lgs. 196/2003.
>
>
>
> The information in this message and/or attachments, is intended solely for
> the attention and use of the named addressee(s) and may be confidential or
> proprietary in nature or covered by the provisions of privacy act
> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
> Code).Any use not in accord with its purpose, any disclosure, reproduction,
> copying, distribution, or either dissemination, either whole or partial, is
> strictly forbidden except previous formal approval of the named
> addressee(s). If you are not the intended recipient, please contact
> immediately the sender by telephone, fax or e-mail and delete the
> information in this message that has been received in error. The sender
> does not give any warranty or accept liability as the content, accuracy or
> completeness of sent messages and accepts no responsibility  for changes
> made after they were sent or for other risks which arise as a result of
> e-mail transmission, viruses, etc.
>
> -------------------------------------------------------
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to