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: */package org.apache.geronimo.axis.server;
017:
018: import java.io.Externalizable;
019: import java.io.IOException;
020: import java.io.ObjectInput;
021: import java.io.ObjectOutput;
022: import java.util.ArrayList;
023: import java.util.Iterator;
024: import java.util.List;
025:
026: import javax.xml.namespace.QName;
027:
028: import org.apache.axis.constants.Style;
029: import org.apache.axis.constants.Use;
030: import org.apache.axis.description.JavaServiceDesc;
031: import org.apache.axis.description.OperationDesc;
032: import org.apache.axis.description.TypeDesc;
033: import org.apache.axis.encoding.TypeMapping;
034: import org.apache.axis.encoding.TypeMappingRegistry;
035: import org.apache.geronimo.axis.client.TypeInfo;
036:
037: /**
038: * @version $Rev: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
039: */
040: public class ReadOnlyServiceDesc extends JavaServiceDesc implements
041: Externalizable {
042: private JavaServiceDesc serviceDesc;
043: private List typeInfo;
044:
045: /**
046: * Only required as Externalizable.
047: */
048: public ReadOnlyServiceDesc() {
049: }
050:
051: public ReadOnlyServiceDesc(JavaServiceDesc serviceDesc,
052: List typeInfo) {
053: this .serviceDesc = serviceDesc;
054: this .typeInfo = typeInfo;
055: }
056:
057: public Class getImplClass() {
058: return serviceDesc.getImplClass();
059: }
060:
061: public void setImplClass(Class implClass) {
062: serviceDesc.setImplClass(implClass);
063: }
064:
065: public ArrayList getStopClasses() {
066: return serviceDesc.getStopClasses();
067: }
068:
069: public void setStopClasses(ArrayList stopClasses) {
070: }
071:
072: public void loadServiceDescByIntrospection() {
073: serviceDesc.loadServiceDescByIntrospection();
074: }
075:
076: public void loadServiceDescByIntrospection(Class implClass) {
077: serviceDesc.loadServiceDescByIntrospection(implClass);
078: }
079:
080: public void loadServiceDescByIntrospection(Class cls, TypeMapping tm) {
081: serviceDesc.loadServiceDescByIntrospection(cls, tm);
082: }
083:
084: public Style getStyle() {
085: return serviceDesc.getStyle();
086: }
087:
088: public void setStyle(Style style) {
089: }
090:
091: public Use getUse() {
092: return serviceDesc.getUse();
093: }
094:
095: public void setUse(Use use) {
096: }
097:
098: public String getWSDLFile() {
099: return serviceDesc.getWSDLFile();
100: }
101:
102: public void setWSDLFile(String wsdlFileName) {
103: }
104:
105: public List getAllowedMethods() {
106: return serviceDesc.getAllowedMethods();
107: }
108:
109: public void setAllowedMethods(List allowedMethods) {
110: }
111:
112: public TypeMapping getTypeMapping() {
113: return serviceDesc.getTypeMapping();
114: }
115:
116: public void setTypeMapping(TypeMapping tm) {
117: }
118:
119: public String getName() {
120: return serviceDesc.getName();
121: }
122:
123: public void setName(String name) {
124: }
125:
126: public String getDocumentation() {
127: return serviceDesc.getDocumentation();
128: }
129:
130: public void setDocumentation(String documentation) {
131: }
132:
133: public void removeOperationDesc(OperationDesc operation) {
134: }
135:
136: public void addOperationDesc(OperationDesc operation) {
137: }
138:
139: public ArrayList getOperations() {
140: return serviceDesc.getOperations();
141: }
142:
143: public OperationDesc[] getOperationsByName(String methodName) {
144: return serviceDesc.getOperationsByName(methodName);
145: }
146:
147: public OperationDesc getOperationByName(String methodName) {
148: return serviceDesc.getOperationByName(methodName);
149: }
150:
151: public OperationDesc getOperationByElementQName(QName qname) {
152: return serviceDesc.getOperationByElementQName(qname);
153: }
154:
155: public OperationDesc[] getOperationsByQName(QName qname) {
156: return serviceDesc.getOperationsByQName(qname);
157: }
158:
159: public void setNamespaceMappings(List namespaces) {
160: }
161:
162: public String getDefaultNamespace() {
163: return serviceDesc.getDefaultNamespace();
164: }
165:
166: public void setDefaultNamespace(String namespace) {
167: }
168:
169: public void setProperty(String name, Object value) {
170: serviceDesc.setProperty(name, value);
171: }
172:
173: public Object getProperty(String name) {
174: return serviceDesc.getProperty(name);
175: }
176:
177: public String getEndpointURL() {
178: return serviceDesc.getEndpointURL();
179: }
180:
181: public void setEndpointURL(String endpointURL) {
182: }
183:
184: public TypeMappingRegistry getTypeMappingRegistry() {
185: return serviceDesc.getTypeMappingRegistry();
186: }
187:
188: public void setTypeMappingRegistry(TypeMappingRegistry tmr) {
189: }
190:
191: public boolean isInitialized() {
192: return serviceDesc.isInitialized();
193: }
194:
195: public boolean isWrapped() {
196: return serviceDesc.isWrapped();
197: }
198:
199: public List getDisallowedMethods() {
200: return serviceDesc.getDisallowedMethods();
201: }
202:
203: public void setDisallowedMethods(List disallowedMethods) {
204: }
205:
206: public void readExternal(ObjectInput in) throws IOException,
207: ClassNotFoundException {
208: typeInfo = (List) in.readObject();
209:
210: // one must register the TypeDesc before to deserialize the JavaServiceDesc
211: // as it contains a bunch of BeanXXXFactory instances which need
212: // them registered to properly recreate the state of the factories.
213: for (Iterator iter = typeInfo.iterator(); iter.hasNext();) {
214: TypeInfo info = (TypeInfo) iter.next();
215: TypeDesc.registerTypeDescForClass(info.getClazz(), info
216: .buildTypeDesc());
217: }
218:
219: serviceDesc = (JavaServiceDesc) in.readObject();
220: }
221:
222: public void writeExternal(ObjectOutput out) throws IOException {
223: out.writeObject(typeInfo);
224: out.writeObject(serviceDesc);
225: }
226: }
|