avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader PolicyEntry.java AbstractPolicy.java
Date Mon, 20 May 2002 10:23:06 GMT
donaldp     02/05/20 03:23:05

  Modified:    src/java/org/apache/avalon/phoenix/components/classloader
                        AbstractPolicy.java
  Added:       src/java/org/apache/avalon/phoenix/components/classloader
                        PolicyEntry.java
  Log:
  Extract out inner class PolicyEntry from AbstractPolicy.
  
  Revision  Changes    Path
  1.8       +6 -17     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/AbstractPolicy.java
  
  Index: AbstractPolicy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/AbstractPolicy.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractPolicy.java	10 May 2002 09:13:41 -0000	1.7
  +++ AbstractPolicy.java	20 May 2002 10:23:05 -0000	1.8
  @@ -34,15 +34,6 @@
       private final ArrayList m_entries = new ArrayList();
       private Logger m_logger;
   
  -    /**
  -     * Internal Policy Entry holder class.
  -     */
  -    private static class PolicyEntry
  -    {
  -        CodeSource m_codeSource;
  -        Permissions m_permissions;
  -    }
  -
       public void enableLogging( final Logger logger )
       {
           m_logger = logger;
  @@ -70,9 +61,9 @@
           for( int i = 0; i < size; i++ )
           {
               final PolicyEntry entry = (PolicyEntry)m_entries.get( i );
  -            if( entry.m_codeSource.implies( codeSource ) )
  +            if( entry.getCodeSource().implies( codeSource ) )
               {
  -                copyPermissions( permissions, entry.m_permissions );
  +                copyPermissions( permissions, entry.getPermissions() );
               }
           }
   
  @@ -108,13 +99,11 @@
       {
           getLogger().debug( "createPermissionSetFor(" + url + ");" );
   
  -        final PolicyEntry entry = new PolicyEntry();
  -        entry.m_codeSource = new CodeSource( url, signers );
  -        entry.m_codeSource = normalize( entry.m_codeSource );
  -        entry.m_permissions = new Permissions();
  -
  +        CodeSource codeSource = new CodeSource( url, signers );
  +        codeSource = normalize( codeSource );
  +        final PolicyEntry entry = new PolicyEntry( codeSource, new Permissions() );
           m_entries.add( entry );
  -        return entry.m_permissions;
  +        return entry.getPermissions();
       }
   
       protected final Logger getLogger()
  
  
  
  1.1                  jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/PolicyEntry.java
  
  Index: PolicyEntry.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.phoenix.components.classloader;
  
  import java.security.CodeSource;
  import java.security.Permissions;
  
  /**
   * Internal Policy Entry holder class.
   */
  final class PolicyEntry
  {
      private final CodeSource m_codeSource;
      private final Permissions m_permissions;
  
      public PolicyEntry( final CodeSource codeSource,
                          final Permissions permissions )
      {
          m_codeSource = codeSource;
          m_permissions = permissions;
      }
  
      public CodeSource getCodeSource()
      {
          return m_codeSource;
      }
  
      public Permissions getPermissions()
      {
          return m_permissions;
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message