Source Code Cross Referenced for MfwkContext.java in  » Portal » Open-Portal » com » sun » portal » desktop » mfwk » 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 » Portal » Open Portal » com.sun.portal.desktop.mfwk 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
003:         * PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
004:         */
005:        package com.sun.portal.desktop.mfwk;
006:
007:        import com.sun.mfwk.instrum.server.MfManagedElementServer;
008:        import com.sun.mfwk.instrum.server.MfManagedElementServerProperties;
009:        import java.util.Hashtable;
010:        import java.util.Properties;
011:
012:        public class MfwkContext {
013:            private Properties properties = new Properties();
014:
015:            private static final String CONTEXT_PROPERTY_PREFIX = "com.sun.portal.";
016:            private static final String CONFIG_PROPERTY_PREFIX = "com.sun.portal.desktop.";
017:
018:            public MfwkContext(Properties properties) {
019:                if (properties != null) {
020:                    this .properties = properties;
021:                }
022:            }
023:
024:            public String getContextProperty(String keySuffix,
025:                    String defaultValue) {
026:                return properties.getProperty(CONTEXT_PROPERTY_PREFIX
027:                        + keySuffix, defaultValue);
028:            }
029:
030:            public String getContextProperty(String keySuffix) {
031:                return getContextProperty(keySuffix, null);
032:            }
033:
034:            public String getConfigProperty(String keySuffix,
035:                    String defaultValue) {
036:                return properties.getProperty(CONFIG_PROPERTY_PREFIX
037:                        + keySuffix, defaultValue);
038:            }
039:
040:            public String getConfigProperty(String keySuffix) {
041:                return getConfigProperty(keySuffix, null);
042:            }
043:
044:            private void putConfigProperty(Properties configProperties,
045:                    String keySuffix) {
046:                String value = getConfigProperty(keySuffix);
047:                if ((value != null) && (value.length() > 0)) {
048:                    configProperties.setProperty(keySuffix, value);
049:                }
050:            }
051:
052:            public Properties getMeServerConfigProperties() {
053:                Properties result = new Properties();
054:
055:                String htmlAdaptorPort = getConfigProperty("html.adaptor.port",
056:                        "0");
057:                if (!htmlAdaptorPort.equals("0")) {
058:                    result.put("ENABLE_HTML_ADAPTOR", "true");
059:                    result.put("HTML_ADAPTOR_PORT", htmlAdaptorPort);
060:                }
061:
062:                putConfigProperty(
063:                        result,
064:                        MfManagedElementServerProperties.ENABLE_ME_BY_DEFAULT_KEY);
065:                putConfigProperty(
066:                        result,
067:                        MfManagedElementServerProperties.PRIVATE_CONNECTOR_SERVER_KEYSTORE_PASSWORD_KEY);
068:                putConfigProperty(
069:                        result,
070:                        MfManagedElementServerProperties.PRIVATE_CONNECTOR_SERVER_KEYSTORE_PATH_KEY);
071:                putConfigProperty(
072:                        result,
073:                        MfManagedElementServerProperties.PRIVATE_CONNECTOR_SERVER_SECURITY_MODE_KEY);
074:                putConfigProperty(
075:                        result,
076:                        MfManagedElementServerProperties.PRIVATE_CONNECTOR_SERVER_TRUSTSTORE_PASSWORD_KEY);
077:                putConfigProperty(
078:                        result,
079:                        MfManagedElementServerProperties.PRIVATE_CONNECTOR_SERVER_TRUSTSTORE_PATH_KEY);
080:                putConfigProperty(
081:                        result,
082:                        MfManagedElementServerProperties.PRIVATE_CONNECTOR_SERVER_URL_KEY);
083:                putConfigProperty(
084:                        result,
085:                        MfManagedElementServerProperties.SECURED_PRIVATE_CONNECTOR_SERVER_KEY);
086:                putConfigProperty(
087:                        result,
088:                        MfManagedElementServerProperties.SECURED_PRIVATE_DISCOVERY_KEY);
089:
090:                return result;
091:            }
092:
093:            private void putContextProperty(Hashtable context, String keySuffix) {
094:                String value = getContextProperty(keySuffix);
095:                if ((value != null) && (value.length() > 0)) {
096:                    context.put(keySuffix, value);
097:                }
098:            }
099:
100:            private static final String DOT = ".";
101:
102:            public Hashtable getMeServerContext() {
103:                Hashtable result = new Hashtable();
104:
105:                putContextProperty(result,
106:                        MfManagedElementServer.ENABLE_REMOTE_MONITORING_CTX_KEY);
107:                putContextProperty(result,
108:                        MfManagedElementServer.PRODUCT_CODE_NAME_CTX_KEY);
109:                putContextProperty(result,
110:                        MfManagedElementServer.PRODUCT_COLLECTIONID_CTX_KEY);
111:                putContextProperty(result,
112:                        MfManagedElementServer.PRODUCT_NAME_CTX_KEY);
113:
114:                // putContextProperty(result, MfManagedElementServer.PRODUCT_PREFIX_CTX_KEY);
115:                result
116:                        .put(
117:                                MfManagedElementServer.PRODUCT_PREFIX_CTX_KEY,
118:                                getConfigProperty(MfwkContext.SUFFIX_APPLICATION_SYSTEM_NAME)
119:                                        + DOT
120:                                        + getPortalID()
121:                                        + DOT
122:                                        + getInstanceID());
123:
124:                return result;
125:            }
126:
127:            public String getPortalID() {
128:                return getContextProperty("portalID");
129:            }
130:
131:            public String getInstanceID() {
132:                return getContextProperty("instanceID");
133:            }
134:
135:            public static final String SUFFIX_APPLICATION_SYSTEM_NAME = "ApplicationSystem.name";
136:            public static final String SUFFIX_APPLICATION_SYSTEM_SETTING_NAME = "ApplicationSystemSetting.name";
137:            public static final String SUFFIX_APPLICATION_SYSTEM_STATS_NAME = "ApplicationSystemStats.name";
138:            public static final String SUFFIX_DESKTOP_LOGICAL_COMPONENT_NAME = "DesktopLogicalComponent.name";
139:            public static final String SUFFIX_DESKTOP_SERVICE_ACCESS_URI_NAME = "DesktopServiceAccessURI.name";
140:            public static final String SUFFIX_DESKTOP_SERVICE_ACCESS_URI_SETTING_NAME = "DesktopServiceAccessURISetting.name";
141:            public static final String SUFFIX_DESKTOP_SERVICE_ACCESS_URI_STATS_NAME = "DesktopServiceAccessURIStats.name";
142:            public static final String SUFFIX_DESKTOP_SERVICE_NAME = "DesktopService.name";
143:            public static final String SUFFIX_DESKTOP_SERVICE_SETTING_NAME = "DesktopServiceSetting.name";
144:            public static final String SUFFIX_DESKTOP_SERVICE_STATS_NAME = "DesktopServiceStats.name";
145:            public static final String SUFFIX_PROVIDER_LOGICAL_COMPONENT_NAME = "ProviderLogicalComponent.name";
146:            public static final String SUFFIX_PROVIDER_SERVICE_NAME = "ProviderService.name";
147:            public static final String SUFFIX_PROVIDER_SERVICE_SETTING_NAME = "ProviderServiceSetting.name";
148:            public static final String SUFFIX_PROVIDER_SERVICE_STATS_NAME = "ProviderServiceStats.name";
149:            public static final String SUFFIX_THREAD_POOL_CALLER_NAME = "ThreadPoolCaller.name";
150:            public static final String SUFFIX_THREAD_POOL_CALLER_SETTING_NAME = "ThreadPoolCallerSetting.name";
151:            public static final String SUFFIX_THREAD_POOL_CALLER_STATS_NAME = "ThreadPoolCallerStats.name";
152:            public static final String SUFFIX_THREAD_POOL_GETTER_NAME = "ThreadPoolGetter.name";
153:            public static final String SUFFIX_THREAD_POOL_GETTER_SETTING_NAME = "ThreadPoolGetterSetting.name";
154:            public static final String SUFFIX_THREAD_POOL_GETTER_STATS_NAME = "ThreadPoolGetterStats.name";
155:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.