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 SecurityService.java
Date Sun, 13 Jun 2004 16:59:02 GMT
adc         2004/06/13 09:59:02

  Modified:    modules/security/src/java/org/apache/geronimo/security
                        SecurityService.java
  Log:
  Need to register our own policy.
  
  Revision  Changes    Path
  1.10      +12 -1     incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/SecurityService.java
  
  Index: SecurityService.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/SecurityService.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SecurityService.java	5 Jun 2004 07:53:22 -0000	1.9
  +++ SecurityService.java	13 Jun 2004 16:59:02 -0000	1.10
  @@ -19,8 +19,10 @@
   
   import java.util.Collection;
   import java.util.Collections;
  +import java.security.Policy;
   import javax.management.ObjectName;
   import javax.security.jacc.PolicyContextException;
  +import javax.security.jacc.PolicyConfigurationFactory;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -33,6 +35,7 @@
   import org.apache.geronimo.security.jacc.PolicyContextHandlerContainerSubject;
   import org.apache.geronimo.security.jacc.PolicyContextHandlerHttpServletRequest;
   import org.apache.geronimo.security.jacc.PolicyContextHandlerSOAPMessage;
  +import org.apache.geronimo.security.jacc.GeronimoPolicy;
   import org.apache.geronimo.security.realm.SecurityRealm;
   import org.apache.geronimo.security.util.ConfigurationUtil;
   
  @@ -54,6 +57,8 @@
       private Collection realms = Collections.EMPTY_SET;
       private Collection moduleConfigurations = Collections.EMPTY_SET;
   
  +    private Policy oldPolicy;
  +
   
       /**
        * Permissions that protect access to sensitive security information
  @@ -117,10 +122,16 @@
   
   
       public void doStart() throws WaitingException, Exception {
  +        oldPolicy = Policy.getPolicy();
  +        PolicyConfigurationFactory factory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
  +        Policy.setPolicy(new GeronimoPolicy(factory));
  +
           log.info("Security service started");
       }
   
       public void doStop() throws WaitingException, Exception {
  +        Policy.setPolicy(oldPolicy);
  +
           log.info("Security service stopped");
       }
   
  
  
  

Mime
View raw message