1 50 package org.apache.avalon.fortress.examples.extended.components; 51 52 import org.apache.avalon.framework.logger.AbstractLogEnabled; 53 import org.apache.avalon.fortress.examples.extended.extensions.SecurityManageable; 54 55 69 public class ExtendedComponentImpl 70 extends AbstractLogEnabled 71 implements ExtendedComponent, SecurityManageable 72 { 73 78 public void secure( final SecurityManager manager ) 79 throws SecurityException 80 { 81 getLogger().debug( "Received SecurityManager instance: " + manager ); 82 83 final String [] files = {"/tmp", "/vmlinuz", "/usr/lib/libc.a"}; 84 85 for( int i = 0; i < files.length; ++i ) 86 { 87 try 88 { 89 manager.checkRead( files[ i ] ); 90 getLogger().info( "Thread can read " + files[ i ] ); 91 } 92 93 catch( SecurityException e ) 94 { 95 getLogger().info( "Thread can not read " + files[ i ] ); 96 } 97 } 98 } 99 } 100 101 | Popular Tags |