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


001:        /**
002:         * Sequoia: Database clustering technology.
003:         * Copyright (C) 2005 Emic Networks.
004:         * Contact: sequoia@continuent.org
005:         * 
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         * 
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         * 
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License. 
017:         *
018:         * Initial developer(s): Jeff Mesnil.
019:         * Contributor(s): ______________________.
020:         */package org.continuent.sequoia.controller.management;
021:
022:        import java.io.IOException;
023:        import java.rmi.RemoteException;
024:        import java.util.List;
025:
026:        import javax.management.NotCompliantMBeanException;
027:
028:        import org.continuent.sequoia.common.exceptions.ControllerException;
029:        import org.continuent.sequoia.common.i18n.Translate;
030:        import org.continuent.sequoia.common.jmx.mbeans.ControllerMBean;
031:        import org.continuent.sequoia.common.log.Trace;
032:        import org.continuent.sequoia.controller.core.ControllerConstants;
033:        import org.continuent.sequoia.controller.jmx.AbstractStandardMBean;
034:
035:        /**
036:         * This class defines the management interface of a Controller
037:         * 
038:         * @author <a href="mailto:jeff@emicnetworks.com">Jeff Mesnil</a>
039:         * @version 1.0
040:         */
041:        public class Controller extends AbstractStandardMBean implements 
042:                ControllerMBean {
043:
044:            private org.continuent.sequoia.controller.core.Controller controller;
045:            static Trace endUserLogger = Trace
046:                    .getLogger("org.continuent.sequoia.enduser");
047:
048:            /**
049:             * Creates a new <code>Controller</code> object based on a
050:             * <code>managedController</code>
051:             * 
052:             * @param managedController the controller to manage
053:             * @throws NotCompliantMBeanException if this instance is not a compliant
054:             *           MBean
055:             */
056:            public Controller(
057:                    org.continuent.sequoia.controller.core.Controller managedController)
058:                    throws NotCompliantMBeanException {
059:                super (ControllerMBean.class);
060:                this .controller = managedController;
061:            }
062:
063:            /**
064:             * @see org.continuent.sequoia.controller.jmx.AbstractStandardMBean#getAssociatedString()
065:             */
066:            public String getAssociatedString() {
067:                return "controller"; //$NON-NLS-1$
068:            }
069:
070:            /**
071:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#addVirtualDatabases(java.lang.String)
072:             */
073:            public void addVirtualDatabases(String xml)
074:                    throws ControllerException {
075:                try {
076:                    endUserLogger.info(Translate
077:                            .get("controller.add.virtualdatabases"));
078:                    controller.addVirtualDatabases(xml);
079:                    endUserLogger.info(Translate
080:                            .get("controller.virtualdatabases.added"));
081:                } catch (ControllerException ex) {
082:                    endUserLogger.error(ex.getMessage());
083:                    throw ex;
084:                }
085:            }
086:
087:            /**
088:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#initializeVirtualDatabases(java.lang.String, boolean)
089:             */
090:            public void addVirtualDatabases(String vdbXmlSpec, boolean force)
091:                    throws ControllerException {
092:                if (!force) {
093:                    addVirtualDatabases(vdbXmlSpec);
094:                    return;
095:                }
096:
097:                try {
098:                    endUserLogger.info(Translate
099:                            .get("controller.add.virtualdatabases")
100:                            + " (force)");
101:                    controller.addVirtualDatabases(vdbXmlSpec, null,
102:                            ControllerConstants.AUTO_ENABLE_FORCE_LOAD, null);
103:                    endUserLogger.info(Translate
104:                            .get("controller.virtualdatabases.added")
105:                            + " (force)");
106:                } catch (ControllerException ex) {
107:                    endUserLogger.error(ex.getMessage());
108:                    throw ex;
109:                }
110:            }
111:
112:            /**
113:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#initializeVirtualDatabases(java.lang.String)
114:             */
115:            public void initializeVirtualDatabases(String vdbXmlSpec)
116:                    throws ControllerException {
117:                try {
118:                    endUserLogger.info(Translate
119:                            .get("controller.add.virtualdatabases")
120:                            + " (init)");
121:                    controller.addVirtualDatabases(vdbXmlSpec, null,
122:                            ControllerConstants.AUTO_ENABLE_INIT, null);
123:                    endUserLogger.info(Translate
124:                            .get("controller.virtualdatabases.added")
125:                            + " (init)");
126:                } catch (ControllerException ex) {
127:                    endUserLogger.error(ex.getMessage());
128:                    throw ex;
129:                }
130:            }
131:
132:            /**
133:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#getVirtualDatabaseNames()
134:             */
135:            public List getVirtualDatabaseNames() {
136:                return controller.getVirtualDatabaseNames();
137:            }
138:
139:            /**
140:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#addDriver(byte[])
141:             */
142:            public void addDriver(byte[] bytes) throws Exception {
143:                try {
144:                    controller.addDriver(bytes);
145:                } catch (ControllerException e) {
146:                    throw e;
147:                }
148:            }
149:
150:            /**
151:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#saveConfiguration()
152:             */
153:            public String saveConfiguration() throws Exception {
154:                String msg = controller.saveConfiguration();
155:                endUserLogger.info(msg);
156:                return msg;
157:            }
158:
159:            /**
160:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#shutdown()
161:             */
162:            public void shutdown() throws ControllerException {
163:                try {
164:                    endUserLogger.info(Translate.get("controller.shutdown",
165:                            this .getControllerName()));
166:                    controller.shutdown();
167:                    endUserLogger.info(Translate.get(
168:                            "controller.shutdown.completed", this 
169:                                    .getControllerName()));
170:                } catch (ControllerException ex) {
171:                    endUserLogger.error(ex.getMessage());
172:                    throw ex;
173:                }
174:            }
175:
176:            /**
177:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#getBacklogSize()
178:             */
179:            public int getBacklogSize() {
180:                return controller.getBacklogSize();
181:            }
182:
183:            /**
184:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#getControllerName()
185:             */
186:            public String getControllerName() {
187:                return controller.getControllerName();
188:            }
189:
190:            /**
191:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#getJmxName()
192:             */
193:            public String getJmxName() {
194:                return controller.getJmxName();
195:            }
196:
197:            /**
198:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#getPortNumber()
199:             */
200:            public int getPortNumber() {
201:                return controller.getPortNumber();
202:            }
203:
204:            /**
205:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#getVersionNumber()
206:             */
207:            public String getVersionNumber() throws RemoteException {
208:                return controller.getVersionNumber();
209:            }
210:
211:            /**
212:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#getXml()
213:             */
214:            public String getXml() {
215:                return controller.getXml();
216:            }
217:
218:            /**
219:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#isShuttingDown()
220:             */
221:            public boolean isShuttingDown() {
222:                return controller.isShuttingDown();
223:            }
224:
225:            /**
226:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#setBacklogSize(int)
227:             */
228:            public void setBacklogSize(int size) {
229:                controller.setBacklogSize(size);
230:            }
231:
232:            /**
233:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#refreshLogConfiguration()
234:             */
235:            public void refreshLogConfiguration() throws ControllerException {
236:                try {
237:                    controller.refreshLogConfiguration();
238:                    endUserLogger.info(Translate
239:                            .get("controller.refresh.log.success"));
240:                } catch (ControllerException ex) {
241:                    endUserLogger.error(ex.getMessage());
242:                    throw ex;
243:                }
244:            }
245:
246:            /**
247:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#updateLogConfigurationFile(java.lang.String)
248:             */
249:            public void updateLogConfigurationFile(String newConfiguration)
250:                    throws IOException, ControllerException {
251:                try {
252:                    controller.updateLogConfigurationFile(newConfiguration);
253:                    endUserLogger.info(Translate
254:                            .get("controller.update.log.success"));
255:                } catch (ControllerException ex) {
256:                    endUserLogger.error(ex.getMessage());
257:                    throw ex;
258:                } catch (IOException ioex) {
259:                    endUserLogger.error(ioex.getMessage());
260:                    throw ioex;
261:                }
262:            }
263:
264:            /**
265:             * @see org.continuent.sequoia.common.jmx.mbeans.ControllerMBean#viewLogConfigurationFile()
266:             */
267:            public String viewLogConfigurationFile() throws IOException {
268:                return controller.viewLogConfigurationFile();
269:            }
270:
271:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.