Source Code Cross Referenced for BackendInfo.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » common » jmx » management » 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.common.jmx.management 
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:         * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
006:         * Contact: sequoia@continuent.org
007:         * 
008:         * Licensed under the Apache License, Version 2.0 (the "License");
009:         * you may not use this file except in compliance with the License.
010:         * You may obtain a copy of the License at
011:         * 
012:         * http://www.apache.org/licenses/LICENSE-2.0
013:         * 
014:         * Unless required by applicable law or agreed to in writing, software
015:         * distributed under the License is distributed on an "AS IS" BASIS,
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:         * See the License for the specific language governing permissions and
018:         * limitations under the License. 
019:         *
020:         * Initial developer(s): Nicolas Modrzyk.
021:         * Contributor(s): Emmanuel Cecchet.
022:         */package org.continuent.sequoia.common.jmx.management;
023:
024:        import java.io.Serializable;
025:        import java.util.ArrayList;
026:        import java.util.Iterator;
027:        import java.util.List;
028:
029:        import org.continuent.sequoia.controller.backend.DatabaseBackend;
030:
031:        /**
032:         * This class defines a BackendInfo. We cannot use DatabaseBackend as a
033:         * serializable object because it is used as an MBean interface. We use this
034:         * class to share configuration information on backends between distributed
035:         * virtual database.
036:         * 
037:         * @author <a href="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
038:         * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
039:         * @version 1.0
040:         */
041:        public class BackendInfo implements  Serializable {
042:            private static final long serialVersionUID = -9143159288188992488L;
043:
044:            private String name;
045:            private String url;
046:            private String driverPath;
047:            private String driverClassName;
048:            private String virtualDatabaseName;
049:            private String connectionTestStatement;
050:            private int nbOfWorkerThreads;
051:            private int dynamicPrecision;
052:            private boolean gatherSystemTables = false;
053:            private String schemaName;
054:            private String xml;
055:
056:            /**
057:             * Creates a new <code>BackendInfo</code> object. Extract configuration
058:             * information from the original backend object
059:             * 
060:             * @param backend DatabaseBackend to extract information from
061:             */
062:            public BackendInfo(DatabaseBackend backend) {
063:                this .url = backend.getURL();
064:                this .name = backend.getName();
065:                this .driverPath = backend.getDriverPath();
066:                this .driverClassName = backend.getDriverClassName();
067:                this .virtualDatabaseName = backend.getVirtualDatabaseName();
068:                this .connectionTestStatement = backend
069:                        .getConnectionTestStatement();
070:                this .nbOfWorkerThreads = backend.getNbOfWorkerThreads();
071:                this .dynamicPrecision = backend.getDynamicPrecision();
072:                this .gatherSystemTables = backend.isGatherSystemTables();
073:                this .schemaName = backend.getSchemaName();
074:                this .xml = backend.getXml();
075:            }
076:
077:            /**
078:             * Create a corresponding DatabaseBackend object from the information stored
079:             * in this object.
080:             * 
081:             * @return a <code>DatabaseBackend</code>
082:             */
083:            public DatabaseBackend getDatabaseBackend() {
084:                return new DatabaseBackend(name, driverPath, driverClassName,
085:                        url, virtualDatabaseName, true,
086:                        connectionTestStatement, nbOfWorkerThreads);
087:            }
088:
089:            /**
090:             * Returns the xml value.
091:             * 
092:             * @return Returns the xml.
093:             */
094:            public String getXml() {
095:                return xml;
096:            }
097:
098:            /**
099:             * Returns the connectionTestStatement value.
100:             * 
101:             * @return Returns the connectionTestStatement.
102:             */
103:            public String getConnectionTestStatement() {
104:                return connectionTestStatement;
105:            }
106:
107:            /**
108:             * Returns the driverClassName value.
109:             * 
110:             * @return Returns the driverClassName.
111:             */
112:            public String getDriverClassName() {
113:                return driverClassName;
114:            }
115:
116:            /**
117:             * Returns the driverPath value.
118:             * 
119:             * @return Returns the driverPath.
120:             */
121:            public String getDriverPath() {
122:                return driverPath;
123:            }
124:
125:            /**
126:             * Returns the dynamicPrecision value.
127:             * 
128:             * @return Returns the dynamicPrecision.
129:             */
130:            public int getDynamicPrecision() {
131:                return dynamicPrecision;
132:            }
133:
134:            /**
135:             * Returns the name value.
136:             * 
137:             * @return Returns the name.
138:             */
139:            public String getName() {
140:                return name;
141:            }
142:
143:            /**
144:             * Returns the nbOfWorkerThreads value.
145:             * 
146:             * @return Returns the nbOfWorkerThreads.
147:             */
148:            public final int getNbOfWorkerThreads() {
149:                return nbOfWorkerThreads;
150:            }
151:
152:            /**
153:             * Returns the schemaName value.
154:             * 
155:             * @return Returns the schemaName.
156:             */
157:            public String getSchemaName() {
158:                return schemaName;
159:            }
160:
161:            /**
162:             * Returns the url value.
163:             * 
164:             * @return Returns the url.
165:             */
166:            public String getUrl() {
167:                return url;
168:            }
169:
170:            /**
171:             * Returns the virtualDatabaseName value.
172:             * 
173:             * @return Returns the virtualDatabaseName.
174:             */
175:            public String getVirtualDatabaseName() {
176:                return virtualDatabaseName;
177:            }
178:
179:            /**
180:             * Returns the gatherSystemTables value.
181:             * 
182:             * @return Returns the gatherSystemTables.
183:             */
184:            public boolean isGatherSystemTables() {
185:                return gatherSystemTables;
186:            }
187:
188:            /**
189:             * Set the xml information on that BackendInfo object
190:             * 
191:             * @param xml new XML to set
192:             */
193:            public void setXml(String xml) {
194:                this .xml = null;
195:            }
196:
197:            /**
198:             * Convert a <code>List&lt;BackendInfo&gt;</code> to a
199:             * <code>List&lt;DatabaseBackend&gt;</code>.
200:             * <em>The DatabaseBackends returned by this method does
201:             * to reflect the state of the backends in the cluster. To
202:             * get the "real" DatabaseBackends, use 
203:             * {@link org.continuent.sequoia.controller.virtualdatabase.VirtualDatabase#getAndCheckBackend(String, int)}.</em> 
204:             * 
205:             * @param backendInfos a <code>List</code> of <code>BackendInfo</code>
206:             * @return a <code>List</code> of <code>DatabaseBackend</code> (possibly
207:             *         empty if the list of backendInfos was <code>null</code>
208:             * @see DatabaseBackend#toBackendInfos(List)        
209:             */
210:            public static List /*<DatabaseBackend>*/toDatabaseBackends(
211:                    List /*<BackendInfo>*/backendInfos) {
212:                if (backendInfos == null) {
213:                    return new ArrayList();
214:                }
215:                // Convert BackendInfo arraylist to real DatabaseBackend objects
216:                List backends = new ArrayList(backendInfos.size());
217:                for (Iterator iter = backendInfos.iterator(); iter.hasNext();) {
218:                    BackendInfo info = (BackendInfo) iter.next();
219:                    backends.add(info.getDatabaseBackend());
220:                }
221:                return backends;
222:            }
223:
224:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.