Java Doc for DistributedLockManager.java in  » Net » JGroups-2.4.1-sp3 » org » jgroups » blocks » 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 » Net » JGroups 2.4.1 sp3 » org.jgroups.blocks 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jgroups.blocks.DistributedLockManager

DistributedLockManager
public class DistributedLockManager implements TwoPhaseVotingListener,LockManager,VoteResponseProcessor,MembershipListener(Code)
Distributed lock manager is responsible for maintaining the lock information consistent on all participating nodes.
author:
   Roman Rokytskyy (rrokytskyy@acm.org)
author:
   Robert Schaffar-Taurok (robert@fusion.at)
version:
   $Id: DistributedLockManager.java,v 1.8 2006/08/15 09:18:53 belaban Exp $

Inner Class :public static class LockDecree implements Serializable
Inner Class :public static class AcquireLockDecree extends LockDecree
Inner Class :public static class ReleaseLockDecree extends LockDecree
Inner Class :public static class MultiLockDecree extends LockDecree

Field Summary
final  Vectorcurrent_members
    
final protected  Loglog
    

Constructor Summary
public  DistributedLockManager(VotingAdapter voteChannel, Object id)
     Create instance of this class.
Parameters:
  voteChannel - instance of VotingAdapter that will be used for voting purposes on the lock decrees.
public  DistributedLockManager(TwoPhaseVotingAdapter channel, Object id)
     Constructor for the DistributedLockManager_cl object.

Method Summary
public synchronized  voidabort(Object decree)
     Abort phase for the lock acquisition or release.
public  voidblock()
    
public synchronized  booleancommit(Object decree)
     Commit phase for the lock acquisition or release.
Parameters:
  decree - should be an instance LockDecree, if not,we throw VoteException to be ignored by theVoteChannel.
public  voidlock(Object lockId, Object owner, int timeout)
     Locks an object with lockId on behalf of the specified owner.
Parameters:
  lockId - Object representing the object to be locked.
Parameters:
  owner - object that requests the lock.
public synchronized  booleanprepare(Object decree)
     Prepare phase for the lock acquisition or release.
Parameters:
  decree - should be an instance LockDecree, if not,we throw VoteException to be ignored by theVoteChannel.
public  booleanprocessResponses(RspList responses, int consensusType, Object decree)
     Processes the response list and votes like the default processResponses method with the consensusType VOTE_ALL If the result of the voting is false, but this DistributedLockManager owns the lock, the result is changed to true and the lock is released, but marked as multiple locked.
public  voidsuspect(Address suspected_mbr)
    
public  voidunlock(Object lockId, Object owner)
     Unlocks an object with lockId on behalf of the specified owner.
public  voidunlock(Object lockId, Object owner, long timeout)
    
public  voidunlock(Object lockId, Object owner, boolean releaseMultiLocked)
     Unlocks an object with lockId on behalf of the specified owner.
Parameters:
  lockId - long representing the object to be unlocked.
Parameters:
  owner - object that releases the lock.
Parameters:
  releaseMultiLocked - releases also multiple locked locks.
public  voidunlock(Object lockId, Object owner, boolean releaseMultiLocked, long timeout)
    
public  voidviewAccepted(View new_view)
    

Field Detail
current_members
final Vector current_members(Code)



log
final protected Log log(Code)




Constructor Detail
DistributedLockManager
public DistributedLockManager(VotingAdapter voteChannel, Object id)(Code)
Create instance of this class.
Parameters:
  voteChannel - instance of VotingAdapter that will be used for voting purposes on the lock decrees. voteChannel() willbe wrapped by the instance of the TwoPhaseVotingAdapter.
Parameters:
  id - the unique identifier of this lock manager.todo check if the node with the same id is already in the group.



DistributedLockManager
public DistributedLockManager(TwoPhaseVotingAdapter channel, Object id)(Code)
Constructor for the DistributedLockManager_cl object.
Parameters:
  channel - instance of TwoPhaseVotingAdapterthat will be used for voting purposes on the lock decrees.
Parameters:
  id - the unique identifier of this lock manager.




Method Detail
abort
public synchronized void abort(Object decree) throws VoteException(Code)
Abort phase for the lock acquisition or release.
Parameters:
  decree - should be an instance LockDecree, if not,we throw VoteException to be ignored by theVoteChannel.
throws:
  VoteException - if we should be ignored during voting.



block
public void block()(Code)



commit
public synchronized boolean commit(Object decree) throws VoteException(Code)
Commit phase for the lock acquisition or release.
Parameters:
  decree - should be an instance LockDecree, if not,we throw VoteException to be ignored by theVoteChannel. true when commiting the lock operation succeeds.
throws:
  VoteException - if we should be ignored during voting.



lock
public void lock(Object lockId, Object owner, int timeout) throws LockNotGrantedException, ChannelException(Code)
Locks an object with lockId on behalf of the specified owner.
Parameters:
  lockId - Object representing the object to be locked.
Parameters:
  owner - object that requests the lock. This should be the Address of a JGroups member, otherwise we cannotrelease the locks for a crashed member !
Parameters:
  timeout - time during which group members should decidewhether to grant a lock or not.
throws:
  LockNotGrantedException - when the lock cannot be granted.
throws:
  ClassCastException - if lockId or owner are not serializable.
throws:
  ChannelException - if something bad happened to underlying channel.



prepare
public synchronized boolean prepare(Object decree) throws VoteException(Code)
Prepare phase for the lock acquisition or release.
Parameters:
  decree - should be an instance LockDecree, if not,we throw VoteException to be ignored by theVoteChannel. true when preparing the lock operation succeeds.
throws:
  VoteException - if we should be ignored during voting.



processResponses
public boolean processResponses(RspList responses, int consensusType, Object decree) throws ChannelException(Code)
Processes the response list and votes like the default processResponses method with the consensusType VOTE_ALL If the result of the voting is false, but this DistributedLockManager owns the lock, the result is changed to true and the lock is released, but marked as multiple locked. (only in the prepare state to reduce traffic)

Note: we do not support voting in case of Byzantine failures, i.e. when the node responds with the fault message.




suspect
public void suspect(Address suspected_mbr)(Code)



unlock
public void unlock(Object lockId, Object owner) throws LockNotReleasedException, ChannelException(Code)
Unlocks an object with lockId on behalf of the specified owner. since 2.2.9 this method is only a wrapper for unlock(Object lockId, Object owner, boolean releaseMultiLocked). Use that with releaseMultiLocked set to true if you want to be able to release multiple locked locks (for example after a merge)
Parameters:
  lockId - long representing the object to be unlocked.
Parameters:
  owner - object that releases the lock.
throws:
  LockNotReleasedException - when the lock cannot be released.
throws:
  ClassCastException - if lockId or owner are not serializable.



unlock
public void unlock(Object lockId, Object owner, long timeout) throws LockNotReleasedException, ChannelException(Code)



unlock
public void unlock(Object lockId, Object owner, boolean releaseMultiLocked) throws LockNotReleasedException, ChannelException, LockMultiLockedException(Code)
Unlocks an object with lockId on behalf of the specified owner.
Parameters:
  lockId - long representing the object to be unlocked.
Parameters:
  owner - object that releases the lock.
Parameters:
  releaseMultiLocked - releases also multiple locked locks. (eg. locks that are locked by another DLM after a merge)
throws:
  LockNotReleasedException - when the lock cannot be released.
throws:
  ClassCastException - if lockId or owner are not serializable.
throws:
  LockMultiLockedException - if releaseMultiLocked is true and a multiple locked lock has been released.



unlock
public void unlock(Object lockId, Object owner, boolean releaseMultiLocked, long timeout) throws LockNotReleasedException, ChannelException, LockMultiLockedException(Code)



viewAccepted
public void viewAccepted(View new_view)(Code)
Remove all locks held by members who left the previous view



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.