1 17 package org.apache.excalibur.source.impl; 18 19 import java.io.IOException ; 20 import java.net.MalformedURLException ; 21 import java.util.Map ; 22 23 import org.apache.avalon.framework.logger.AbstractLogEnabled; 24 import org.apache.avalon.framework.thread.ThreadSafe; 25 import org.apache.excalibur.source.Source; 26 import org.apache.excalibur.source.SourceException; 27 import org.apache.excalibur.source.SourceFactory; 28 29 40 public class ResourceSourceFactory 41 extends AbstractLogEnabled 42 implements SourceFactory, ThreadSafe 43 { 44 54 public Source getSource( String location, Map parameters ) 55 throws MalformedURLException , IOException , SourceException 56 { 57 if( getLogger().isDebugEnabled() ) 58 { 59 final String message = "Creating source object for " + location; 60 getLogger().debug( message ); 61 } 62 return new ResourceSource( location ); 63 } 64 65 68 public void release( Source source ) 69 { 70 if( null != source && getLogger().isDebugEnabled() ) 71 { 72 final String message = "Releasing source object for " + source.getURI(); 73 getLogger().debug( message ); 74 } 75 } 77 78 } 79 | Popular Tags |