01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.container.om.servlet;
07:
08: import java.io.Serializable;
09: import java.util.HashMap;
10: import java.util.Iterator;
11: import java.util.Map;
12:
13: /**
14: * Data structure to support WebApplicationDefinition for
15: * marshalling and unmarshalling of web.xml.
16: * Not needed by the Pluto container.
17: * @author Ken Weiner, kweiner@unicon.net
18: * @version $Revision: 34757 $
19: */
20: public class ServletMappingListImpl implements Serializable {
21:
22: private Map servletMappings = null; // Servlet name --> ServletMappingImpl
23:
24: public ServletMappingListImpl() {
25: servletMappings = new HashMap();
26: }
27:
28: public Iterator iterator() {
29: return servletMappings.values().iterator();
30: }
31:
32: public ServletMappingImpl get(String name) {
33: return (ServletMappingImpl) servletMappings.get(name);
34: }
35:
36: public ServletMappingImpl remove(String name) {
37: return (ServletMappingImpl) servletMappings.remove(name);
38: }
39:
40: public void remove(ServletMappingImpl servletMapping) {
41: servletMappings.remove(servletMapping.getServletName());
42: }
43:
44: public void add(ServletMappingImpl servletMapping) {
45: servletMappings.put(servletMapping.getServletName(),
46: servletMapping);
47: }
48:
49: public int size() {
50: return servletMappings.size();
51: }
52:
53: }
|