Source Code Cross Referenced for SystemConfigurationFactory.java in  » ESB » open-esb » com » sun » jbi » management » config » 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.jbi.management.config 
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:         * @(#)SystemConfigurationFactory.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        package com.sun.jbi.management.config;
030:
031:        import com.sun.jbi.management.ConfigurationCategory;
032:        import com.sun.jbi.management.LocalStringKeys;
033:
034:        import java.util.Properties;
035:
036:        import javax.management.Descriptor;
037:        import javax.management.modelmbean.ModelMBeanAttributeInfo;
038:
039:        /**
040:         * SystemConfigurationFactory defines the common JBI runtime configuration parameters.
041:         * Any new parameters would require updates to this class.
042:         * 
043:         * @author Sun Microsystems, Inc.
044:         */
045:        public class SystemConfigurationFactory extends ConfigurationFactory {
046:            /** Attribute Names */
047:            public static final String JBI_HOME = "jbiHome";
048:            public static final String DEFAULT_LOG_LEVEL = "defaultLogLevel";
049:            public static final String HEART_BEAT_INTERVAL = "heartBeatInterval";
050:            public static final String MSG_SVC_STATS_ENABLED = "msgSvcTimingStatisticsEnabled";
051:
052:            private static final int sNumAttributes = 4;
053:
054:            /**
055:             * Constructor 
056:             *
057:             * @param defProps - default properties
058:             */
059:            public SystemConfigurationFactory(Properties defProps) {
060:                super (defProps, ConfigurationCategory.System);
061:            }
062:
063:            /**
064:             *
065:             */
066:            public ModelMBeanAttributeInfo[] createMBeanAttributeInfo() {
067:                ModelMBeanAttributeInfo[] attributeInfos = new ModelMBeanAttributeInfo[sNumAttributes];
068:                DescriptorSupport descr;
069:                String attrDescr;
070:
071:                // -- JBI Home
072:                descr = new DescriptorSupport();
073:                attrDescr = getString(LocalStringKeys.JBI_HOME_DESCR);
074:                descr.setAttributeName(JBI_HOME);
075:                descr
076:                        .setDisplayName(getString(LocalStringKeys.JBI_HOME_DISPLAY_NAME));
077:                descr
078:                        .setDisplayNameId(getToken(LocalStringKeys.JBI_HOME_DISPLAY_NAME));
079:                descr
080:                        .setDescriptionId(getToken(LocalStringKeys.JBI_HOME_DESCR));
081:                descr.setToolTip(getString(LocalStringKeys.JBI_HOME_TOOLTIP));
082:                descr.setToolTipId(getToken(LocalStringKeys.JBI_HOME_TOOLTIP));
083:                descr.setResourceBundleName("com.sun.jbi.management");
084:                descr.setIsStatic(true);
085:                descr.setIsPassword(false);
086:                descr.setDefault(getJbiHome());
087:
088:                attributeInfos[0] = new ModelMBeanAttributeInfo(
089:                        // name                type   descr      R      W    isIs  Descriptor      
090:                        JBI_HOME, "java.lang.String", attrDescr, true, false,
091:                        false, descr);
092:
093:                // -- Default Log Level
094:                descr = new DescriptorSupport();
095:                attrDescr = getString(LocalStringKeys.DEFAULT_LOG_LEVEL_DESCR);
096:                descr.setAttributeName(DEFAULT_LOG_LEVEL);
097:                descr
098:                        .setDisplayName(getString(LocalStringKeys.DEFAULT_LOG_LEVEL_DISPLAY_NAME));
099:                descr
100:                        .setDisplayNameId(getToken(LocalStringKeys.DEFAULT_LOG_LEVEL_DISPLAY_NAME));
101:                descr
102:                        .setDescriptionId(getToken(LocalStringKeys.DEFAULT_LOG_LEVEL_DESCR));
103:                descr
104:                        .setToolTip(getString(LocalStringKeys.DEFAULT_LOG_LEVEL_TOOLTIP));
105:                descr
106:                        .setToolTipId(getToken(LocalStringKeys.DEFAULT_LOG_LEVEL_TOOLTIP));
107:                descr.setResourceBundleName("com.sun.jbi.management");
108:                descr.setIsStatic(false);
109:                descr.setIsPassword(false);
110:                descr.setDefault(getDefaultLogLevel());
111:                descr
112:                        .setEnumValue("{SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST}");
113:
114:                attributeInfos[1] = new ModelMBeanAttributeInfo(
115:                        // name             type               descr      R      W    isIs  Descriptor      
116:                        DEFAULT_LOG_LEVEL, "java.lang.String", attrDescr, true,
117:                        false, false, descr);
118:
119:                // Heart Beat
120:                descr = new DescriptorSupport();
121:                attrDescr = getString(LocalStringKeys.HEART_BEAT_INTERVAL_DESCR);
122:                descr.setAttributeName(HEART_BEAT_INTERVAL);
123:                descr
124:                        .setDisplayName(getString(LocalStringKeys.HEART_BEAT_INTERVAL_DISPLAY_NAME));
125:                descr
126:                        .setDisplayNameId(getToken(LocalStringKeys.HEART_BEAT_INTERVAL_DISPLAY_NAME));
127:                descr
128:                        .setDescriptionId(getToken(LocalStringKeys.HEART_BEAT_INTERVAL_DESCR));
129:                descr
130:                        .setToolTip(getString(LocalStringKeys.HEART_BEAT_INTERVAL_TOOLTIP));
131:                descr
132:                        .setToolTipId(getToken(LocalStringKeys.HEART_BEAT_INTERVAL_TOOLTIP));
133:                descr.setResourceBundleName("com.sun.jbi.management");
134:                descr.setIsStatic(false);
135:                descr.setIsPassword(false);
136:                String defHeartBeat = mDefaults.getProperty(
137:                        getQualifiedKey(HEART_BEAT_INTERVAL), "5500");
138:                descr.setDefault(Integer.parseInt(defHeartBeat));
139:                descr.setMinValue(1000);
140:                descr.setMaxValue(Integer.MAX_VALUE);
141:                descr.setUnit("milliseconds");
142:
143:                attributeInfos[2] = new ModelMBeanAttributeInfo(
144:                        // name               type  descr      R      W    isIs  Descriptor      
145:                        HEART_BEAT_INTERVAL, "int", attrDescr, true, true,
146:                        false, descr);
147:
148:                // Message Service Timing Statistics
149:                descr = new DescriptorSupport();
150:                attrDescr = getString(LocalStringKeys.MSG_SVC_STATS_ENABLED_DESCR);
151:                descr.setAttributeName(MSG_SVC_STATS_ENABLED);
152:                descr
153:                        .setDisplayName(getString(LocalStringKeys.MSG_SVC_STATS_ENABLED_DISPLAY_NAME));
154:                descr
155:                        .setDisplayNameId(getToken(LocalStringKeys.MSG_SVC_STATS_ENABLED_DISPLAY_NAME));
156:                descr
157:                        .setDescriptionId(getToken(LocalStringKeys.MSG_SVC_STATS_ENABLED_DESCR));
158:                descr
159:                        .setToolTip(getString(LocalStringKeys.MSG_SVC_STATS_ENABLED_TOOLTIP));
160:                descr
161:                        .setToolTipId(getToken(LocalStringKeys.MSG_SVC_STATS_ENABLED_TOOLTIP));
162:                descr.setResourceBundleName("com.sun.jbi.management");
163:                descr.setIsStatic(false);
164:                descr.setIsPassword(false);
165:                String defMsgSvcStatsEnabled = mDefaults.getProperty(
166:                        getQualifiedKey(MSG_SVC_STATS_ENABLED), "false");
167:                descr.setDefault(Boolean.parseBoolean(defMsgSvcStatsEnabled));
168:
169:                attributeInfos[3] = new ModelMBeanAttributeInfo(
170:                        // name                type       descr      R      W    isIs  Descriptor      
171:                        MSG_SVC_STATS_ENABLED, "boolean", attrDescr, true,
172:                        true, true, descr);
173:
174:                return attributeInfos;
175:            }
176:
177:            /*--------------------------------------------------------------------------------*\
178:             *                         private helpers                                        *
179:            \*--------------------------------------------------------------------------------*/
180:
181:            /**
182:             * @return the abosolute path to the JBI Home directory
183:             */
184:            private String getJbiHome() {
185:                com.sun.jbi.EnvironmentContext envCtx = com.sun.jbi.util.EnvironmentAccess
186:                        .getContext();
187:                return envCtx.getJbiInstallRoot();
188:            }
189:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.