Source Code Cross Referenced for AbstractWriteRequest.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » controller » requests » 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 » sequoia 2.10.9 » org.continuent.sequoia.controller.requests 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Sequoia: Database clustering technology.
003:         * Copyright (C) 2002-2004 French National Institute For Research In Computer
004:         * Science And Control (INRIA).
005:         * Contact: sequoia@continuent.org
006:         * 
007:         * Licensed under the Apache License, Version 2.0 (the "License");
008:         * you may not use this file except in compliance with the License.
009:         * You may obtain a copy of the License at
010:         * 
011:         * http://www.apache.org/licenses/LICENSE-2.0
012:         * 
013:         * Unless required by applicable law or agreed to in writing, software
014:         * distributed under the License is distributed on an "AS IS" BASIS,
015:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016:         * See the License for the specific language governing permissions and
017:         * limitations under the License. 
018:         *
019:         * Initial developer(s): Emmanuel Cecchet.
020:         * Contributor(s): ______________________________________.
021:         */package org.continuent.sequoia.controller.requests;
022:
023:        import java.util.ArrayList;
024:
025:        import org.continuent.sequoia.common.i18n.Translate;
026:
027:        /**
028:         * <code>AbstractWriteRequest</code> is the super-class of all requests which
029:         * do NOT return any ResultSet. They do have side-effects (else what would they
030:         * useful for?!)
031:         * 
032:         * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
033:         * @version 1.0
034:         */
035:        public abstract class AbstractWriteRequest extends AbstractRequest {
036:            /** Name of the table involved in this write query. */
037:            protected transient String tableName;
038:
039:            /**
040:             * <code>ArrayList</code> of <code>TableColumn</code> involved in this
041:             * write query.
042:             */
043:            protected transient ArrayList columns;
044:
045:            /** <code>true</code> if this request might block. */
046:            protected transient boolean blocking = true;
047:
048:            /** Primary key value */
049:            protected transient String pkValue = null;
050:
051:            /**
052:             * True if the request requires to take a global lock.
053:             */
054:            protected boolean requiresGlobalLock = false;
055:
056:            /**
057:             * Creates a new <code>AbstractWriteRequest</code> object
058:             * 
059:             * @param sqlQuery the SQL query
060:             * @param escapeProcessing should the driver to escape processing before
061:             *          sending to the database ?
062:             * @param timeout an <code>int</code> value
063:             * @param lineSeparator the line separator used in the query
064:             * @param requestType the request type as defined in RequestType class
065:             * @see RequestType
066:             */
067:            public AbstractWriteRequest(String sqlQuery,
068:                    boolean escapeProcessing, int timeout,
069:                    String lineSeparator, int requestType) {
070:                super (sqlQuery, escapeProcessing, timeout, lineSeparator,
071:                        requestType);
072:            }
073:
074:            /**
075:             * Clones table name and columns from an already parsed request.
076:             * 
077:             * @param abstractWriteRequest the already parsed request
078:             */
079:            protected void cloneTableNameAndColumns(
080:                    AbstractWriteRequest abstractWriteRequest) {
081:                tableName = abstractWriteRequest.getTableName();
082:                columns = abstractWriteRequest.getColumns();
083:                pkValue = abstractWriteRequest.getPk();
084:                cacheable = abstractWriteRequest.getCacheAbility();
085:                writeLockedTables = abstractWriteRequest
086:                        .getWriteLockedDatabaseTables();
087:            }
088:
089:            /**
090:             * Returns an <code>ArrayList</code> of <code>TableColumn</code> objects
091:             * representing the columns affected by this statement.
092:             * 
093:             * @return an <code>ArrayList</code> value
094:             */
095:            public ArrayList getColumns() {
096:                return columns;
097:            }
098:
099:            /**
100:             * @return Returns the pk.
101:             */
102:            public String getPk() {
103:                return pkValue;
104:            }
105:
106:            /**
107:             * Returns the name of the table affected by this statement.
108:             * 
109:             * @return a <code>String</code> value
110:             */
111:            public String getTableName() {
112:                return tableName;
113:            }
114:
115:            /**
116:             * Tests if this request might block.
117:             * 
118:             * @return <code>true</code> if this request might block
119:             */
120:            public boolean mightBlock() {
121:                return blocking;
122:            }
123:
124:            /**
125:             * Sets if this request might block.
126:             * 
127:             * @param blocking a <code>boolean</code> value
128:             */
129:            public void setBlocking(boolean blocking) {
130:                this .blocking = blocking;
131:            }
132:
133:            /**
134:             * @see org.continuent.sequoia.controller.requests.AbstractRequest#getParsingResultsAsString()
135:             */
136:            public String getParsingResultsAsString() {
137:                StringBuffer sb = new StringBuffer(super 
138:                        .getParsingResultsAsString());
139:                sb.append(Translate.get("request.table.involved", tableName));
140:                if (columns != null && columns.size() > 0) {
141:                    sb.append(Translate.get("request.table.column"));
142:                    for (int i = 0; i < columns.size(); i++) {
143:                        sb.append(Translate.get("request.table.column", columns
144:                                .get(i)));
145:                    }
146:                }
147:                sb.append(Translate.get("request.blocking", blocking));
148:                sb.append(Translate.get("request.primary.key", pkValue));
149:                return sb.toString();
150:            }
151:
152:            /**
153:             * Return true if the query requires a global locking.
154:             * 
155:             * @return the requiresGlobalLock value.
156:             */
157:            public boolean requiresGlobalLock() {
158:                return requiresGlobalLock;
159:            }
160:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.