001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.message;
019:
020: import java.util.Collection;
021: import java.util.Map;
022: import java.util.Set;
023:
024: import org.apache.cxf.interceptor.InterceptorChain;
025: import org.apache.cxf.transport.Destination;
026:
027: /**
028: * A base class to build your own message implementations on.
029: *
030: * @author Dan
031: */
032: public abstract class AbstractWrappedMessage implements Message {
033:
034: private Message message;
035:
036: protected AbstractWrappedMessage(Message msg) {
037: this .message = msg;
038: }
039:
040: public void clear() {
041: message.clear();
042: }
043:
044: public boolean containsKey(Object key) {
045: return message.containsKey(key);
046: }
047:
048: public boolean containsValue(Object value) {
049: return message.containsValue(value);
050: }
051:
052: public Set<Entry<String, Object>> entrySet() {
053: return message.entrySet();
054: }
055:
056: public boolean equals(Object o) {
057: return message.equals(o);
058: }
059:
060: public Object get(Object key) {
061: return message.get(key);
062: }
063:
064: public Collection<Attachment> getAttachments() {
065: return message.getAttachments();
066: }
067:
068: public void setAttachments(Collection<Attachment> attachments) {
069: message.setAttachments(attachments);
070: }
071:
072: public Message getMessage() {
073: return message;
074: }
075:
076: public void setMessage(Message message) {
077: this .message = message;
078: }
079:
080: public Destination getDestination() {
081: return message.getDestination();
082: }
083:
084: public Exchange getExchange() {
085: return message.getExchange();
086: }
087:
088: public final void setExchange(Exchange exchange) {
089: message.setExchange(exchange);
090: }
091:
092: public String getId() {
093: return message.getId();
094: }
095:
096: public void setId(String id) {
097: message.setId(id);
098: }
099:
100: public InterceptorChain getInterceptorChain() {
101: return message.getInterceptorChain();
102: }
103:
104: public void setInterceptorChain(InterceptorChain chain) {
105: message.setInterceptorChain(chain);
106: }
107:
108: public <T> T getContent(Class<T> format) {
109: return message.getContent(format);
110: }
111:
112: public <T> void removeContent(Class<T> format) {
113: message.removeContent(format);
114: }
115:
116: public Set<Class<?>> getContentFormats() {
117: return message.getContentFormats();
118: }
119:
120: public int hashCode() {
121: return message.hashCode();
122: }
123:
124: public boolean isEmpty() {
125: return message.isEmpty();
126: }
127:
128: public Set<String> keySet() {
129: return message.keySet();
130: }
131:
132: public Object put(String key, Object value) {
133: return message.put(key, value);
134: }
135:
136: public void putAll(Map<? extends String, ? extends Object> t) {
137: message.putAll(t);
138: }
139:
140: public Object remove(Object key) {
141: return message.remove(key);
142: }
143:
144: public <T> void setContent(Class<T> format, Object content) {
145: message.setContent(format, content);
146: }
147:
148: public int size() {
149: return message.size();
150: }
151:
152: public Collection<Object> values() {
153: return message.values();
154: }
155:
156: public <T> T get(Class<T> key) {
157: return message.get(key);
158: }
159:
160: public <T> void put(Class<T> key, T value) {
161: message.put(key, value);
162: }
163:
164: public Object getContextualProperty(String key) {
165: return message.getContextualProperty(key);
166: }
167: }
|