Java Doc for MulticastRMICacheManagerPeerProvider.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.RMICacheManagerPeerProvider
      net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider

MulticastRMICacheManagerPeerProvider
final public class MulticastRMICacheManagerPeerProvider extends RMICacheManagerPeerProvider implements CacheManagerPeerProvider(Code)
A peer provider which discovers peers using Multicast.

Hosts can be in three different levels of conformance with the Multicast specification (RFC1112), according to the requirements they meet.

  1. Level 0 is the "no support for IP Multicasting" level. Lots of hosts and routers in the Internet are in this state, as multicast support is not mandatory in IPv4 (it is, however, in IPv6). Not too much explanation is needed here: hosts in this level can neither send nor receive multicast packets. They must ignore the ones sent by other multicast capable hosts.
  2. Level 1 is the "support for sending but not receiving multicast IP datagrams" level. Thus, note that it is not necessary to join a multicast group to be able to send datagrams to it. Very few additions are needed in the IP module to make a "Level 0" host "Level 1-compliant".
  3. Level 2 is the "full support for IP multicasting" level. Level 2 hosts must be able to both send and receive multicast traffic. They must know the way to join and leave multicast groups and to propagate this information to multicast routers. Thus, they must include an Internet Group Management Protocol (IGMP) implementation in their TCP/IP stack.

The list of CachePeers is maintained via heartbeats. rmiUrls are looked up using RMI and converted to CachePeers on registration. On lookup any stale references are removed.
author:
   Greg Luck
version:
   $Id: MulticastRMICacheManagerPeerProvider.java 519 2007-07-27 07:11:45Z gregluck $


Inner Class :final protected static class CachePeerEntry

Field Summary
final protected static  intSHORT_DELAY
    

Constructor Summary
public  MulticastRMICacheManagerPeerProvider(CacheManager cacheManager, InetAddress groupMulticastAddress, Integer groupMulticastPort, Integer timeToLive)
     Creates and starts a multicast peer provider
Parameters:
  groupMulticastAddress - 224.0.0.1 to 239.255.255.255 e.g.

Method Summary
final public  voiddispose()
    
public  MulticastKeepaliveHeartbeatReceivergetHeartBeatReceiver()
    
public  MulticastKeepaliveHeartbeatSendergetHeartBeatSender()
    
protected  longgetStaleTime()
     The time after which an unrefreshed peer provider entry is considered stale.
public  longgetTimeForClusterToForm()
     Time for a cluster to form.
final public  voidinit()
    
final public synchronized  ListlistRemoteCachePeers(Ehcache cache)
    
final public  voidregisterPeer(String rmiUrl)
     Register a new peer, but only if the peer is new, otherwise the last seen timestamp is updated.

This method is thread-safe.

final protected  booleanstale(Date date)
     Whether the entry should be considered stale.

Field Detail
SHORT_DELAY
final protected static int SHORT_DELAY(Code)
One second, in ms




Constructor Detail
MulticastRMICacheManagerPeerProvider
public MulticastRMICacheManagerPeerProvider(CacheManager cacheManager, InetAddress groupMulticastAddress, Integer groupMulticastPort, Integer timeToLive)(Code)
Creates and starts a multicast peer provider
Parameters:
  groupMulticastAddress - 224.0.0.1 to 239.255.255.255 e.g. 230.0.0.1
Parameters:
  groupMulticastPort - 1025 to 65536 e.g. 4446




Method Detail
dispose
final public void dispose()(Code)
Shutdown the heartbeat



getHeartBeatReceiver
public MulticastKeepaliveHeartbeatReceiver getHeartBeatReceiver()(Code)
the MulticastKeepaliveHeartbeatReceiver



getHeartBeatSender
public MulticastKeepaliveHeartbeatSender getHeartBeatSender()(Code)
the MulticastKeepaliveHeartbeatSender



getStaleTime
protected long getStaleTime()(Code)
The time after which an unrefreshed peer provider entry is considered stale.



getTimeForClusterToForm
public long getTimeForClusterToForm()(Code)
Time for a cluster to form. This varies considerably, depending on the implementation. the time in ms, for a cluster to form



init
final public void init() throws CacheException(Code)



listRemoteCachePeers
final public synchronized List listRemoteCachePeers(Ehcache cache) throws CacheException(Code)
a list of CachePeer peers, excluding the local peer.



registerPeer
final public void registerPeer(String rmiUrl)(Code)
Register a new peer, but only if the peer is new, otherwise the last seen timestamp is updated.

This method is thread-safe. It relies on peerUrls being a synchronizedMap
Parameters:
  rmiUrl -




stale
final protected boolean stale(Date date)(Code)
Whether the entry should be considered stale. This will depend on the type of RMICacheManagerPeerProvider. This method should be overridden for implementations that go stale based on date
Parameters:
  date - the date the entry was created true if stale



Fields inherited from net.sf.ehcache.distribution.RMICacheManagerPeerProvider
protected CacheManager cacheManager(Code)(Java Doc)
final protected Map peerUrls(Code)(Java Doc)

Methods inherited from net.sf.ehcache.distribution.RMICacheManagerPeerProvider
public void dispose() throws CacheException(Code)(Java Doc)
static String extractCacheName(String rmiUrl)(Code)(Java Doc)
final public CacheManager getCacheManager()(Code)(Java Doc)
abstract public void init()(Code)(Java Doc)
abstract public List listRemoteCachePeers(Ehcache cache) throws CacheException(Code)(Java Doc)
public CachePeer lookupRemoteCachePeer(String url) throws MalformedURLException, NotBoundException, RemoteException(Code)(Java Doc)
abstract public void registerPeer(String rmiUrl)(Code)(Java Doc)
abstract protected boolean stale(Date date)(Code)(Java Doc)
final public synchronized void unregisterPeer(String rmiUrl)(Code)(Java Doc)

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.