svn commit: r591087 - /jakarta/jcs/trunk/xdocs/ElementEventHandling.xml

[email protected]
Newsgroups gmane.comp.jakarta.turbine.jcs.devel
Message-ID <[email protected]>
Author: tv
Date: Thu Nov  1 10:10:02 2007
New Revision: 591087

URL: http://svn.apache.org/viewvc?rev=591087&view=rev
Log:
Document element extraction from event.

Modified:
    jakarta/jcs/trunk/xdocs/ElementEventHandling.xml

Modified: jakarta/jcs/trunk/xdocs/ElementEventHandling.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/ElementEventHandling.xml?rev=591087&r1=591086&r2=591087&view=diff
==============================================================================
--- jakarta/jcs/trunk/xdocs/ElementEventHandling.xml (original)
+++ jakarta/jcs/trunk/xdocs/ElementEventHandling.xml Thu Nov  1 10:10:02 2007
@@ -132,6 +132,20 @@
 				is done asynchronously. Events are added to an event
 				queue and processed by background threads.
 			</p>
+            <p>
+                Here is how to extract the event and source from the 
+                IElementEvent:
+            </p>
+            <source>
+                <![CDATA[
+    public void handleElementEvent( IElementEvent event )
+    {
+        int eventType = event.getElementEvent();
+        CacheElement element = (CacheElement)((EventObject)event).getSource();
+        . . .
+    }
+                ]]>
+            </source>
 			<p>
 				Once you have an IElementEventHandler implementation,
 				you can attach it to an element via the Element
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.