KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nextime > ion > backoffice > security > SecurityManagerFactory


1 package org.nextime.ion.backoffice.security;
2
3 import javax.servlet.ServletException JavaDoc;
4 import javax.servlet.http.HttpServlet JavaDoc;
5
6 public class SecurityManagerFactory extends HttpServlet JavaDoc {
7
8     private static String JavaDoc securityManager;
9     private static SecurityManager JavaDoc instance;
10
11     public void init() throws ServletException JavaDoc {
12         securityManager =
13             getServletConfig().getInitParameter("securityManagerClass");
14     }
15
16     public static SecurityManager JavaDoc getInstance() {
17         try {
18             if (instance == null) {
19                 instance =
20                     (SecurityManager JavaDoc) Class
21                         .forName(securityManager)
22                         .newInstance();
23             }
24             return instance;
25         } catch (Exception JavaDoc e) {
26             e.printStackTrace();
27             return null;
28         }
29     }
30
31 }
32
Popular Tags