01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * Initial Developer : Delplanque Xavier & Sauthier Guillaume
22: * --------------------------------------------------------------------------
23: * $Id: WSDLManager.java 5300 2004-08-23 14:19:45Z sauthieg $
24: * --------------------------------------------------------------------------
25: */package org.objectweb.jonas.ws;
26:
27: import java.util.Iterator;
28: import java.util.Vector;
29:
30: import org.objectweb.jonas_ws.deployment.api.ServiceDesc;
31:
32: import org.objectweb.jonas.ws.handler.WSDLHandler;
33:
34: /**
35: * Delegate publishing to all added WSDL Handlers.
36: */
37: public class WSDLManager {
38: /**
39: * List of WSDL Handlers in charge of WSDL Publication
40: */
41: private Vector handlers;
42:
43: /**
44: * Get a new instance of WSDLManager.
45: */
46: public WSDLManager() {
47: handlers = new Vector();
48: }
49:
50: /**
51: * Add a WSDL Handler in charge of publish a wsdl file at a location.
52: *
53: * @param handler the new WSDL handler.
54: */
55: public void addHandler(WSDLHandler handler) {
56: handlers.add(handler);
57: }
58:
59: /**
60: * Delegate publishing to all added WSDL Handlers.
61: *
62: * @param sd the ServiceDesc containing the wsdl file to publish.
63: *
64: * @throws WSServiceException When publication fails.
65: */
66: public void publish(ServiceDesc sd) throws WSServiceException {
67: for (Iterator i = handlers.iterator(); i.hasNext();) {
68: WSDLHandler wsdlh = (WSDLHandler) i.next();
69: wsdlh.publish(sd);
70: }
71: }
72: }
|