Source Code Cross Referenced for StandardDSOSpringConfigHelper.java in  » Net » Terracotta » com » tc » object » 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 » Net » Terracotta » com.tc.object.config 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice.  All rights reserved.
003:         */
004:        package com.tc.object.config;
005:
006:        import java.util.ArrayList;
007:        import java.util.HashMap;
008:        import java.util.HashSet;
009:        import java.util.Iterator;
010:        import java.util.List;
011:        import java.util.Map;
012:        import java.util.Set;
013:
014:        public class StandardDSOSpringConfigHelper implements 
015:                DSOSpringConfigHelper {
016:            private String rootName;
017:            private boolean locationInfoEnabled = false;
018:            private boolean fastProxyEnabled = false;
019:
020:            private final List applicationNamePatterns = new ArrayList();
021:            private final List configPatterns = new ArrayList();
022:            private final List distributedEvents = new ArrayList();
023:
024:            public boolean isLocationInfoEnabled() {
025:                return locationInfoEnabled;
026:            }
027:
028:            public String getRootName() {
029:                return rootName;
030:            }
031:
032:            public void setRootName(String rootName) {
033:                this .rootName = rootName;
034:            }
035:
036:            public void setLocationInfoEnabled(boolean locationInfoEnabled) {
037:                this .locationInfoEnabled = locationInfoEnabled;
038:            }
039:
040:            /**
041:             * Map of <code>String</code> bean name to <code>Set</code> of the excluded fields.
042:             */
043:            private final Map beans = new HashMap();
044:
045:            public boolean isMatchingApplication(String applicationName) {
046:                for (Iterator it = applicationNamePatterns.iterator(); it
047:                        .hasNext();) {
048:                    if (isMatching((String) it.next(), applicationName)) {
049:                        return true;
050:                    }
051:                }
052:                return false;
053:            }
054:
055:            public boolean isMatchingConfig(String configPath) {
056:                for (Iterator it = configPatterns.iterator(); it.hasNext();) {
057:                    if (isMatching((String) it.next(), configPath)) {
058:                        return true;
059:                    }
060:                }
061:                return false;
062:            }
063:
064:            protected boolean isMatching(String pattern, String s) {
065:                if ("*".equals(pattern)) {
066:                    return true;
067:                } else if (s == null) {
068:                    return false;
069:                } else if (pattern.startsWith("*")) {
070:                    if (pattern.endsWith("*")) {
071:                        return s.indexOf(pattern.substring(1,
072:                                pattern.length() - 1)) > -1;
073:                    } else {
074:                        return s.endsWith(pattern.substring(1));
075:                    }
076:                } else if (pattern.endsWith("*")) {
077:                    return s.startsWith(pattern.substring(0,
078:                            pattern.length() - 1));
079:                }
080:                return pattern.equals(s);
081:            }
082:
083:            public boolean isDistributedEvent(String className) {
084:                for (Iterator it = distributedEvents.iterator(); it.hasNext();) {
085:                    String expression = (String) it.next();
086:                    if (isMatching(expression, className)) {
087:                        return true;
088:                    }
089:                }
090:                return false;
091:            }
092:
093:            public boolean isDistributedBean(String beanName) {
094:                return this .beans.containsKey(beanName);
095:            }
096:
097:            public boolean isDistributedField(String beanName, String fieldName) {
098:                Set excludedFields = (Set) this .beans.get(beanName);
099:                return excludedFields == null
100:                        || !excludedFields.contains(fieldName);
101:            }
102:
103:            public List getDistributedEvents() {
104:                return distributedEvents;
105:            }
106:
107:            public Map getDistributedBeans() {
108:                return this .beans;
109:            }
110:
111:            public void addApplicationNamePattern(String pattern) {
112:                this .applicationNamePatterns.add(pattern);
113:            }
114:
115:            public void addConfigPattern(String pattern) {
116:                this .configPatterns.add(pattern);
117:            }
118:
119:            public void addDistributedEvent(String expression) {
120:                distributedEvents.add(expression);
121:            }
122:
123:            public void addBean(String beanName) {
124:                this .beans.put(beanName, new HashSet());
125:            }
126:
127:            public void excludeField(String beanName, String fieldName) {
128:                Set excludedFields = (Set) this .beans.get(beanName);
129:                if (excludedFields == null) {
130:                    excludedFields = new HashSet();
131:                    this .beans.put(beanName, excludedFields);
132:                }
133:                excludedFields.add(fieldName);
134:            }
135:
136:            public boolean isFastProxyEnabled() {
137:                return fastProxyEnabled;
138:            }
139:
140:            public void setFastProxyEnabled(boolean fastProxyEnabled) {
141:                this.fastProxyEnabled = fastProxyEnabled;
142:            }
143:
144:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.