Hi there,
yes, there is. All you need is to implement an EventInspector interface, make it as Plexus component (same role), and you can catch and do whatever you want with the event. All Plexus components with this role will be discovered and will start receiving _all_ system events (like the RepositoryItemEvent, the superclass of all "access" events).
One thing to watch: make processing of the event _fast_, since by doing some long work in the inspect() method will cause a general "slowdown" on Nexus level (serving artifacts). If you want to do some special stuff (ie. insert into RDBMS or such), or other time-intensive work, implement a Queue (inspect() should be producer) and decouple the actual processing (consumer) to keep Nexus Core away from blocking. You would do that in separate thread.
~t~
On Wed, Apr 1, 2009 at 2:10 AM, K H
<kehsiao@...> wrote:
Hi,
I want to write a Nexus plugin which forwards access events into my own
proprietary log system.
In particular I want to log every access of an artifact (similar to an
Apache access.log).
Is there API in Nexus which allows to register a listener for these events?
Thanks,
Kelly
--
View this message in context: http://www.nabble.com/API-for-access-log-events-tp22817418p22817418.html
Sent from the Nexus Maven Repository Manager Dev List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: nexus-dev-unsubscribe@...
For additional commands, e-mail: nexus-dev-help@...