KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_web > deployment > api > ServletDesc


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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: Florent BENOIT
22  * --------------------------------------------------------------------------
23  * $Id: ServletDesc.java,v 1.2 2004/06/01 11:24:01 benoitf Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas_web.deployment.api;
28
29 import java.util.ArrayList JavaDoc;
30 import java.util.Iterator JavaDoc;
31 import java.util.List JavaDoc;
32
33 import org.objectweb.jonas_lib.deployment.api.SecurityRoleRefDesc;
34 import org.objectweb.jonas_lib.deployment.xml.SecurityRoleRef;
35
36 import org.objectweb.jonas_web.deployment.xml.Servlet;
37 /**
38  * Defines a Servlet object.
39  * It manages classname and security-role-ref
40  * @author Florent Benoit
41  */

42
43 public class ServletDesc {
44
45     /**
46      * Internal servlet object
47      */

48     private Servlet servlet = null;
49
50     /**
51      * List of securityRoleRef
52      */

53     private List JavaDoc securityRoleRefDescList = null;
54
55
56
57     /**
58      * Constructor : Build a new Servlet object
59      * @param servlet Servlet object
60      */

61     public ServletDesc(Servlet servlet) {
62         this.servlet = servlet;
63         securityRoleRefDescList = new ArrayList JavaDoc();
64         for (Iterator JavaDoc it = servlet.getSecurityRoleRefList().iterator(); it.hasNext();) {
65             SecurityRoleRef securityRoleRef = (SecurityRoleRef) it.next();
66             SecurityRoleRefDesc securityRoleRefDesc =
67                 new SecurityRoleRefDesc(getServletName(), securityRoleRef, false);
68             securityRoleRefDescList.add(securityRoleRefDesc);
69         }
70
71     }
72
73     /**
74      * @return the name of the servlet
75      */

76     public String JavaDoc getServletName() {
77         return servlet.getServletName();
78     }
79
80     /**
81      * @return the class of the servlet
82      */

83     public String JavaDoc getServletClass() {
84         return servlet.getServletClass();
85     }
86
87
88     /**
89      * Gets the security-role-ref
90      * @return the security-role-ref
91      */

92     public List JavaDoc getSecurityRoleRefList() {
93         return securityRoleRefDescList;
94     }
95
96 }
97
Popular Tags