Java Doc for NotificationCache.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » event » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » sakai » org.sakaiproject.event.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.sakaiproject.event.impl.NotificationCache

NotificationCache
public class NotificationCache implements Cacher,Observer(Code)

A Cache of objects with keys with a limited lifespan.

When the object expires, the cache calls upon a CacheRefresher to update the key's value. The update is done in a separate thread.



Field Summary
protected  booleanm_complete
     If true, we have all the entries that there are in the cache.
protected  booleanm_disabled
     If true, we are disabled.
protected  Mapm_functionMap
     Map of notification function to Set of notifications - same objects as in m_map.
protected  Listm_heldEvents
     The events we are holding for later processing.
protected  booleanm_holdEventProcessing
     If true, we are going to hold any events we see in the m_heldEvents list for later processing.
protected  Mapm_map
     Map holding cached entries (by reference).
protected  CacheRefresherm_refresher
     The object that will deal with expired entries.
protected  Stringm_resourcePattern
     The string that all resources in this cache will start with.

Constructor Summary
public  NotificationCache(CacheRefresher refresher, String pattern)
     Construct the Cache.

Method Summary
public synchronized  voidclear()
     Clear all entries.
public synchronized  booleancontainsKey(Object key)
     Test for an entry in the cache.
Parameters:
  key - The cache key.
public  voiddisable()
     Disable the cache.
public  booleandisabled()
    
public  voidenable()
     Enable the cache.
protected  voidfinalize()
     Clean up.
public synchronized  Notificationget(Object key)
     Get the entry associated with the key, or null if not there
Parameters:
  key - The cache key.
public  ListgetAll()
     Get all the non-null entries.
public  ListgetAll(String function)
     Get all the Notification entries that are watching this Event function.
Parameters:
  function - The function to use to select Notifications.
public  StringgetDescription()
     Return a description of the cacher.
public  ListgetIds()
     Get all the keys, eache modified to remove the resourcePattern prefix.
public  ListgetKeys()
    
public  longgetSize()
     Return the size of the cacher - indicating how much memory in use.
public synchronized  voidholdEvents()
     Set the cache to hold events for later processing to assure an atomic "complete" load.
public  booleanisComplete()
    
public synchronized  voidprocessEvents()
     Restore normal event processing in the cache, and process any held events now.
public synchronized  voidput(Notification payload)
     Cache an object.
public synchronized  voidremove(Object key)
     Remove this entry from the cache.
public  voidresetCache()
     Clear out as much as possible anything cached; re-sync any cache that is needed to be kept.
public  voidsetComplete()
     Set the cache to be complete, containing all possible entries.
public  voidupdate(Observable o, Object arg)
     This method is called whenever the observed object is changed.

Field Detail
m_complete
protected boolean m_complete(Code)
If true, we have all the entries that there are in the cache.



m_disabled
protected boolean m_disabled(Code)
If true, we are disabled.



m_functionMap
protected Map m_functionMap(Code)
Map of notification function to Set of notifications - same objects as in m_map.



m_heldEvents
protected List m_heldEvents(Code)
The events we are holding for later processing.



m_holdEventProcessing
protected boolean m_holdEventProcessing(Code)
If true, we are going to hold any events we see in the m_heldEvents list for later processing.



m_map
protected Map m_map(Code)
Map holding cached entries (by reference).



m_refresher
protected CacheRefresher m_refresher(Code)
The object that will deal with expired entries.



m_resourcePattern
protected String m_resourcePattern(Code)
The string that all resources in this cache will start with.




Constructor Detail
NotificationCache
public NotificationCache(CacheRefresher refresher, String pattern)(Code)
Construct the Cache. Attempts to keep complete on Event notification by calling the refresher.
Parameters:
  refresher - The object that will handle refreshing of event notified modified or added entries.
Parameters:
  pattern - The "startsWith()" string for all resources that may be in this cache.




Method Detail
clear
public synchronized void clear()(Code)
Clear all entries.



containsKey
public synchronized boolean containsKey(Object key)(Code)
Test for an entry in the cache.
Parameters:
  key - The cache key. true if the key maps to an entry, false if not.



disable
public void disable()(Code)
Disable the cache.



disabled
public boolean disabled()(Code)
Is the cache disabled? true if the cache is disabled, false if it is enabled.



enable
public void enable()(Code)
Enable the cache.



finalize
protected void finalize()(Code)
Clean up.



get
public synchronized Notification get(Object key)(Code)
Get the entry associated with the key, or null if not there
Parameters:
  key - The cache key. The entry associated with the key, or null if the a null is cached, or the key is not found (Note: use containsKey() to remove this ambiguity).



getAll
public List getAll()(Code)
Get all the non-null entries. all the non-null entries, or an empty list if none.



getAll
public List getAll(String function)(Code)
Get all the Notification entries that are watching this Event function.
Parameters:
  function - The function to use to select Notifications. all the Notification entries that are watching this Event function.



getDescription
public String getDescription()(Code)
Return a description of the cacher. The cacher's description.



getIds
public List getIds()(Code)
Get all the keys, eache modified to remove the resourcePattern prefix. Note: only works with String keys. The List of keys converted from references to ids (String).



getKeys
public List getKeys()(Code)
Get all the keys The List of key values (Object).



getSize
public long getSize()(Code)
Return the size of the cacher - indicating how much memory in use. The size of the cacher.



holdEvents
public synchronized void holdEvents()(Code)
Set the cache to hold events for later processing to assure an atomic "complete" load.



isComplete
public boolean isComplete()(Code)
Are we complete? true if we have all the possible entries cached, false if not.



processEvents
public synchronized void processEvents()(Code)
Restore normal event processing in the cache, and process any held events now.



put
public synchronized void put(Notification payload)(Code)
Cache an object.
Parameters:
  key - The key with which to find the object.
Parameters:
  payload - The object to cache.
Parameters:
  duration - The time to cache the object (seconds).



remove
public synchronized void remove(Object key)(Code)
Remove this entry from the cache.
Parameters:
  key - The cache key.



resetCache
public void resetCache()(Code)
Clear out as much as possible anything cached; re-sync any cache that is needed to be kept.



setComplete
public void setComplete()(Code)
Set the cache to be complete, containing all possible entries.



update
public void update(Observable o, Object arg)(Code)
This method is called whenever the observed object is changed. An application calls an Observable object's notifyObservers method to have all the object's observers notified of the change. default implementation is to cause the courier service to deliver to the interface controlled by my controller. Extensions can override.
Parameters:
  o - the observable object.
Parameters:
  arg - an argument passed to the notifyObservers method.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.