Source Code Cross Referenced for PropertyScope.java in  » ESB » mule » org » mule » api » transport » 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.api.transport 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: PropertyScope.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:        package org.mule.api.transport;
011:
012:        import java.io.Serializable;
013:        import java.util.Comparator;
014:
015:        /**
016:         * A PropertyScope is used to assoaciate a message property with a lifetime. Some scopes may be very brief such as
017:         * {@link #INVOCATION} scope which only lasts until a service has been invoke or a longer running scope such as {@link #SESSION}
018:         *
019:         */
020:        public final class PropertyScope implements  Serializable {
021:            public static final String INVOCATION_NAME = "invocation";
022:            public static final String INBOUND_NAME = "inbound";
023:            public static final String OUTBOUND_NAME = "outbound";
024:            public static final String SESSION_NAME = "session";
025:            public static final String APPLICATION_NAME = "application";
026:
027:            /**
028:             * This scope is defined from the point that a Message is created until a service has processed the
029:             * message. Properties set on endpoints will be found in this scope
030:             */
031:            public static final PropertyScope INVOCATION = new PropertyScope(
032:                    INVOCATION_NAME, 0);
033:
034:            /**
035:             * This scope holds all inbound headers when a message is received. This scope is read only
036:             */
037:            public static final PropertyScope INBOUND = new PropertyScope(
038:                    INBOUND_NAME, 1);
039:
040:            /**
041:             * This is the default scope when writing properties to a message. All properties written in this scope
042:             * will be attached to the outbound message (or response message)
043:             */
044:            public static final PropertyScope OUTBOUND = new PropertyScope(
045:                    OUTBOUND_NAME, 2);
046:
047:            /**
048:             * Defines the scope for any properties set on the session. Mule utilises the underlying transport for controlling the
049:             * session where possible i.e. HttpSession. But Mule will fallback to an internal session mechanisim where a session is
050:             * encoded on the message with an expiry time associated with it.
051:             */
052:            public static final PropertyScope SESSION = new PropertyScope(
053:                    SESSION_NAME, 3);
054:
055:            /**
056:             * This provides access to properties in the registry. By default this scope is not enabled since
057:             * it will most likely have a performance impact. This is a read-only scope
058:             */
059:            public static final PropertyScope APPLICATION = new PropertyScope(
060:                    APPLICATION_NAME, 4);
061:
062:            /**
063:             * An array of all scopes defined here
064:             */
065:            public static final PropertyScope[] ALL_SCOPES = new PropertyScope[] {
066:                    INVOCATION, INBOUND, OUTBOUND, SESSION, APPLICATION };
067:
068:            private String scope;
069:            private int order;
070:
071:            public PropertyScope(String scope, int order) {
072:                this .scope = scope;
073:                this .order = order;
074:            }
075:
076:            public String getScope() {
077:                return scope;
078:            }
079:
080:            public int getOrder() {
081:                return order;
082:            }
083:
084:            public String toString() {
085:                return getScope();
086:            }
087:
088:            public boolean equals(Object o) {
089:                if (this  == o) {
090:                    return true;
091:                }
092:                if (o == null || getClass() != o.getClass()) {
093:                    return false;
094:                }
095:
096:                PropertyScope that = (PropertyScope) o;
097:
098:                if (order != that.order) {
099:                    return false;
100:                }
101:                if (scope != null ? !scope.equals(that.scope)
102:                        : that.scope != null) {
103:                    return false;
104:                }
105:
106:                return true;
107:            }
108:
109:            public int hashCode() {
110:                int result;
111:                result = (scope != null ? scope.hashCode() : 0);
112:                result = 31 * result + order;
113:                return result;
114:            }
115:
116:            /**
117:             * Used for comparing {@link PropertyScope} instances in a map. The {@link PropertyScope#getOrder()}
118:             * property is used to determine the order in the map
119:             */
120:            public static class ScopeComarator implements  Comparator,
121:                    Serializable {
122:                public int compare(Object o, Object o1) {
123:                    if (o == o1) {
124:                        return 0;
125:                    }
126:                    if (o.equals(o1)) {
127:                        return 0;
128:                    }
129:                    return (((PropertyScope) o).getOrder() < ((PropertyScope) o1)
130:                            .getOrder() ? -1 : 1);
131:                }
132:            }
133:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.