1 package org.codehaus.xfire.java.message;
2
3 import org.codehaus.xfire.MessageContext;
4 import org.codehaus.xfire.handler.dom.Message;
5 import org.codehaus.xfire.java.JavaService;
6 import org.codehaus.xfire.java.Operation;
7 import org.codehaus.xfire.java.mapping.TypeMapping;
8 import org.dom4j.Element;
9
10 /***
11 * MessageReader
12 *
13 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
14 */
15 public abstract class AbstractMessageBridge
16 implements MessageBridge
17 {
18 private JavaService service;
19
20 private MessageContext context;
21
22 private Message request;
23
24 private Message response;
25
26 protected Operation operation;
27
28 public AbstractMessageBridge( JavaService service,
29 MessageContext context,
30 Message request,
31 Message response )
32 {
33 this.service = service;
34 this.context = context;
35 this.request = request;
36 this.response = response;
37 }
38
39 /***
40 * @return Returns the typeMappingRegistry.
41 */
42 public TypeMapping getTypeMapping()
43 {
44 return service.getTypeMapping();
45 }
46
47 /***
48 * @return Returns the service.
49 */
50 public JavaService getService()
51 {
52 return service;
53 }
54
55 /***
56 * @return Returns the context.
57 */
58 public MessageContext getContext()
59 {
60 return context;
61 }
62
63 /***
64 * @param context The context to set.
65 */
66 public void setContext(MessageContext context)
67 {
68 this.context = context;
69 }
70
71 public Element getRequest()
72 {
73 return request.getBody();
74 }
75
76 /***
77 * @return Returns the response body.
78 */
79 public Element getResponse()
80 {
81 return response.getBody();
82 }
83
84 /***
85 * @see org.codehaus.xfire.java.message.MessageBridge#getOperation()
86 */
87 public Operation getOperation()
88 {
89 return operation;
90 }
91
92 /***
93 * @param operation The operation to set.
94 */
95 public void setOperation(Operation operation)
96 {
97 this.operation = operation;
98 }
99
100 private String namespace;
101
102 /***
103 * @return Returns the namespace.
104 */
105 public String getNamespace()
106 {
107 return namespace;
108 }
109
110 /***
111 * @param namespace The namespace to set.
112 */
113 public void setNamespace( String namespace )
114 {
115 this.namespace = namespace;
116 }
117 }