/cacheManagement/examples/root/event/Event.cfc

http://coldfusioncachemanager.googlecode.com/ · ColdFusion CFScript · 46 lines · 35 code · 11 blank · 0 comment · 0 complexity · dee520c0d0f8d726812a9f37d01724b1 MD5 · raw file

  1. <cfcomponent output="false">
  2. <cffunction name="init" access="public" returntype="Event" output="false">
  3. <cfargument name="facade" type="Any" required="true" />
  4. <cfset variables.facade = arguments.facade />
  5. <cfset variables.facade.setValue( 'onCacheAdded', arrayNew(1) ) />
  6. <cfset variables.facade.setValue( 'onCacheRemoved', arrayNew(1) ) />
  7. <cfset variables.facade.setValue( 'onElementPut', arrayNew(1) ) />
  8. <cfset variables.facade.setValue( 'onElementExpired', arrayNew(1) ) />
  9. <cfset variables.facade.setValue( 'onElementRemoved', arrayNew(1) ) />
  10. <cfset variables.facade.setValue( 'onElementsRemoveAll', arrayNew(1) ) />
  11. <cfreturn this />
  12. </cffunction>
  13. <cffunction name="appendMessage" access="private" returntype="void" output="false">
  14. <cfargument name="type" type="String" required="true" />
  15. <cfset variables.facade.getValue( arguments.type ).add( "-" & dateFormat( now(), 'dd-mm-yyyy' ) & "-" & timeFormat( now(), 'hh-mm-ss-ms' ) & "<br />") />
  16. </cffunction>
  17. <cffunction name="onCacheAdded" access="public" returntype="Any" output="false">
  18. <cfset appendMessage( 'onCacheAdded' ) />
  19. </cffunction>
  20. <cffunction name="onCacheRemoved" access="public" returntype="Any" output="false">
  21. <cfset appendMessage( 'onCacheRemoved' ) />
  22. </cffunction>
  23. <cffunction name="onElementPut" access="public" returntype="Any" output="false">
  24. <cfset appendMessage( 'onElementPut' ) />
  25. </cffunction>
  26. <cffunction name="onElementExpired" access="public" returntype="Any" output="false">
  27. <cfset appendMessage( 'onElementExpired' ) />
  28. </cffunction>
  29. <cffunction name="onElementRemoved" access="public" returntype="Any" output="false">
  30. <cfset appendMessage( 'onElementRemoved' ) />
  31. </cffunction>
  32. <cffunction name="onElementsRemoveAll" access="public" returntype="Any" output="false">
  33. <cfset appendMessage( 'onElementsRemoveAll' ) />
  34. </cffunction>
  35. </cfcomponent>