1 23 24 29 30 package com.sun.web.security; 31 32 import com.sun.enterprise.deployment.PrincipalImpl; 33 import com.sun.enterprise.deployment.Group; 34 import com.sun.web.security.WebSecurityManager; 35 39 public class PrincipalGroupFactory { 40 41 42 43 public static PrincipalImpl getPrincipalInstance(String name, String realm){ 44 PrincipalImpl p = (PrincipalImpl)WebSecurityManager.getAdminPrincipal(name, realm) ; 45 if(p == null){ 46 p = new PrincipalImpl(name); 47 } 48 return p; 49 } 50 51 public static Group getGroupInstance(String name, String realm){ 52 Group g = (Group)WebSecurityManager.getAdminGroup(name, realm); 53 if(g == null){ 54 g = new Group(name); 55 } 56 return g; 57 } 58 } 59 | Popular Tags |