001: /*
002: * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: * Free SoftwareFoundation, Inc.
023: * 59 Temple Place, Suite 330
024: * Boston, MA 02111-1307 USA
025: *
026: * @author Scott Ferguson
027: */
028:
029: package com.caucho.soap.jaxrpc;
030:
031: import com.caucho.log.Log;
032: import com.caucho.soap.wsdl.WSDLPort;
033: import com.caucho.soap.wsdl.WSDLService;
034: import com.caucho.util.L10N;
035:
036: import javax.xml.namespace.QName;
037: import javax.xml.rpc.Call;
038: import javax.xml.rpc.Service;
039: import javax.xml.rpc.ServiceException;
040: import javax.xml.rpc.encoding.TypeMappingRegistry;
041: import javax.xml.rpc.handler.HandlerRegistry;
042: import java.net.URL;
043: import java.util.Iterator;
044: import java.util.logging.Logger;
045:
046: /**
047: * Service
048: */
049: public class ServiceImpl implements Service {
050: private final static Logger log = Log.open(ServiceImpl.class);
051: private final static L10N L = new L10N(ServiceImpl.class);
052:
053: private final QName _serviceName;
054: private WSDLService _service;
055:
056: ServiceImpl(QName serviceName) {
057: _serviceName = serviceName;
058: }
059:
060: ServiceImpl(WSDLService service) {
061: _serviceName = null;//service.getName();
062: _service = service;
063: }
064:
065: /**
066: * Creates a call.
067: */
068: public Call createCall() {
069: throw new UnsupportedOperationException();
070: }
071:
072: /**
073: * Creates a call.
074: */
075: public Call createCall(QName portName) {
076: throw new UnsupportedOperationException();
077: }
078:
079: /**
080: * Creates a call.
081: */
082: public Call createCall(QName portName, QName opName)
083: throws ServiceException {
084: /*
085: WSDLPort port = getPort(portName);
086: WSDLOperation op = port.getOperation(opName);
087:
088: if (op == null)
089: throw new ServiceException(L.l("{0} is an unknown operation in {1}",
090: portName, opName));
091:
092: return new CallImpl(port, op);
093: */
094: throw new UnsupportedOperationException();
095: }
096:
097: /**
098: * Creates a call.
099: */
100: public Call createCall(QName portName, String operationName) {
101: throw new UnsupportedOperationException();
102: }
103:
104: /**
105: * Creates a call.
106: */
107: public Call[] getCalls(QName portName) {
108: throw new UnsupportedOperationException();
109: }
110:
111: /**
112: * Creates a call.
113: */
114: public HandlerRegistry getHandlerRegistry() {
115: throw new UnsupportedOperationException();
116: }
117:
118: /**
119: * Creates a port.
120: */
121: public java.rmi.Remote getPort(Class serviceEndpointInterface) {
122: throw new UnsupportedOperationException();
123: }
124:
125: /**
126: * Creates a port.
127: */
128: public java.rmi.Remote getPort(QName portName,
129: Class serviceEndpointInterface) {
130: throw new UnsupportedOperationException();
131: }
132:
133: /**
134: * Returns the list of ports.
135: */
136: public Iterator getPorts() {
137: throw new UnsupportedOperationException();
138: //return _service.getPortNames();
139: }
140:
141: /**
142: * Returns the name of the service.
143: */
144: public QName getServiceName() {
145: return _serviceName;
146: }
147:
148: /**
149: * Returns the type mapping registry.
150: */
151: public TypeMappingRegistry getTypeMappingRegistry() {
152: throw new UnsupportedOperationException();
153: }
154:
155: /**
156: * Returns the location of the WSDL
157: */
158: public URL getWSDLDocumentLocation() {
159: throw new UnsupportedOperationException();
160: }
161:
162: /**
163: * Returns the port.
164: */
165: private WSDLPort getPort(QName portName) throws ServiceException {
166: throw new UnsupportedOperationException();
167: /*
168: WSDLPort port = _service.getPort(portName);
169:
170: if (port == null)
171: throw new ServiceException(L.l("'{0}' is an unknown port in service '{1}'",
172: portName, getServiceName()));
173:
174: return port;*/
175: }
176:
177: /**
178: * Returns the id.
179: */
180: public String toString() {
181: return "ServiceImpl[" + getServiceName() + "]";
182: }
183: }
|