1 17 package org.apache.geronimo.security.jaas; 18 19 import org.apache.geronimo.gbean.GBeanInfo; 20 import org.apache.geronimo.gbean.GBeanInfoBuilder; 21 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; 22 import org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration; 23 24 25 33 public class DirectConfigurationEntry implements ConfigurationEntryFactory { 34 private final String applicationConfigName; 35 private final LoginModuleControlFlag controlFlag; 36 private final LoginModuleSettings module; 37 38 public DirectConfigurationEntry() { 39 this.applicationConfigName = null; 40 this.controlFlag = null; 41 this.module = null; 42 } 43 44 public DirectConfigurationEntry(String applicationConfigName, LoginModuleControlFlag controlFlag, LoginModuleSettings module) { 45 this.applicationConfigName = applicationConfigName; 46 this.controlFlag = controlFlag; 47 this.module = module; 48 } 49 50 public String getConfigurationName() { 51 return applicationConfigName; 52 } 53 54 public JaasLoginModuleConfiguration generateConfiguration() { 55 return new JaasLoginModuleConfiguration(module.getLoginModuleClass(), controlFlag, module.getOptions(), module.isServerSide(), applicationConfigName, false, module.getClassLoader()); 56 } 57 58 public static final GBeanInfo GBEAN_INFO; 59 60 static { 61 GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(DirectConfigurationEntry.class, NameFactory.CONFIGURATION_ENTRY); 62 infoFactory.addInterface(ConfigurationEntryFactory.class); 63 infoFactory.addAttribute("applicationConfigName", String .class, true); 64 infoFactory.addAttribute("controlFlag", LoginModuleControlFlag.class, true); 65 66 infoFactory.addReference("Module", LoginModuleSettings.class, NameFactory.LOGIN_MODULE); 67 68 infoFactory.setConstructor(new String []{"applicationConfigName", "controlFlag", "Module"}); 69 GBEAN_INFO = infoFactory.getBeanInfo(); 70 } 71 72 public static GBeanInfo getGBeanInfo() { 73 return GBEAN_INFO; 74 } 75 } 76 | Popular Tags |