Source Code Cross Referenced for MapEntryCombiner.java in  » ESB » mule » org » mule » config » spring » parsers » assembly » 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 » mule » org.mule.config.spring.parsers.assembly 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: MapEntryCombiner.java 10489 2008-01-23 17:53:38Z dfeist $
003:         * --------------------------------------------------------------------------------------
004:         * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
005:         *
006:         * The software in this package is published under the terms of the CPAL v1.0
007:         * license, a copy of which has been included with this distribution in the
008:         * LICENSE.txt file.
009:         */
010:
011:        package org.mule.config.spring.parsers.assembly;
012:
013:        import java.util.Collection;
014:        import java.util.HashMap;
015:        import java.util.Map;
016:        import java.util.Set;
017:
018:        /**
019:         * This is used internally by {@link org.mule.config.spring.parsers.assembly.DefaultBeanAssembler}
020:         * along with {@link org.mule.config.spring.parsers.collection.ChildSingletonMapDefinitionParser}.
021:         * It creates a map with a single key/value pair.  This may seem odd, but the result is not
022:         * manipulated within the assembler - that means that, unlike
023:         * {@link org.mule.config.spring.parsers.collection.ChildMapEntryDefinitionParser}, this element
024:         * can contain nested values.  Note that most uses will set
025:         * {@link org.mule.config.spring.parsers.assembly.configuration.PropertyConfiguration#isCollection(String)}
026:         * so that several entries can be combined.
027:         */
028:        public class MapEntryCombiner implements  Map {
029:
030:            public static final String KEY = "key";
031:            public static final String VALUE = "value";
032:
033:            private Object key;
034:            private Object value;
035:            private Map cachedMerge = new HashMap();
036:            private boolean isMerged = false;
037:
038:            private synchronized Map getCachedMerge() {
039:                if (!isMerged) {
040:                    cachedMerge.put(key, value);
041:                    isMerged = true;
042:                }
043:                return cachedMerge;
044:            }
045:
046:            public Object getKey() {
047:                assertNotMerged();
048:                return key;
049:            }
050:
051:            public void setKey(Object key) {
052:                assertNotMerged();
053:                this .key = key;
054:            }
055:
056:            public Object getValue() {
057:                assertNotMerged();
058:                return value;
059:            }
060:
061:            public void setValue(Object value) {
062:                assertNotMerged();
063:                this .value = value;
064:            }
065:
066:            private synchronized void assertNotMerged() {
067:                if (isMerged) {
068:                    throw new IllegalStateException(
069:                            "Maps have already been merged");
070:                }
071:            }
072:
073:            // map delegates (except hashCode and equals)
074:
075:            public int size() {
076:                return getCachedMerge().size();
077:            }
078:
079:            public void clear() {
080:                getCachedMerge().clear();
081:            }
082:
083:            public boolean isEmpty() {
084:                return getCachedMerge().isEmpty();
085:            }
086:
087:            public boolean containsKey(Object key) {
088:                return getCachedMerge().containsKey(key);
089:            }
090:
091:            public boolean containsValue(Object value) {
092:                return getCachedMerge().containsValue(value);
093:            }
094:
095:            public Collection values() {
096:                return getCachedMerge().values();
097:            }
098:
099:            public void putAll(Map t) {
100:                getCachedMerge().putAll(t);
101:            }
102:
103:            public Set entrySet() {
104:                return getCachedMerge().entrySet();
105:            }
106:
107:            public Set keySet() {
108:                return getCachedMerge().keySet();
109:            }
110:
111:            public Object get(Object key) {
112:                return getCachedMerge().get(key);
113:            }
114:
115:            public Object remove(Object key) {
116:                return getCachedMerge().remove(key);
117:            }
118:
119:            public Object put(Object key, Object value) {
120:                return getCachedMerge().put(key, value);
121:            }
122:
123:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.