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