Source Code Cross Referenced for BindingContextUtils.java in  » ESB » celtix-1.0 » org » objectweb » celtix » bindings » 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 » celtix 1.0 » org.objectweb.celtix.bindings 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.objectweb.celtix.bindings;
002:
003:        import javax.xml.ws.handler.MessageContext;
004:
005:        import org.objectweb.celtix.context.OutputStreamMessageContext;
006:
007:        import static org.objectweb.celtix.bindings.JAXWSConstants.DATABINDING_CALLBACK_PROPERTY;
008:        import static org.objectweb.celtix.bindings.JAXWSConstants.DISPATCH_PROPERTY;
009:        import static org.objectweb.celtix.bindings.JAXWSConstants.SERVER_BINDING_ENDPOINT_CALLBACK_PROPERTY;
010:        import static org.objectweb.celtix.context.InputStreamMessageContext.ASYNC_ONEWAY_DISPATCH;
011:        import static org.objectweb.celtix.context.InputStreamMessageContext.DECOUPLED_RESPONSE;
012:        import static org.objectweb.celtix.context.ObjectMessageContext.CORRELATION_IN;
013:
014:        /**
015:         * Holder for utility methods relating to contexts.
016:         */
017:
018:        public final class BindingContextUtils {
019:
020:            /**
021:             * Prevents instantiation.
022:             */
023:            private BindingContextUtils() {
024:            }
025:
026:            /**
027:             * Store data binding callback in message context.
028:             *
029:             * @param context the message context
030:             * @param callback the data binding callback
031:             */
032:            public static void storeDataBindingCallback(MessageContext context,
033:                    DataBindingCallback callback) {
034:                context.put(DATABINDING_CALLBACK_PROPERTY, callback);
035:                context.setScope(DATABINDING_CALLBACK_PROPERTY,
036:                        MessageContext.Scope.HANDLER);
037:            }
038:
039:            /**
040:             * Retrieve data binding callback from message context.
041:             *
042:             * @param context the message context
043:             * @returned the data binding callback
044:             */
045:            public static DataBindingCallback retrieveDataBindingCallback(
046:                    MessageContext context) {
047:                return (DataBindingCallback) context
048:                        .get(DATABINDING_CALLBACK_PROPERTY);
049:            }
050:
051:            /**
052:             * Store server binding endpoint callback in message context.
053:             *
054:             * @param context the message context
055:             * @param sbec the server binding endpoint callback
056:             */
057:            public static void storeServerBindingEndpointCallback(
058:                    MessageContext context, ServerBindingEndpointCallback sbec) {
059:                context.put(SERVER_BINDING_ENDPOINT_CALLBACK_PROPERTY, sbec);
060:                context.setScope(SERVER_BINDING_ENDPOINT_CALLBACK_PROPERTY,
061:                        MessageContext.Scope.HANDLER);
062:            }
063:
064:            /**
065:             * Retrieve server binding endpoint callback from message context.
066:             *
067:             * @param context the message context
068:             * @returned the server binding endpoint callback
069:             */
070:            public static ServerBindingEndpointCallback retrieveServerBindingEndpointCallback(
071:                    MessageContext context) {
072:                return (ServerBindingEndpointCallback) context
073:                        .get(SERVER_BINDING_ENDPOINT_CALLBACK_PROPERTY);
074:            }
075:
076:            /**
077:             * Checks if a method object is stored in the context and if it is annotated
078:             * with a Oneway annotation.
079:             * 
080:             * @param context
081:             * @return true if a method object is stored in the context and it has a Oneway annotation.
082:             */
083:            public static boolean isOnewayMethod(MessageContext context) {
084:                DataBindingCallback cb = retrieveDataBindingCallback(context);
085:                if (cb == null) {
086:                    if (!context
087:                            .containsKey(OutputStreamMessageContext.ONEWAY_MESSAGE_TF)) {
088:                        return false;
089:                    }
090:                    return ((Boolean) context
091:                            .get(OutputStreamMessageContext.ONEWAY_MESSAGE_TF))
092:                            .booleanValue();
093:                }
094:                return cb.isOneWay();
095:            }
096:
097:            /**
098:             * Checks if a the oneway property is set in the context if its value is true
099:             * (indicating that no response is expected from the transport).
100:             * 
101:             * @param context
102:             * @return true if a method object is stored in the context and it has a Oneway annotation.
103:             */
104:            public static boolean isOnewayTransport(MessageContext context) {
105:                Boolean b = (Boolean) context
106:                        .get(OutputStreamMessageContext.ONEWAY_MESSAGE_TF);
107:                if (null != b) {
108:                    return b.booleanValue();
109:                }
110:                return false;
111:            }
112:
113:            /**
114:             * Retrieve correlation id from message context.
115:             *
116:             * @param context the message context
117:             * @returned the correlation id
118:             */
119:            public static String retrieveCorrelationID(MessageContext context) {
120:                return (String) context.get(CORRELATION_IN);
121:            }
122:
123:            /**
124:             * Store dispatch property in message context.
125:             *
126:             * @param context the message context
127:             * @param dispatch value of the dispatch property
128:             */
129:            public static void storeDispatch(MessageContext context,
130:                    boolean dispatch) {
131:                context.put(DISPATCH_PROPERTY, dispatch ? Boolean.TRUE
132:                        : Boolean.FALSE);
133:                context.setScope(DISPATCH_PROPERTY,
134:                        MessageContext.Scope.HANDLER);
135:            }
136:
137:            /**
138:             * Retrieve value of dispatch property from message context.
139:             *
140:             * @param context the message context
141:             * @returned the value of dispatch property
142:             */
143:            public static boolean retrieveDispatch(MessageContext context) {
144:                Boolean b = (Boolean) context.get(DISPATCH_PROPERTY);
145:                return null == b || b.booleanValue();
146:            }
147:
148:            /**
149:             * Store async oneway dispatch property in message context.
150:             *
151:             * @param context the message context
152:             * @param async value of the dispatch property
153:             */
154:            public static void storeAsyncOnewayDispatch(MessageContext context,
155:                    boolean async) {
156:                context.put(ASYNC_ONEWAY_DISPATCH, async ? Boolean.TRUE
157:                        : Boolean.FALSE);
158:                context.setScope(ASYNC_ONEWAY_DISPATCH,
159:                        MessageContext.Scope.HANDLER);
160:            }
161:
162:            /**
163:             * Retrieve value of async oneway dispatch property from message context.
164:             *
165:             * @param context the message context
166:             * @returned the value of async oneway dispatch property
167:             */
168:            public static boolean retrieveAsyncOnewayDispatch(
169:                    MessageContext context) {
170:                Boolean b = (Boolean) context.get(ASYNC_ONEWAY_DISPATCH);
171:                return b != null && b.booleanValue();
172:            }
173:
174:            /**
175:             * Store decoupled response property in message context.
176:             *
177:             * @param context the message context
178:             * @param decoupled value of the decoupled response property
179:             */
180:            public static void storeDecoupledResponse(MessageContext context,
181:                    boolean decoupled) {
182:                context.put(DECOUPLED_RESPONSE, decoupled ? Boolean.TRUE
183:                        : Boolean.FALSE);
184:                context.setScope(DECOUPLED_RESPONSE,
185:                        MessageContext.Scope.HANDLER);
186:            }
187:
188:            /**
189:             * Retrieve value of decoupled response property from message context.
190:             *
191:             * @param context the message context
192:             * @returned the value of decoupled response property
193:             */
194:            public static boolean retrieveDecoupledResponse(
195:                    MessageContext context) {
196:                Boolean b = (Boolean) context.get(DECOUPLED_RESPONSE);
197:                return b != null && b.booleanValue();
198:            }
199:
200:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.