Java Doc for RMISynchronousCacheReplicator.java in  » Cache » ehcache » net » sf » ehcache » distribution » 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 » Cache » ehcache » net.sf.ehcache.distribution 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.ehcache.distribution.RMISynchronousCacheReplicator

All known Subclasses:   net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator,
RMISynchronousCacheReplicator
public class RMISynchronousCacheReplicator implements CacheReplicator(Code)
Listens to net.sf.ehcache.CacheManager and net.sf.ehcache.Cache events and propagates those to CachePeer peers of the Cache.
author:
   Greg Luck
version:
   $Id: RMISynchronousCacheReplicator.java 519 2007-07-27 07:11:45Z gregluck $


Field Summary
final protected  booleanreplicatePuts
     Whether to replicate puts.
final protected  booleanreplicateRemovals
    
final protected  booleanreplicateUpdates
     Whether to replicate updates.
final protected  booleanreplicateUpdatesViaCopy
     Whether an update (a put) should be by copy or by invalidation, (a remove).

By copy is best when the entry is expensive to produce.

protected  Statusstatus
     The status of the replicator.

Constructor Summary
public  RMISynchronousCacheReplicator(boolean replicatePuts, boolean replicateUpdates, boolean replicateUpdatesViaCopy, boolean replicateRemovals)
    

Method Summary
final public  booleanalive()
     Checks that the replicator is is STATUS_ALIVE.
public  Objectclone()
     Creates a clone of this listener.
public  voiddispose()
    
final public  booleanisReplicateUpdatesViaCopy()
    
static  ListlistRemoteCachePeers(Ehcache cache)
    
final public  booleannotAlive()
     Asserts that the replicator is active.
public  voidnotifyElementEvicted(Ehcache cache, Element element)
     Called immediately after an element is evicted from the cache.
final public  voidnotifyElementExpired(Ehcache cache, Element element)
    

This implementation does not propagate expiries.

public  voidnotifyElementPut(Ehcache cache, Element element)
     Called immediately after an element has been put into the cache.
public  voidnotifyElementRemoved(Ehcache cache, Element element)
     Called immediately after an attempt to remove an element.
public  voidnotifyElementUpdated(Ehcache cache, Element element)
     Called immediately after an element has been put into the cache and the element already existed in the cache.
public  voidnotifyRemoveAll(Ehcache cache)
     Called during net.sf.ehcache.Ehcache.removeAll to indicate that the all elements have been removed from the cache in a bulk operation.

Field Detail
replicatePuts
final protected boolean replicatePuts(Code)
Whether to replicate puts.



replicateRemovals
final protected boolean replicateRemovals(Code)
Whether to replicate removes



replicateUpdates
final protected boolean replicateUpdates(Code)
Whether to replicate updates.



replicateUpdatesViaCopy
final protected boolean replicateUpdatesViaCopy(Code)
Whether an update (a put) should be by copy or by invalidation, (a remove).

By copy is best when the entry is expensive to produce. By invalidation is best when we are really trying to force other caches to sync back to a canonical source like a database. An example of a latter usage would be a read/write cache being used in Hibernate.

This setting only has effect if #replicateUpdates is true.




status
protected Status status(Code)
The status of the replicator. Only replicates when STATUS_ALIVE




Constructor Detail
RMISynchronousCacheReplicator
public RMISynchronousCacheReplicator(boolean replicatePuts, boolean replicateUpdates, boolean replicateUpdatesViaCopy, boolean replicateRemovals)(Code)
Constructor for internal and subclass use
Parameters:
  replicatePuts -
Parameters:
  replicateUpdates -
Parameters:
  replicateUpdatesViaCopy -
Parameters:
  replicateRemovals -




Method Detail
alive
final public boolean alive()(Code)
Checks that the replicator is is STATUS_ALIVE.



clone
public Object clone() throws CloneNotSupportedException(Code)
Creates a clone of this listener. This method will only be called by ehcache before a cache is initialized.

This may not be possible for listeners after they have been initialized. Implementations should throw CloneNotSupportedException if they do not support clone. a clone
throws:
  CloneNotSupportedException - if the listener could not be cloned.




dispose
public void dispose()(Code)
Give the replicator a chance to cleanup and free resources when no longer needed



isReplicateUpdatesViaCopy
final public boolean isReplicateUpdatesViaCopy()(Code)
whether update is through copy or invalidate



listRemoteCachePeers
static List listRemoteCachePeers(Ehcache cache)(Code)
Package protected List of cache peers
Parameters:
  cache - a list of CachePeer peers for the given cache, excluding the local peer.



notAlive
final public boolean notAlive()(Code)
Asserts that the replicator is active. true if the status is not STATUS_ALIVE



notifyElementEvicted
public void notifyElementEvicted(Ehcache cache, Element element)(Code)
Called immediately after an element is evicted from the cache. Evicted in this sense means evicted from one store and not moved to another, so that it exists nowhere in the local cache.

In a sense the Element has been removed from the cache, but it is different, thus the separate notification.

This replicator does not propagate these events
Parameters:
  cache - the cache emitting the notification
Parameters:
  element - the element that has just been evicted




notifyElementExpired
final public void notifyElementExpired(Ehcache cache, Element element)(Code)

This implementation does not propagate expiries. It does not need to do anything because the element will expire in the remote cache at the same time. If the remote peer is not configured the same way they should not be in an cache cluster.




notifyElementPut
public void notifyElementPut(Ehcache cache, Element element) throws CacheException(Code)
Called immediately after an element has been put into the cache. The net.sf.ehcache.Cache.put(net.sf.ehcache.Element) method will block until this method returns.

Implementers may wish to have access to the Element's fields, including value, so the element is provided. Implementers should be careful not to modify the element. The effect of any modifications is undefined.
Parameters:
  cache - the cache emitting the notification
Parameters:
  element - the element which was just put into the cache.




notifyElementRemoved
public void notifyElementRemoved(Ehcache cache, Element element) throws CacheException(Code)
Called immediately after an attempt to remove an element. The remove method will block until this method returns.

This notification is received regardless of whether the cache had an element matching the removal key or not. If an element was removed, the element is passed to this method, otherwise a synthetic element, with only the key set is passed in.


Parameters:
  cache - the cache emitting the notification
Parameters:
  element - the element just deleted, or a synthetic element with just the key set ifno element was removed.param element just deleted




notifyElementUpdated
public void notifyElementUpdated(Ehcache cache, Element element) throws CacheException(Code)
Called immediately after an element has been put into the cache and the element already existed in the cache. This is thus an update.

The net.sf.ehcache.Cache.put(net.sf.ehcache.Element) method will block until this method returns.

Implementers may wish to have access to the Element's fields, including value, so the element is provided. Implementers should be careful not to modify the element. The effect of any modifications is undefined.
Parameters:
  cache - the cache emitting the notification
Parameters:
  element - the element which was just put into the cache.




notifyRemoveAll
public void notifyRemoveAll(Ehcache cache)(Code)
Called during net.sf.ehcache.Ehcache.removeAll to indicate that the all elements have been removed from the cache in a bulk operation. The usual RMISynchronousCacheReplicator.notifyElementRemoved(net.sf.ehcache.Ehcache,net.sf.ehcache.Element) is not called.

This notification exists because clearing a cache is a special case. It is often not practical to serially process notifications where potentially millions of elements have been bulk deleted.
Parameters:
  cache - the cache emitting the notification




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.