01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.components.axis;
18:
19: import javax.servlet.http.HttpServletRequest;
20: import javax.servlet.http.HttpServletResponse;
21: import javax.servlet.ServletContext;
22:
23: import org.apache.avalon.framework.activity.Startable;
24: import org.apache.avalon.framework.component.Component;
25:
26: import org.apache.axis.MessageContext;
27:
28: /**
29: * <code>SoapServer</code> interface.
30: *
31: * <p>
32: * This interface describes the operations provided by any Axis
33: * Soap Server implementations.
34: * </p>
35: *
36: * <p>
37: * Example use:
38: *
39: * <pre>
40: * SoapServer server = (SoapServer) manager.lookup(SoapServer.ROLE);
41: * MessageContext message = server.createMessageContext(req, res, con);
42: * server.invoke(message);
43: * manager.release(server);
44: * // message sent back to sender
45: * </pre>
46: * </p>
47: *
48: * @author <a href="mailto:crafterm@apache.org">Marcus Crafter</a>
49: * @version CVS $Id: SoapServer.java 433543 2006-08-22 06:22:54Z crossley $
50: */
51: public interface SoapServer extends Component, Startable {
52:
53: /**
54: * Component's ROLE definition
55: */
56: String ROLE = SoapServer.class.getName();
57:
58: /**
59: * Constant used to key message context entries for an avalon logger
60: */
61: String LOGGER = "axis-message-context-logger";
62:
63: /**
64: * Invoke a particular message context on this server. This method
65: * takes the given message, invokes it on the server and sets
66: * the response inside it for the caller to retrieve.
67: *
68: * @param message a <code>MessageContext</code> instance
69: * @exception Exception if an error occurs
70: */
71: void invoke(MessageContext message) throws Exception;
72:
73: /**
74: * Method to create a new message context, based on this Axis
75: * server instance, and the caller's request, response, and
76: * context objects.
77: *
78: * @param req a <code>HttpServletRequest</code> instance
79: * @param res a <code>HttpServletResponse</code> instance
80: * @param con a <code>ServletContext</code> instance
81: * @return a <code>MessageContext</code> instance
82: */
83: MessageContext createMessageContext(HttpServletRequest req,
84: HttpServletResponse res, ServletContext con);
85: }
|