Source Code Cross Referenced for ManagementClient.java in  » ESB » open-esb » com » sun » esb » management » client » 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 » ESB » open esb » com.sun.esb.management.client 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * BEGIN_HEADER - DO NOT EDIT
003:         *
004:         * The contents of this file are subject to the terms
005:         * of the Common Development and Distribution License
006:         * (the "License").  You may not use this file except
007:         * in compliance with the License.
008:         *
009:         * You can obtain a copy of the license at
010:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011:         * See the License for the specific language governing
012:         * permissions and limitations under the License.
013:         *
014:         * When distributing Covered Code, include this CDDL
015:         * HEADER in each file and include the License file at
016:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017:         * If applicable add the following below this CDDL HEADER,
018:         * with the fields enclosed by brackets "[]" replaced with
019:         * your own identifying information: Portions Copyright
020:         * [year] [name of copyright owner]
021:         */
022:
023:        /*
024:         * @(#)ManagementClient.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        package com.sun.esb.management.client;
030:
031:        import java.io.Serializable;
032:
033:        import javax.management.MBeanServerConnection;
034:
035:        import com.sun.esb.management.api.administration.AdministrationService;
036:        import com.sun.esb.management.api.configuration.ConfigurationService;
037:        import com.sun.esb.management.api.deployment.DeploymentService;
038:        import com.sun.esb.management.api.installation.InstallationService;
039:        import com.sun.esb.management.api.notification.NotificationService;
040:        import com.sun.esb.management.api.performance.PerformanceMeasurementService;
041:        import com.sun.esb.management.api.runtime.RuntimeManagementService;
042:        import com.sun.esb.management.common.ImplementationMap;
043:        import com.sun.esb.management.common.ManagementRemoteException;
044:        import com.sun.esb.management.common.Service;
045:        import com.sun.esb.management.impl.administration.AdministrationServiceImpl;
046:        import com.sun.esb.management.impl.configuration.ConfigurationServiceImpl;
047:        import com.sun.esb.management.impl.deployment.DeploymentServiceImpl;
048:        import com.sun.esb.management.impl.installation.InstallationServiceImpl;
049:        import com.sun.esb.management.impl.notification.NotificationServiceImpl;
050:        import com.sun.esb.management.impl.performance.PerformanceMeasurementServiceImpl;
051:        import com.sun.esb.management.impl.runtime.RuntimeManagementServiceImpl;
052:        import com.sun.jbi.ui.common.I18NBundle;
053:
054:        /**
055:         * Retrieves the various services associated with JBI Management and Monitoring
056:         * administration commands.
057:         * 
058:         * @author graj
059:         */
060:        public class ManagementClient implements  Serializable {
061:
062:            /** i18n */
063:            private static I18NBundle I18NBUNDLE = null;
064:
065:            static final long serialVersionUID = -1L;
066:
067:            /**
068:             * gives the I18N bundle
069:             * 
070:             * @return I18NBundle object
071:             */
072:            protected static I18NBundle getI18NBundle() {
073:                // lazzy initialize the Client
074:                if (I18NBUNDLE == null) {
075:                    I18NBUNDLE = new I18NBundle(
076:                            "com.sun.caps.management.client");
077:                }
078:                return I18NBUNDLE;
079:            }
080:
081:            /** is this a local or remote connection */
082:            boolean isRemoteConnection;
083:
084:            /** remote MBeanServer connection */
085:            transient MBeanServerConnection remoteConnection;
086:
087:            /** Constructor */
088:            public ManagementClient() {
089:                this (null, false);
090:            }
091:
092:            /**
093:             * Constructor
094:             * 
095:             * @param serverConnection
096:             */
097:            public ManagementClient(MBeanServerConnection serverConnection) {
098:                this (serverConnection, false);
099:            }
100:
101:            /**
102:             * Constructor
103:             * 
104:             * @param serverConnection
105:             * @param isRemoteConnection
106:             */
107:            public ManagementClient(MBeanServerConnection serverConnection,
108:                    boolean isRemoteConnection) {
109:                this .remoteConnection = serverConnection;
110:                this .isRemoteConnection = isRemoteConnection;
111:            }
112:
113:            /**
114:             * Get the Administration Service
115:             * @return Administration Service object
116:             * @throws ManagementRemoteException
117:             */
118:            public AdministrationService getAdministrationService()
119:                    throws ManagementRemoteException {
120:                return new AdministrationServiceImpl(this .remoteConnection,
121:                        this .isRemoteConnection);
122:            }
123:
124:            /**
125:             * Get the Configuration Service
126:             * @return Configuration Service object
127:             * @throws ManagementRemoteException
128:             */
129:            public ConfigurationService getConfigurationService()
130:                    throws ManagementRemoteException {
131:                return new ConfigurationServiceImpl(this .remoteConnection,
132:                        this .isRemoteConnection);
133:            }
134:
135:            /**
136:             * Get the Deployment Service
137:             * @return Deployment Service object
138:             * @throws ManagementRemoteException
139:             */
140:            public DeploymentService getDeploymentService()
141:                    throws ManagementRemoteException {
142:                return new DeploymentServiceImpl(this .remoteConnection,
143:                        this .isRemoteConnection);
144:            }
145:
146:            /**
147:             * Get the Installation Service
148:             * @return Installation Service object
149:             * @throws ManagementRemoteException
150:             */
151:            public InstallationService getInstallationService()
152:                    throws ManagementRemoteException {
153:                return new InstallationServiceImpl(this .remoteConnection,
154:                        this .isRemoteConnection);
155:            }
156:
157:            /**
158:             * Get the Performance Measurement Service
159:             * @return Performance Measurement Service object
160:             * @throws ManagementRemoteException
161:             */
162:            public PerformanceMeasurementService getPerformanceMeasurementService()
163:                    throws ManagementRemoteException {
164:                return new PerformanceMeasurementServiceImpl(
165:                        this .remoteConnection, this .isRemoteConnection);
166:            }
167:
168:            /**
169:             * Get the Runtime Management Service
170:             * @return Runtime Management Service object
171:             * @throws ManagementRemoteException
172:             */
173:            public RuntimeManagementService getRuntimeManagementService()
174:                    throws ManagementRemoteException {
175:                return new RuntimeManagementServiceImpl(this .remoteConnection,
176:                        this .isRemoteConnection);
177:            }
178:
179:            /**
180:             * Get the Notification Service
181:             * @return Notification Service object
182:             * @throws ManagementRemoteException
183:             */
184:            public NotificationService getNotificationService()
185:                    throws ManagementRemoteException {
186:                return new NotificationServiceImpl(this .remoteConnection,
187:                        this .isRemoteConnection);
188:            }
189:
190:            /**
191:             * is this a local or remote connection
192:             * 
193:             * @return true if remote, false if local
194:             */
195:            public boolean isRemoteConnection() {
196:                return this .isRemoteConnection;
197:            }
198:
199:            /**
200:             * Get the generic service
201:             *  
202:             * @param mapperClass
203:             * @return <CLASS_TYPE> instance or null if the Service could not be obtained
204:             */
205:            public <CLASS_TYPE> CLASS_TYPE getService(Class<?> mapperClass) {
206:                ImplementationMap map = mapperClass
207:                        .getAnnotation(ImplementationMap.class);
208:                Class<?> implementationClass = map.implementationClass();
209:                CLASS_TYPE theObject = null;
210:                Service theService = null;
211:
212:                try {
213:                    theService = (Service) implementationClass.newInstance();
214:                    theObject = theService.<CLASS_TYPE> getService(
215:                            remoteConnection, isRemoteConnection);
216:                } catch (InstantiationException e) {
217:                } catch (IllegalAccessException e) {
218:                } catch (ManagementRemoteException e) {
219:                }
220:                return theObject;
221:            }
222:
223:            /**
224:             * Get the client API version
225:             * @param mapperClass
226:             * @return the version of the Client API
227:             */
228:            public String getClientAPIVersion(Class mapperClass) {
229:                String version = "";
230:                ImplementationMap map = (ImplementationMap) mapperClass
231:                        .getAnnotation(ImplementationMap.class);
232:                if (map != null) {
233:                    return map.clientAPIVersion();
234:                }
235:                return version;
236:            }
237:
238:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.