01: /*
02: * (C) Copyright 2000 - 2005 Nabh Information Systems, Inc.
03: *
04: * This program is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU General Public License
06: * as published by the Free Software Foundation; either version 2
07: * of the License, or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: *
18: */
19: package com.nabhinc.ws.server;
20:
21: import java.io.IOException;
22: import java.io.Writer;
23:
24: import org.w3c.dom.Document;
25: import org.w3c.dom.Element;
26:
27: import com.nabhinc.ws.core.WebServiceException;
28:
29: /**
30: * Protocol-independent base interface for Web service request procssors.
31: *
32: * @author Padmanabh Dabke
33: * (c) 2005 Nabh Information Systems, Inc. All Rights Reserved.
34: */
35: public interface RequestProcessor extends ServerObject {
36:
37: /**
38: * Gives the <code>RequestProcessor</code> implementation a chance to initialize
39: * protocol-specific state based on the XML configuration element.
40: * @param serviceInfo Web service being loaded
41: * @param serviceConfig Service configuration
42: * @throws ServletException
43: */
44: void load(WebServiceInfo serviceInfo, Element serviceConfig)
45: throws WebServiceException;
46:
47: /**
48: * Gives the <code>RequestProcessor</code> implementation a chance to clean up
49: * protocol-specific resources related to the specified service.
50: * @param serviceInfo Web service being unloaded.
51: */
52: void unload(WebServiceInfo serviceInfo);
53:
54: /**
55: * Get WSDL document for the specified service
56: * @param serviceInfo WebServiceInfo object for the service
57: * @param serverURL URL configured for the Web services server
58: * @param reqURL URL corresponding to the current request.
59: * @throws WebServiceException
60: * @throws IOException
61: * @return WSDL document.
62: */
63: Document getWSDL(WebServiceInfo serviceInfo, String serverURL,
64: String reqURL) throws WebServiceException, IOException;
65:
66: /**
67: * Serialize processor-specific service configuration to the given writer
68: * @param rootConfig Service configuration element
69: * @param indent Starting indent used in XML formatting
70: * @param delta Indent between two levels in XML tree
71: * @param w Writer to which the configuration should be written
72: * @throws IOException
73: */
74: void serialize(Element rootConfig, String indent, String delta,
75: Writer w) throws IOException;
76: }
|