Source Code Cross Referenced for Lock.java in  » Database-DBMS » Ozone-1.1 » org » ozoneDB » core » 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 » Database DBMS » Ozone 1.1 » org.ozoneDB.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        // You can redistribute this software and/or modify it under the terms of
02:        // the Ozone Core License version 1 published by ozone-db.org.
03:        //
04:        // The original code and portions created by SMB are
05:        // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06:        //
07:        // $Id: Lock.java,v 1.2 2002/06/08 00:49:38 mediumnet Exp $
08:
09:        package org.ozoneDB.core;
10:
11:        import java.io.*;
12:        import org.ozoneDB.DxLib.*;
13:        import org.ozoneDB.*;
14:
15:        /**
16:         * Locks are created by the {@link TransactionManager} and used by the core
17:         * to manage concurrent access to the same containers/objects. There are several
18:         * Lock implementations that provide different policies.
19:         * 
20:         * 
21:         * @author <a href="http://www.softwarebuero.de/">SMB</a>
22:         * @version $Revision: 1.2 $Date: 2002/06/08 00:49:38 $
23:         */
24:        public interface Lock extends Serializable {
25:
26:            public final static int NOT_ACQUIRED = -1;
27:            public final static int LEVEL_NONE = 0;
28:            public final static int LEVEL_READ = 1;
29:            public final static int LEVEL_UPGRADE = 2;
30:            public final static int LEVEL_WRITE = 4;
31:            // levels >= this are not valid
32:            public final static int LEVEL_MAX = 5;
33:
34:            public void reset();
35:
36:            /**
37:             * Check for deadlock and throw an exception if a deadlock is detected.
38:             * Although the transactions waits for locks and so seems also to be
39:             * be a good place for deadlock detection, we do it here because each
40:             * Lock implementations should hide the deadlock detection logic.
41:             */
42:            public void checkDeadlock(Transaction ta) throws TransactionError;
43:
44:            /**
45:             * Try to aquire this lock. This method returns the previous level of the
46:             * specified transaction, if the lock was sucessfully acquired. Otherwise
47:             * it returns NOT_ACQUIRED.
48:             * 
49:             * 
50:             * @return The previous level for the given transaction or NOT_ACQUIRED.
51:             */
52:            public int tryAcquire(Transaction ta, int level);
53:
54:            /**
55:             * Release the previously aquired lock.
56:             */
57:            public void release(Transaction ta);
58:
59:            public boolean isAcquiredBy(Transaction ta);
60:
61:            /**
62:             * Return all transactions that currently hold this lock.
63:             */
64:            public DxCollection lockerIDs();
65:
66:            /**
67:             * Returns the lock level for the specified transaction. If ta is null,
68:             * then we do not check ta against the transaction that has acquired this
69:             * lock.
70:             * 
71:             * 
72:             * @param ta The transaction that has acquired the lock or null.
73:             * @return Lock level for ta if ta has aquired the lock or ta is null. LEVEL_NONE
74:             * otherwise.
75:             */
76:            public int level(Transaction ta);
77:
78:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.