Source Code Cross Referenced for MockMessageExchange.java in  » ESB » servicemix » org » apache » servicemix » tck » mock » 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 » servicemix » org.apache.servicemix.tck.mock 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.servicemix.tck.mock;
018:
019:        import java.net.URI;
020:        import java.util.HashMap;
021:        import java.util.Map;
022:        import java.util.Set;
023:
024:        import javax.jbi.messaging.ExchangeStatus;
025:        import javax.jbi.messaging.Fault;
026:        import javax.jbi.messaging.MessageExchange;
027:        import javax.jbi.messaging.MessagingException;
028:        import javax.jbi.messaging.NormalizedMessage;
029:        import javax.jbi.servicedesc.ServiceEndpoint;
030:        import javax.xml.namespace.QName;
031:
032:        public class MockMessageExchange implements  MessageExchange {
033:
034:            private ServiceEndpoint endpoint;
035:            private Exception error;
036:            private String exchangeId;
037:            private QName interfaceName;
038:            private QName operation;
039:            private URI pattern;
040:            private QName service;
041:            private MessageExchange.Role role;
042:            private ExchangeStatus status;
043:            private NormalizedMessage inMessage;
044:            private NormalizedMessage outMessage;
045:            private Fault fault;
046:            private Map<String, Object> properties = new HashMap<String, Object>();
047:
048:            /**
049:             * @return the endpoint
050:             */
051:            public ServiceEndpoint getEndpoint() {
052:                return endpoint;
053:            }
054:
055:            /**
056:             * @param endpoint the endpoint to set
057:             */
058:            public void setEndpoint(ServiceEndpoint endpoint) {
059:                this .endpoint = endpoint;
060:            }
061:
062:            /**
063:             * @return the error
064:             */
065:            public Exception getError() {
066:                return error;
067:            }
068:
069:            /**
070:             * @param error the error to set
071:             */
072:            public void setError(Exception error) {
073:                this .error = error;
074:            }
075:
076:            /**
077:             * @return the exchangeId
078:             */
079:            public String getExchangeId() {
080:                return exchangeId;
081:            }
082:
083:            /**
084:             * @param exchangeId the exchangeId to set
085:             */
086:            public void setExchangeId(String exchangeId) {
087:                this .exchangeId = exchangeId;
088:            }
089:
090:            /**
091:             * @return the fault
092:             */
093:            public Fault getFault() {
094:                return fault;
095:            }
096:
097:            /**
098:             * @param fault the fault to set
099:             */
100:            public void setFault(Fault fault) {
101:                this .fault = fault;
102:            }
103:
104:            /**
105:             * @return the in
106:             */
107:            public NormalizedMessage getInMessage() {
108:                return inMessage;
109:            }
110:
111:            /**
112:             * @param in the in to set
113:             */
114:            public void setInMessage(NormalizedMessage in) {
115:                this .inMessage = in;
116:            }
117:
118:            /**
119:             * @return the interfaceName
120:             */
121:            public QName getInterfaceName() {
122:                return interfaceName;
123:            }
124:
125:            /**
126:             * @param interfaceName the interfaceName to set
127:             */
128:            public void setInterfaceName(QName interfaceName) {
129:                this .interfaceName = interfaceName;
130:            }
131:
132:            /**
133:             * @return the operation
134:             */
135:            public QName getOperation() {
136:                return operation;
137:            }
138:
139:            /**
140:             * @param operation the operation to set
141:             */
142:            public void setOperation(QName operation) {
143:                this .operation = operation;
144:            }
145:
146:            /**
147:             * @return the out
148:             */
149:            public NormalizedMessage getOutMessage() {
150:                return outMessage;
151:            }
152:
153:            /**
154:             * @param out the out to set
155:             */
156:            public void setOutMessage(NormalizedMessage out) {
157:                this .outMessage = out;
158:            }
159:
160:            /**
161:             * @return the pattern
162:             */
163:            public URI getPattern() {
164:                return pattern;
165:            }
166:
167:            /**
168:             * @param pattern the pattern to set
169:             */
170:            public void setPattern(URI pattern) {
171:                this .pattern = pattern;
172:            }
173:
174:            /**
175:             * @return the role
176:             */
177:            public MessageExchange.Role getRole() {
178:                return role;
179:            }
180:
181:            /**
182:             * @param role the role to set
183:             */
184:            public void setRole(MessageExchange.Role role) {
185:                this .role = role;
186:            }
187:
188:            /**
189:             * @return the service
190:             */
191:            public QName getService() {
192:                return service;
193:            }
194:
195:            /**
196:             * @param service the service to set
197:             */
198:            public void setService(QName service) {
199:                this .service = service;
200:            }
201:
202:            /**
203:             * @return the status
204:             */
205:            public ExchangeStatus getStatus() {
206:                return status;
207:            }
208:
209:            /**
210:             * @param status the status to set
211:             */
212:            public void setStatus(ExchangeStatus status) {
213:                this .status = status;
214:            }
215:
216:            public Fault createFault() throws MessagingException {
217:                return new MockFault();
218:            }
219:
220:            public NormalizedMessage createMessage() throws MessagingException {
221:                return new MockNormalizedMessage();
222:            }
223:
224:            public NormalizedMessage getMessage(String name) {
225:                if ("in".equalsIgnoreCase(name)) {
226:                    return getInMessage();
227:                } else if ("out".equalsIgnoreCase(name)) {
228:                    return getOutMessage();
229:                }
230:                return null;
231:            }
232:
233:            public Object getProperty(String name) {
234:                return properties.get(name);
235:            }
236:
237:            public Set getPropertyNames() {
238:                return properties.keySet();
239:            }
240:
241:            public boolean isTransacted() {
242:                return false;
243:            }
244:
245:            public void setMessage(NormalizedMessage msg, String name)
246:                    throws MessagingException {
247:                if ("in".equalsIgnoreCase(name)) {
248:                    setInMessage(msg);
249:                } else if ("out".equalsIgnoreCase(name)) {
250:                    setOutMessage(msg);
251:                }
252:            }
253:
254:            public void setProperty(String name, Object obj) {
255:                properties.put(name, obj);
256:            }
257:
258:            public static class MockFault extends MockNormalizedMessage
259:                    implements  Fault {
260:            }
261:
262:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.