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