Source Code Cross Referenced for ProxyConnectionIF.java in  » Database-JDBC-Connection-Pool » proxool » org » logicalcobwebs » proxool » 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 JDBC Connection Pool » proxool » org.logicalcobwebs.proxool 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This software is released under a licence similar to the Apache Software Licence.
003:         * See org.logicalcobwebs.proxool.package.html for details.
004:         * The latest version is available at http://proxool.sourceforge.net
005:         */
006:        package org.logicalcobwebs.proxool;
007:
008:        import java.sql.Connection;
009:        import java.sql.SQLException;
010:        import java.sql.Statement;
011:
012:        /**
013:         * Contains most of the functionality that we require to manipilate the
014:         * connection. The subclass of this defines how we delegate to the
015:         * real connection.
016:
017:         * @version $Revision: 1.7 $, $Date: 2005/10/07 08:18:24 $
018:         * @author bill
019:         * @author $Author: billhorsman $ (current maintainer)
020:         * @since Proxool 0.7
021:         */
022:        public interface ProxyConnectionIF extends ConnectionInfoIF {
023:
024:            /**
025:             * Changes the status and lets the ConnectionPool know so that it
026:             * can keep count of how many connections are at each status.
027:             * This method obtains a write lock.
028:             * @param oldStatus the expected existing status. if the existing
029:             * status is not this value then no change is made and false is returned.
030:             * @param newStatus the status to change to
031:             * @return true if status changed successfully, or false if no change made
032:             * (because of unexpected existing status).
033:             */
034:            boolean setStatus(int oldStatus, int newStatus);
035:
036:            /**
037:             * Forces the new status regardless of the old state
038:             * @param newStatus the status to change to
039:             * @return true if status changed successfully, or false if no change made (should
040:             * always return true)
041:             * @see #setStatus(int, int)
042:             */
043:            boolean setStatus(int newStatus);
044:
045:            /**
046:             * Mark this connection for expiry (destruction) as soon as it stops
047:             * being active.
048:             * @param reason why we are marking this connection
049:             * @see #isMarkedForExpiry
050:             */
051:            void markForExpiry(String reason);
052:
053:            /**
054:             * Whether this connection is due for expiry
055:             * @return true if it is due for expiry
056:             * @see #markForExpiry
057:             */
058:            boolean isMarkedForExpiry();
059:
060:            /**
061:             * Why this connection is marked (for instance, if a thread has
062:             * marked it for expiry then it's nice to know why)
063:             * @return reasonForMark
064:             */
065:            String getReasonForMark();
066:
067:            /**
068:             * The real, delegate connection that we are using
069:             * @return connection
070:             */
071:            Connection getConnection();
072:
073:            /**
074:             * @return true if the status is null
075:             */
076:            boolean isNull();
077:
078:            /**
079:             * @return true if the status is available
080:             */
081:            boolean isAvailable();
082:
083:            /**
084:             * @return true if the status is active
085:             */
086:            boolean isActive();
087:
088:            /**
089:             * @return true if the status is offline
090:             */
091:            boolean isOffline();
092:
093:            /**
094:             * Really close the connection, as opposed to just putting it back
095:             * in the pool.
096:             */
097:            void reallyClose() throws SQLException;
098:
099:            /**
100:             *  @see ConnectionInfoIF#getRequester
101:             */
102:            void setRequester(String requester);
103:
104:            /**
105:             * Doesn't really close the connection, just puts it back in the pool. And tries to
106:             * reset all the methods that need resetting.
107:             * @see Connection#close
108:             */
109:            void close() throws SQLException;
110:
111:            /**
112:             * Notify that a statement has been closed and won't need closing
113:             * when the connection is returned to the poo.
114:             * @param statement the statement that has just been closed
115:             */
116:            void registerClosedStatement(Statement statement);
117:
118:            /**
119:             * Find out if the delegated connection is close. Just calling isClosed() on the
120:             * proxied connection will only indicate whether it is in the pool or not.
121:             * @return true if the connection is really closed, or if the connection is null
122:             * @throws java.sql.SQLException if anything went wrong
123:             */
124:            boolean isReallyClosed() throws SQLException;
125:
126:            ConnectionPoolDefinitionIF getDefinition();
127:
128:            /**
129:             * Get the most recent of all the {@link #getSqlCalls()}
130:             * @return the SQL (could be a batch of SQLs)
131:             */
132:            String getLastSqlCall();
133:
134:        }
135:
136:        /*
137:         Revision history:
138:         $Log: ProxyConnectionIF.java,v $
139:         Revision 1.7  2005/10/07 08:18:24  billhorsman
140:         New sqlCalls gives list of SQL calls rather than just he most recent (for when a connection makes more than one call before being returned to the pool)
141:
142:         Revision 1.6  2005/09/26 10:01:31  billhorsman
143:         Added lastSqlCall when trace is on.
144:
145:         Revision 1.5  2005/05/04 16:24:13  billhorsman
146:         include a reference to the definition so we can spot it changing.
147:
148:         Revision 1.4  2003/03/10 15:26:49  billhorsman
149:         refactoringn of concurrency stuff (and some import
150:         optimisation)
151:
152:         Revision 1.3  2003/03/03 11:11:58  billhorsman
153:         fixed licence
154:
155:         Revision 1.2  2003/02/26 16:05:53  billhorsman
156:         widespread changes caused by refactoring the way we
157:         update and redefine pool definitions.
158:
159:         Revision 1.1  2003/01/27 18:26:39  billhorsman
160:         refactoring of ProxyConnection and ProxyStatement to
161:         make it easier to write JDK 1.2 patch
162:
163:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.