From jbosscache-commits at lists.jboss.org Tue Jun 3 06:48:45 2008 Content-Type: multipart/mixed; boundary="===============2912231597282064303==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r5936 - core/trunk/src/main/docbook/userguide/en/modules. Date: Tue, 03 Jun 2008 06:48:45 -0400 Message-ID: --===============2912231597282064303== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: manik.surtani(a)jboss.com Date: 2008-06-03 06:48:44 -0400 (Tue, 03 Jun 2008) New Revision: 5936 Modified: core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml Log: Updated docs on cache listeners Modified: core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml 2008-06-= 03 10:37:56 UTC (rev 5935) +++ core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml 2008-06-= 03 10:48:44 UTC (rev 5936) @@ -388,23 +388,31 @@ =
- Adding a CacheListener + Adding a Cache Listener - registering for cache events - The - @org.jboss.cache.notifications.annotation.CacheListener<= /literal> - annotation is a convenient - mechanism for receiving notifications from a cache about events t= hat happen in the cache. Classes annotated - with + JBoss Cache provides a convenient mechanism for registering notif= ications on cache events. + + + + Similar methods exist for removing or querying registered listene= rs. See the javadocs on the + Cache + interface for more details. + + + Basically any public class can be used as a listener, provided it= is annotated with the @CacheListener - need to be public classes. In addition, the class needs to have o= ne or + annotation. In addition, the class needs to have one or more methods annotated with one of the method-level annotations (= in the org.jboss.cache.notifications.annotation package). Methods annotated as such need to be public, have a voi= d return type, and accept a single parameter of type org.jboss.cache.notifications.event.Event - or one of it's subtypes. + or one of its subtypes. = @@ -412,7 +420,7 @@ @CacheStarted - methods annotated such receive a notification when the= cache is started. Methods need to accept a parameter type which i= s assignable from - org.jboss.cache.notifications.event.CacheStarte= dEvent + CacheStartedEvent . @@ -422,7 +430,7 @@ @CacheStopped - methods annotated such receive a notification when the= cache is stopped. Methods need to accept a parameter type which i= s assignable from - org.jboss.cache.notifications.event.CacheStoppe= dEvent + CacheStoppedEvent . @@ -432,7 +440,7 @@ @NodeCreated - methods annotated such receive a notification when a n= ode is created. Methods need to accept a parameter type which i= s assignable from - org.jboss.cache.notifications.event.NodeCreated= Event + NodeCreatedEvent . @@ -442,7 +450,7 @@ @NodeRemoved - methods annotated such receive a notification when a n= ode is removed. Methods need to accept a parameter type which i= s assignable from - org.jboss.cache.notifications.event.NodeRemoved= Event + NodeRemovedEvent . @@ -452,7 +460,7 @@ @NodeModified - methods annotated such receive a notification when a n= ode is modified. Methods need to accept a parameter type which = is assignable from - org.jboss.cache.notifications.event.NodeModifie= dEvent + NodeModifiedEvent . @@ -462,7 +470,7 @@ @NodeMoved - methods annotated such receive a notification when a n= ode is moved. Methods need to accept a parameter type which is = assignable from - org.jboss.cache.notifications.event.NodeMovedEv= ent + NodeMovedEvent . @@ -472,7 +480,7 @@ @NodeVisited - methods annotated such receive a notification when a n= ode is started. Methods need to accept a parameter type which i= s assignable from - org.jboss.cache.notifications.event.NodeVisited= Event + NodeVisitedEvent . @@ -484,7 +492,7 @@ loaded from a CacheLoader . Methods need to accept a parameter type which is assig= nable from - org.jboss.cache.notifications.event.NodeLoadedE= vent + NodeLoadedEvent . @@ -494,7 +502,7 @@ @NodeEvicted - methods annotated such receive a notification when a n= ode is evicted from memory. Methods need to accept a parameter = type which is assignable from - org.jboss.cache.notifications.event.NodeEvicted= Event + NodeEvictedEvent . @@ -504,7 +512,7 @@ @NodeActivated - methods annotated such receive a notification when a n= ode is activated. Methods need to accept a parameter type which= is assignable from - org.jboss.cache.notifications.event.NodeActivat= edEvent + NodeActivatedEvent . @@ -514,7 +522,7 @@ @NodePassivated - methods annotated such receive a notification when a n= ode is passivated. Methods need to accept a parameter type whic= h is assignable from - org.jboss.cache.notifications.event.NodePassiva= tedEvent + NodePassivatedEvent . @@ -527,7 +535,7 @@ javax.transaction.Synchronization with a registered transaction manager. Methods need to accept a parameter type which is assigna= ble from - org.jboss.cache.notifications.event.Transaction= RegisteredEvent + TransactionRegisteredEvent . @@ -538,7 +546,7 @@ - methods annotated such receive a notification when the= cache receives a commit or rollback call from a registered tra= nsaction manager. Methods need to accept a parameter type which is assigna= ble from - org.jboss.cache.notifications.event.Transaction= CompletedEvent + TransactionCompletedEvent . @@ -548,7 +556,7 @@ @ViewChanged - methods annotated such receive a notification when the= group structure of the cluster changes. Methods need to accept a paramet= er type which is assignable from - org.jboss.cache.notifications.event.ViewChanged= Event + ViewChangedEvent . @@ -559,7 +567,7 @@ - methods annotated such receive a notification when the= cluster requests that cache operations are blocked for a state t= ransfer event. Methods need to accept a parameter type which is assignable from - org.jboss.cache.notifications.event.CacheBlocke= dEvent + CacheBlockedEvent . @@ -570,7 +578,7 @@ - methods annotated such receive a notification when the= cluster requests that cache operations are unblocked after a sta= te transfer event. Methods need to accept a parameter type which is assignable from - org.jboss.cache.notifications.event.CacheUnbloc= kedEvent + CacheUnblockedEvent . --===============2912231597282064303==--