geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/jaas GeronimoLoginConfiguration.java
Date Sun, 30 May 2004 18:32:42 GMT
adc         2004/05/30 11:32:42

  Modified:    modules/security/src/java/org/apache/geronimo/security/jaas
                        GeronimoLoginConfiguration.java
  Log:
  Made into a GBean so that it can register itself.
  
  Revision  Changes    Path
  1.5       +35 -3     incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/jaas/GeronimoLoginConfiguration.java
  
  Index: GeronimoLoginConfiguration.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/jaas/GeronimoLoginConfiguration.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GeronimoLoginConfiguration.java	10 Mar 2004 09:59:25 -0000	1.4
  +++ GeronimoLoginConfiguration.java	30 May 2004 18:32:42 -0000	1.5
  @@ -19,19 +19,24 @@
   
   import javax.security.auth.login.AppConfigurationEntry;
   import javax.security.auth.login.Configuration;
  -
   import java.util.Hashtable;
   import java.util.Map;
   
  +import org.apache.geronimo.gbean.GBean;
  +import org.apache.geronimo.gbean.GBeanContext;
  +import org.apache.geronimo.gbean.GBeanInfo;
  +import org.apache.geronimo.gbean.GBeanInfoFactory;
  +import org.apache.geronimo.gbean.WaitingException;
   import org.apache.geronimo.security.SecurityService;
   
   
   /**
    * @version $Revision$ $Date$
    */
  -public class GeronimoLoginConfiguration extends Configuration {
  +public class GeronimoLoginConfiguration extends Configuration implements GBean {
   
       private static Map entries = new Hashtable();
  +    private Configuration oldConfiguration;
   
       public AppConfigurationEntry[] getAppConfigurationEntry(String JAASId) {
           ConfigurationEntry entry = (ConfigurationEntry) entries.get(JAASId);
  @@ -58,5 +63,32 @@
           if (sm != null) sm.checkPermission(SecurityService.CONFIGURE);
   
           entries.remove(entry.getJAASId());
  +    }
  +
  +    public void setGBeanContext(GBeanContext context) {
  +    }
  +
  +    public void doStart() throws WaitingException, Exception {
  +        oldConfiguration = Configuration.getConfiguration();
  +        Configuration.setConfiguration(this);
  +    }
  +
  +    public void doStop() throws WaitingException, Exception {
  +        Configuration.setConfiguration(oldConfiguration);
  +    }
  +
  +    public void doFail() {
  +        Configuration.setConfiguration(oldConfiguration);
  +    }
  +
  +    public static GBeanInfo getGBeanInfo() {
  +        return GBEAN_INFO;
  +    }
  +
  +    private static final GBeanInfo GBEAN_INFO;
  +
  +    static {
  +        GBeanInfoFactory infoFactory = new GBeanInfoFactory(GeronimoLoginConfiguration.class.getName());
  +        GBEAN_INFO = infoFactory.getBeanInfo();
       }
   }
  
  
  

Mime
View raw message