1 50 package org.apache.avalon.excalibur.monitor.impl; 51 52 import java.util.Collections ; 53 import java.util.HashMap ; 54 import java.util.Map ; 55 56 import org.apache.avalon.excalibur.monitor.Resource; 57 58 66 public class PassiveMonitor 67 extends AbstractMonitor 68 { 69 private Map m_lastModified = Collections.synchronizedMap( new HashMap () ); 70 71 74 public final Resource getResource( final String key ) 75 { 76 final Resource resource = super.getResource( key ); 77 if( resource != null ) 78 { 79 final Long lastModified = (Long )m_lastModified.get( key ); 80 81 if( lastModified != null ) 82 { 83 resource.testModifiedAfter( lastModified.longValue() ); 84 } 85 86 m_lastModified.put( key, 87 new Long ( System.currentTimeMillis() ) ); 88 } 89 90 return resource; 91 } 92 } 93 | Popular Tags |