Source Code Cross Referenced for AbstractBindingImpl.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 java.io.IOException;
004:        import java.util.ArrayList;
005:        import java.util.Iterator;
006:        import java.util.List;
007:
008:        import javax.xml.ws.Binding;
009:        import javax.xml.ws.handler.Handler;
010:        import javax.xml.ws.handler.LogicalHandler;
011:        import javax.xml.ws.handler.MessageContext;
012:
013:        import org.objectweb.celtix.bus.jaxws.configuration.types.SystemHandlerChainType;
014:        import org.objectweb.celtix.common.injection.ResourceInjector;
015:        import org.objectweb.celtix.configuration.Configuration;
016:        import org.objectweb.celtix.context.InputStreamMessageContext;
017:        import org.objectweb.celtix.context.ObjectMessageContext;
018:        import org.objectweb.celtix.context.OutputStreamMessageContext;
019:        import org.objectweb.celtix.handlers.HandlerChainBuilder;
020:        import org.objectweb.celtix.handlers.HandlerInvoker;
021:        import org.objectweb.celtix.handlers.StreamHandler;
022:
023:        public abstract class AbstractBindingImpl implements  Binding {
024:
025:            private static final String SYSTEM_HANDLER_CHAIN_PROPERTY_NAME = "systemHandlerChain";
026:            protected List<Handler> handlerChain;
027:            protected List<Handler> preLogicalSystemHandlers;
028:            protected List<Handler> postLogicalSystemHandlers;
029:            protected List<Handler> preProtocolSystemHandlers;
030:            protected List<Handler> postProtocolSystemHandlers;
031:
032:            /* (non-Javadoc)
033:             * @see javax.xml.ws.Binding#getHandlerChain()
034:             */
035:            public List<Handler> getHandlerChain() {
036:                // TODO Auto-generated method stub
037:                return handlerChain;
038:            }
039:
040:            /**
041:             * Returns the list of configured JAX-WS and system handlers - used by the 
042:             * abstract client and server binding implementations in processing outgoing and
043:             * incoming messages.
044:             * 
045:             * @param includeSystemHandlers
046:             * @return
047:             */
048:            public List<Handler> getHandlerChain(boolean includeSystemHandlers) {
049:                if (!includeSystemHandlers) {
050:                    return getHandlerChain();
051:                }
052:                List<Handler> allHandlers = new ArrayList<Handler>();
053:                if (null != preLogicalSystemHandlers) {
054:                    allHandlers.addAll(preLogicalSystemHandlers);
055:                }
056:                // jaxws handlers are sorted by logical and system handlers
057:                List<Handler> userHandlers = handlerChain;
058:                if (null == userHandlers) {
059:                    userHandlers = new ArrayList<Handler>();
060:                }
061:                Iterator<Handler> it = userHandlers.iterator();
062:                while (it.hasNext()) {
063:                    Handler h = it.next();
064:                    if (h instanceof  LogicalHandler) {
065:                        allHandlers.add(h);
066:                    }
067:                }
068:                if (null != postLogicalSystemHandlers) {
069:                    allHandlers.addAll(postLogicalSystemHandlers);
070:                }
071:                if (null != preProtocolSystemHandlers) {
072:                    allHandlers.addAll(preProtocolSystemHandlers);
073:                }
074:                it = userHandlers.iterator();
075:                while (it.hasNext()) {
076:                    Handler h = it.next();
077:                    if (!(h instanceof  StreamHandler || h instanceof  LogicalHandler)) {
078:                        allHandlers.add(h);
079:                    }
080:                }
081:                if (null != postProtocolSystemHandlers) {
082:                    allHandlers.addAll(postProtocolSystemHandlers);
083:                }
084:                it = userHandlers.iterator();
085:                while (it.hasNext()) {
086:                    Handler h = it.next();
087:                    if (h instanceof  StreamHandler) {
088:                        allHandlers.add(h);
089:                    }
090:                }
091:                return allHandlers;
092:            }
093:
094:            /* (non-Javadoc)
095:             * @see javax.xml.ws.Binding#setHandlerChain(java.util.List)
096:             */
097:            public void setHandlerChain(List<Handler> chain) {
098:                assert chain != null;
099:                handlerChain = chain;
100:            }
101:
102:            /**
103:             * Configure the system handlers specified in configuration
104:             *
105:             */
106:            public void configureSystemHandlers(Configuration c) {
107:                HandlerChainBuilder builder = new HandlerChainBuilder();
108:                SystemHandlerChainType sh = (SystemHandlerChainType) c
109:                        .getObject(SYSTEM_HANDLER_CHAIN_PROPERTY_NAME);
110:                if (null != sh) {
111:                    preLogicalSystemHandlers = builder
112:                            .buildHandlerChainFromConfiguration(sh
113:                                    .getPreLogical());
114:                    postLogicalSystemHandlers = builder
115:                            .buildHandlerChainFromConfiguration(sh
116:                                    .getPostLogical());
117:                    preProtocolSystemHandlers = builder
118:                            .buildHandlerChainFromConfiguration(sh
119:                                    .getPreProtocol());
120:                    postProtocolSystemHandlers = builder
121:                            .buildHandlerChainFromConfiguration(sh
122:                                    .getPostProtocol());
123:                }
124:            }
125:
126:            /**
127:             * Returns the list of logical system handlers that should be executed
128:             * before any user supplied logical handlers. The returned list is NOT a
129:             * copy and thus can be modified directly.
130:             * 
131:             * @return the list of logical system handlers.
132:             */
133:            public List<Handler> getPreLogicalSystemHandlers() {
134:                if (null == preLogicalSystemHandlers) {
135:                    preLogicalSystemHandlers = new ArrayList<Handler>();
136:                }
137:                return preLogicalSystemHandlers;
138:            }
139:
140:            /**
141:             * Returns the list of logical system handlers that should be
142:             * executed after any user supplied logical handlers.
143:             * The returned list is NOT a copy and thus can be modified directly. 
144:             * @return the list of logical system handlers.
145:             */
146:            public List<Handler> getPostLogicalSystemHandlers() {
147:                if (null == postLogicalSystemHandlers) {
148:                    postLogicalSystemHandlers = new ArrayList<Handler>();
149:                }
150:                return postLogicalSystemHandlers;
151:            }
152:
153:            /**
154:             * Returns the list of protocol system handlers that should be
155:             * executed before any user supplied protocol handlers.
156:             * @return the list of protocol system handlers.
157:             */
158:            public List<Handler> getPreProtocolSystemHandlers() {
159:                if (null == preProtocolSystemHandlers) {
160:                    preProtocolSystemHandlers = new ArrayList<Handler>();
161:                }
162:                return preProtocolSystemHandlers;
163:            }
164:
165:            /**
166:             * Returns the list of protocl system handlers that should be
167:             * executed after any user supplied protocl handlers.
168:             * @return the list of protocol system handlers.
169:             */
170:            public List<Handler> getPostProtocolSystemHandlers() {
171:                if (null == postProtocolSystemHandlers) {
172:                    postProtocolSystemHandlers = new ArrayList<Handler>();
173:                }
174:                return postProtocolSystemHandlers;
175:            }
176:
177:            public void injectSystemHandlers(ResourceInjector injector) {
178:                if (null != preLogicalSystemHandlers) {
179:                    for (Handler h : preLogicalSystemHandlers) {
180:                        injector.inject(h);
181:                    }
182:                }
183:                if (null != postLogicalSystemHandlers) {
184:                    for (Handler h : postLogicalSystemHandlers) {
185:                        injector.inject(h);
186:                    }
187:                }
188:
189:                if (null != preProtocolSystemHandlers) {
190:                    for (Handler h : preProtocolSystemHandlers) {
191:                        injector.inject(h);
192:                    }
193:                }
194:
195:                if (null != postProtocolSystemHandlers) {
196:                    for (Handler h : postProtocolSystemHandlers) {
197:                        injector.inject(h);
198:                    }
199:                }
200:            }
201:
202:            public abstract MessageContext createBindingMessageContext(
203:                    MessageContext orig);
204:
205:            public abstract HandlerInvoker createHandlerInvoker();
206:
207:            public abstract void marshal(ObjectMessageContext objContext,
208:                    MessageContext msgContext, DataBindingCallback callback);
209:
210:            public abstract void marshalFault(ObjectMessageContext objContext,
211:                    MessageContext msgContext, DataBindingCallback callback);
212:
213:            public abstract void unmarshal(MessageContext msgContext,
214:                    ObjectMessageContext objContext,
215:                    DataBindingCallback callback);
216:
217:            public abstract void unmarshalFault(MessageContext msgContext,
218:                    ObjectMessageContext objContext,
219:                    DataBindingCallback callback);
220:
221:            public abstract void write(MessageContext msgContext,
222:                    OutputStreamMessageContext outContext) throws IOException;
223:
224:            public abstract void read(InputStreamMessageContext inContext,
225:                    MessageContext msgContext) throws IOException;
226:
227:            public abstract boolean hasFault(MessageContext msgContext);
228:
229:            public abstract void updateMessageContext(MessageContext msgContext);
230:
231:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.