Java Doc for AbstractReplicatedMap.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » catalina » tribes » tipis » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.catalina.tribes.tipis 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.concurrent.ConcurrentHashMap
   org.apache.catalina.tribes.tipis.AbstractReplicatedMap

All known Subclasses:   org.apache.catalina.tribes.tipis.ReplicatedMap,  org.apache.catalina.tribes.tipis.LazyReplicatedMap,
AbstractReplicatedMap
abstract public class AbstractReplicatedMap extends ConcurrentHashMap implements RpcCallback,ChannelListener,MembershipListener,Heartbeat(Code)

author:
   Filip Hanik
version:
   1.0

Inner Class :public static class MapEntry implements Map.Entry
Inner Class :public static class MapMessage implements Serializable

Field Summary
final public static  intDEFAULT_INITIAL_CAPACITY
     The default initial capacity - MUST be a power of two.
final public static  floatDEFAULT_LOAD_FACTOR
     The load factor used when none specified in constructor.
protected transient  longaccessTimeout
     Since the map keeps internal membership this is the timeout for a ping message to be responded to If a remote map doesn't respond within this timeframe, its considered dead.
protected transient  Channelchannel
    
protected transient  intchannelSendOptions
    
final  Stringchset
    
protected transient  intcurrentNode
    
protected transient  ClassLoader[]externalLoaders
     External class loaders if serialization and deserialization is to be performed successfully.
protected static  Loglog
    
protected transient  byte[]mapContextName
    
protected transient  HashMapmapMembers
    
protected transient  ObjectmapOwner
    
protected transient  Stringmapname
    
protected transient  RpcChannelrpcChannel
    
protected transient  longrpcTimeout
    
protected transient  ObjectstateMutex
    
protected transient  booleanstateTransferred
    

Constructor Summary
public  AbstractReplicatedMap(Object owner, Channel channel, long timeout, String mapContextName, int initialCapacity, float loadFactor, int channelSendOptions, ClassLoader[] cls)
    

Method Summary
public  booleanaccept(Serializable msg, Member sender)
    
public  voidbreakdown()
    
protected  voidbroadcast(int msgtype, boolean rpc)
    
public  voidclear()
    
public  voidclear(boolean notify)
    
public  Objectclone()
    
public  booleancontainsKey(Object key)
     Returns true if the key has an entry in the map.
public  booleancontainsValue(Object value)
    
public  SetentrySet()
    
public  SetentrySetFull()
     Returns the entire contents of the map Map.Entry.getValue() will return a LazyReplicatedMap.MapEntry object containing all the information about the object.
public  booleanequals(Object o)
    
public  Member[]excludeFromSet(Member[] mbrs, Member[] set)
    
public  voidfinalize()
    
public  Objectget(Object key)
    
public  longgetAccessTimeout()
    
public  ChannelgetChannel()
    
public  intgetChannelSendOptions()
    
public  ClassLoader[]getExternalLoaders()
    
public  MapEntrygetInternal(Object key)
    
public  byte[]getMapContextName()
    
public  Member[]getMapMembers(HashMap members)
    
public  Member[]getMapMembers()
    
public  Member[]getMapMembersExcl(Member[] exclude)
    
public  ObjectgetMapOwner()
    
public  intgetNextBackupIndex()
    
public  MembergetNextBackupNode()
    
public  RpcChannelgetRpcChannel()
    
public  longgetRpcTimeout()
    
abstract protected  intgetStateMessageType()
    
public  ObjectgetStateMutex()
    
public  inthashCode()
    
public  voidheartbeat()
    
public  booleaninSet(Member m, Member[] set)
    
protected  voidinit(Object owner, Channel channel, String mapContextName, long timeout, int channelSendOptions, ClassLoader[] cls)
    
public  booleanisEmpty()
    
public  booleanisStateTransferred()
    
public  SetkeySet()
    
public  SetkeySetFull()
    
public  voidleftOver(Serializable msg, Member sender)
     If the reply has already been sent to the requesting thread, the rpc callback can handle any data that comes in after the fact.
public  voidmapMemberAdded(Member member)
    
public  voidmemberAdded(Member member)
    
protected  voidmemberAlive(Member member)
    
public  voidmemberDisappeared(Member member)
    
public  voidmessageReceived(Serializable msg, Member sender)
    
protected  voidping(long timeout)
     Sends a ping out to all the members in the cluster, not just map members that this map is alive.
protected  voidprintMap(String header)
    
abstract protected  Member[]publishEntryInfo(Object key, Object value)
    
public  Objectput(Object key, Object value)
    
public  Objectput(Object key, Object value, boolean notify)
    
public  voidputAll(Map m)
    
public  Objectremove(Object key)
    
public  Objectremove(Object key, boolean notify)
    
protected  booleanremoveEldestEntry(Map.Entry eldest)
    
public  voidreplicate(Object key, boolean complete)
    
public  voidreplicate(boolean complete)
     This can be invoked by a periodic thread to replicate out any changes.
public  SerializablereplyRequest(Serializable msg, Member sender)
    
public  voidsetAccessTimeout(long accessTimeout)
    
public  voidsetChannelSendOptions(int channelSendOptions)
    
public  voidsetExternalLoaders(ClassLoader[] externalLoaders)
    
public  voidsetMapOwner(Object mapOwner)
    
public  intsize()
    
public  intsizeFull()
    
public  voidtransferState()
    
public  Collectionvalues()
    
protected  Member[]wrap(Member m)
    

Field Detail
DEFAULT_INITIAL_CAPACITY
final public static int DEFAULT_INITIAL_CAPACITY(Code)
The default initial capacity - MUST be a power of two.



DEFAULT_LOAD_FACTOR
final public static float DEFAULT_LOAD_FACTOR(Code)
The load factor used when none specified in constructor.



accessTimeout
protected transient long accessTimeout(Code)
Since the map keeps internal membership this is the timeout for a ping message to be responded to If a remote map doesn't respond within this timeframe, its considered dead.



channel
protected transient Channel channel(Code)
Reference to the channel for sending messages



channelSendOptions
protected transient int channelSendOptions(Code)
Our default send options



chset
final String chset(Code)
Used to identify the map



currentNode
protected transient int currentNode(Code)
The node we are currently backing up data to, this index will rotate on a round robin basis



externalLoaders
protected transient ClassLoader[] externalLoaders(Code)
External class loaders if serialization and deserialization is to be performed successfully.



log
protected static Log log(Code)



mapContextName
protected transient byte[] mapContextName(Code)
The Map context name makes this map unique, this allows us to have more than one map shared through one channel



mapMembers
protected transient HashMap mapMembers(Code)
A list of members in our map



mapOwner
protected transient Object mapOwner(Code)
The owner of this map, ala a SessionManager for example



mapname
protected transient String mapname(Code)
Readable string of the mapContextName value



rpcChannel
protected transient RpcChannel rpcChannel(Code)
The RpcChannel to send RPC messages through



rpcTimeout
protected transient long rpcTimeout(Code)
Timeout for RPC messages, how long we will wait for a reply



stateMutex
protected transient Object stateMutex(Code)
Simple lock object for transfers



stateTransferred
protected transient boolean stateTransferred(Code)
Has the state been transferred




Constructor Detail
AbstractReplicatedMap
public AbstractReplicatedMap(Object owner, Channel channel, long timeout, String mapContextName, int initialCapacity, float loadFactor, int channelSendOptions, ClassLoader[] cls)(Code)
Creates a new map
Parameters:
  channel - The channel to use for communication
Parameters:
  timeout - long - timeout for RPC messags
Parameters:
  mapContextName - String - unique name for this map, to allow multiple maps per channel
Parameters:
  initialCapacity - int - the size of this map, see HashMap
Parameters:
  loadFactor - float - load factor, see HashMap
Parameters:
  cls - - a list of classloaders to be used for deserialization of objects.




Method Detail
accept
public boolean accept(Serializable msg, Member sender)(Code)



breakdown
public void breakdown()(Code)



broadcast
protected void broadcast(int msgtype, boolean rpc) throws ChannelException(Code)
Helper method to broadcast a message to all members in a channel
Parameters:
  msgtype - int
Parameters:
  rpc - boolean
throws:
  ChannelException -



clear
public void clear()(Code)



clear
public void clear(boolean notify)(Code)



clone
public Object clone()(Code)



containsKey
public boolean containsKey(Object key)(Code)
Returns true if the key has an entry in the map. The entry can be a proxy or a backup entry, invoking get(key) will make this entry primary for the group
Parameters:
  key - Object boolean



containsValue
public boolean containsValue(Object value)(Code)



entrySet
public Set entrySet()(Code)



entrySetFull
public Set entrySetFull()(Code)
Returns the entire contents of the map Map.Entry.getValue() will return a LazyReplicatedMap.MapEntry object containing all the information about the object. Set



equals
public boolean equals(Object o)(Code)



excludeFromSet
public Member[] excludeFromSet(Member[] mbrs, Member[] set)(Code)



finalize
public void finalize()(Code)



get
public Object get(Object key)(Code)



getAccessTimeout
public long getAccessTimeout()(Code)



getChannel
public Channel getChannel()(Code)



getChannelSendOptions
public int getChannelSendOptions()(Code)



getExternalLoaders
public ClassLoader[] getExternalLoaders()(Code)



getInternal
public MapEntry getInternal(Object key)(Code)



getMapContextName
public byte[] getMapContextName()(Code)



getMapMembers
public Member[] getMapMembers(HashMap members)(Code)



getMapMembers
public Member[] getMapMembers()(Code)



getMapMembersExcl
public Member[] getMapMembersExcl(Member[] exclude)(Code)



getMapOwner
public Object getMapOwner()(Code)



getNextBackupIndex
public int getNextBackupIndex()(Code)



getNextBackupNode
public Member getNextBackupNode()(Code)



getRpcChannel
public RpcChannel getRpcChannel()(Code)



getRpcTimeout
public long getRpcTimeout()(Code)



getStateMessageType
abstract protected int getStateMessageType()(Code)



getStateMutex
public Object getStateMutex()(Code)



hashCode
public int hashCode()(Code)



heartbeat
public void heartbeat()(Code)



inSet
public boolean inSet(Member m, Member[] set)(Code)



init
protected void init(Object owner, Channel channel, String mapContextName, long timeout, int channelSendOptions, ClassLoader[] cls)(Code)
Initializes the map by creating the RPC channel, registering itself as a channel listener This method is also responsible for initiating the state transfer
Parameters:
  owner - Object
Parameters:
  channel - Channel
Parameters:
  mapContextName - String
Parameters:
  timeout - long
Parameters:
  channelSendOptions - int
Parameters:
  cls - ClassLoader[]



isEmpty
public boolean isEmpty()(Code)



isStateTransferred
public boolean isStateTransferred()(Code)



keySet
public Set keySet()(Code)



keySetFull
public Set keySetFull()(Code)



leftOver
public void leftOver(Serializable msg, Member sender)(Code)
If the reply has already been sent to the requesting thread, the rpc callback can handle any data that comes in after the fact.
Parameters:
  msg - Serializable
Parameters:
  sender - Member



mapMemberAdded
public void mapMemberAdded(Member member)(Code)



memberAdded
public void memberAdded(Member member)(Code)



memberAlive
protected void memberAlive(Member member)(Code)
We have received a member alive notification
Parameters:
  member - Member



memberDisappeared
public void memberDisappeared(Member member)(Code)



messageReceived
public void messageReceived(Serializable msg, Member sender)(Code)



ping
protected void ping(long timeout) throws ChannelException(Code)
Sends a ping out to all the members in the cluster, not just map members that this map is alive.
Parameters:
  timeout - long
throws:
  ChannelException -



printMap
protected void printMap(String header)(Code)



publishEntryInfo
abstract protected Member[] publishEntryInfo(Object key, Object value) throws ChannelException(Code)



put
public Object put(Object key, Object value)(Code)



put
public Object put(Object key, Object value, boolean notify)(Code)



putAll
public void putAll(Map m)(Code)
Copies all values from one map to this instance
Parameters:
  m - Map



remove
public Object remove(Object key)(Code)
Removes an object from this map, it will also remove it from
Parameters:
  key - Object Object



remove
public Object remove(Object key, boolean notify)(Code)



removeEldestEntry
protected boolean removeEldestEntry(Map.Entry eldest)(Code)



replicate
public void replicate(Object key, boolean complete)(Code)
Replicates any changes to the object since the last time The object has to be primary, ie, if the object is a proxy or a backup, it will not be replicated

Parameters:
  complete - - if set to true, the object is replicated to its backupif set to false, only objects that implement ReplicatedMapEntry and the isDirty() returns true willbe replicated



replicate
public void replicate(boolean complete)(Code)
This can be invoked by a periodic thread to replicate out any changes. For maps that don't store objects that implement ReplicatedMapEntry, this method should be used infrequently to avoid large amounts of data transfer
Parameters:
  complete - boolean



replyRequest
public Serializable replyRequest(Serializable msg, Member sender)(Code)

Parameters:
  msg - Serializable Serializable - null if no reply should be sent



setAccessTimeout
public void setAccessTimeout(long accessTimeout)(Code)



setChannelSendOptions
public void setChannelSendOptions(int channelSendOptions)(Code)



setExternalLoaders
public void setExternalLoaders(ClassLoader[] externalLoaders)(Code)



setMapOwner
public void setMapOwner(Object mapOwner)(Code)



size
public int size()(Code)



sizeFull
public int sizeFull()(Code)



transferState
public void transferState()(Code)



values
public Collection values()(Code)



wrap
protected Member[] wrap(Member m)(Code)
Helper methods, wraps a single member in an array
Parameters:
  m - Member Member[]



Methods inherited from java.util.concurrent.ConcurrentHashMap
public void clear()(Code)(Java Doc)
public boolean contains(Object value)(Code)(Java Doc)
public boolean containsKey(Object key)(Code)(Java Doc)
public boolean containsValue(Object value)(Code)(Java Doc)
public Enumeration<V> elements()(Code)(Java Doc)
public Set<Map.Entry<K, V>> entrySet()(Code)(Java Doc)
public V get(Object key)(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
public Set<K> keySet()(Code)(Java Doc)
public Enumeration<K> keys()(Code)(Java Doc)
public V put(K key, V value)(Code)(Java Doc)
public void putAll(Map<? extends K, ? extends V> m)(Code)(Java Doc)
public V putIfAbsent(K key, V value)(Code)(Java Doc)
public V remove(Object key)(Code)(Java Doc)
public boolean remove(Object key, Object value)(Code)(Java Doc)
public boolean replace(K key, V oldValue, V newValue)(Code)(Java Doc)
public V replace(K key, V value)(Code)(Java Doc)
public int size()(Code)(Java Doc)
public Collection<V> values()(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.