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


001:        /*
002:         * Copyright 2002 Sun Microsystems, Inc. All 
003:         * rights reserved. Use of this product is subject 
004:         * to license terms. Federal Acquisitions: 
005:         * Commercial Software -- Government Users 
006:         * Subject to Standard License Terms and 
007:         * Conditions. 
008:         * 
009:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE 
010:         * are trademarks or registered trademarks of Sun Microsystems, 
011:         * Inc. in the United States and other countries. 
012:         */
013:
014:        package com.sun.portal.providers.context;
015:
016:        import com.sun.portal.log.common.PortalLogger;
017:
018:        import java.util.Map;
019:        import java.util.HashMap;
020:        import java.util.logging.Logger;
021:        import java.util.logging.Level;
022:
023:        public class PropertiesFilterFactory {
024:
025:            public static final String LOCALE_PROPERTIESFILTER_CLASSNAME = "com.sun.portal.providers.context.LocalePropertiesFilter";
026:            public static final String CLIENT_PROPERTIESFILTER_CLASSNAME = "com.sun.portal.providers.context.ClientPropertiesFilter";
027:            //
028:            // CACHING IS DISABLED FOR NOW
029:            //
030:            //private static Map pfTable = new HashMap();
031:            private static Logger logger = PortalLogger
032:                    .getLogger(PropertiesFilterFactory.class);
033:
034:            /**
035:             * Get an instance of optional PropertiesFilter.  The filter class is
036:             * dynamically loaded and initialized with the value specified.
037:             * Note that this creates an optional (non-required) filter.
038:             *
039:             * @param className The class name of the PropertiesFilter object
040:             *                  to be dynamically loaded and instantiated.
041:             * @param value The value that gets associated with the filter.
042:             * @return an optional PropertiesFilter object that has been initialized
043:             * with the value specified.
044:             * @exception PropertiesFilterException if there was an error in
045:             * instantiating the PropertiesFilter.
046:             *
047:             * @see PropertiesFilter
048:             */
049:            public static PropertiesFilter get(String className, String value)
050:                    throws PropertiesFilterException {
051:
052:                return get(className, value, false);
053:            }
054:
055:            /**
056:             * Get an instance of PropertiesFilter.  The filter class is dynamically
057:             * loaded and initialized with the value and the required flag specified.
058:             *
059:             * @param className The class name of the PropertiesFilter object
060:             *                  to instantiate.
061:             * @param value The value that gets associated with the filter.
062:             * @param required Flag indicating whether this filter criteria
063:             *                 is required or optional.
064:             * @return a PropertiesFilter object that has been initialized
065:             * with the value.
066:             * @exception PropertiesFilterException if there was an error in
067:             * instantiating the PropertiesFilter.
068:             *
069:             * @see PropertiesFilter
070:             */
071:            public static PropertiesFilter get(String className, String value,
072:                    boolean required) throws PropertiesFilterException {
073:
074:                //
075:                // CACHING IS DISABLED FOR NOW
076:                //
077:                //return getCached(className, value, required);
078:
079:                PropertiesFilter pf = null;
080:
081:                try {
082:                    pf = (PropertiesFilter) Class.forName(className)
083:                            .newInstance();
084:                } catch (ClassNotFoundException cnfe) {
085:                    logger.log(Level.WARNING, "PSDT_CSPPCT0003", cnfe);
086:                    throw new PropertiesFilterException(
087:                            "PropertiesFilterFactory.getPropertiesFilter(): ",
088:                            cnfe);
089:                } catch (InstantiationException ie) {
090:                    logger.log(Level.WARNING, "PSDT_CSPPCT0003", ie);
091:                    throw new PropertiesFilterException(
092:                            "PropertiesFilterFactory.getPropertiesFilter(): ",
093:                            ie);
094:                } catch (IllegalAccessException iae) {
095:                    logger.log(Level.WARNING, "PSDT_CSPPCT0003", iae);
096:                    throw new PropertiesFilterException(
097:                            "PropertiesFilterFactory.getPropertiesFilter(): ",
098:                            iae);
099:                }
100:
101:                pf.init(value, required);
102:
103:                return pf;
104:            }
105:
106:            /**
107:             * CACHING iS DISABLED FOR NOW
108:             *
109:            protected static PropertiesFilter getCached(String className, String value,
110:                                                        boolean required) 
111:                throws PropertiesFilterException {
112:                
113:                Map perPF = (Map)pfTable.get(className);
114:                Map perValue = null;
115:                Boolean e = required ? Boolean.TRUE : Boolean.FALSE;
116:                PropertiesFilter pf = null;
117:                if (perPF != null) {
118:                    perValue = (Map)perPF.get(value);
119:                    if (perValue != null) {
120:                         pf = (PropertiesFilter)perValue.get(e);
121:                         //com.sun.portal.desktop.context.DesktopContextThreadLocalizer.get().debugError("PropertiesFilterFactory.getPropertiesFilter(): got from cache. pf=" + pf);
122:                    }
123:                }
124:
125:                if (pf == null) {
126:                    try {
127:                        pf = (PropertiesFilter)Class.forName(className).newInstance();
128:                    } catch (ClassNotFoundException cnfe) {
129:                        throw new PropertiesFilterException("PropertiesFilterFactory.getPropertiesFilter(): ", cnfe);
130:                    } catch (InstantiationException ie) {
131:                        throw new PropertiesFilterException("PropertiesFilterFactory.getPropertiesFilter(): ", ie);
132:                    } catch (IllegalAccessException iae) {
133:                        throw new PropertiesFilterException("PropertiesFilterFactory.getPropertiesFilter(): ", iae);
134:                    }
135:                    
136:                    ((BasePropertiesFilter)pf).init(value, required);
137:
138:                    if (pf.isCachable()) {
139:                        if (perPF == null) {
140:                            perPF = new HashMap();
141:                            pfTable.put(className, perPF);
142:                        }
143:                        if (perValue == null) {
144:                            perValue = new HashMap();
145:                            perPF.put(value, perValue);
146:                        }
147:                        perValue.put(e, pf);    
148:
149:                        //com.sun.portal.desktop.context.DesktopContextThreadLocalizer.get().debugError("PropertiesFilterFactory.getPropertiesFilter(): putting filter=" + className + ", value=" + value + ", required=" + e + ", cache=" + pfTable);
150:                    }
151:                        
152:                }
153:
154:                return pf;
155:            }
156:             */
157:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.