1 25 package org.jrobin.demo.graph; 26 27 import org.jrobin.core.RrdOpener; 28 import org.jrobin.core.RrdDb; 29 import org.jrobin.core.RrdBackendFactory; 30 import org.jrobin.core.RrdException; 31 32 import java.io.IOException ; 33 34 41 public class LazyDemoOpener extends RrdOpener 42 { 43 46 LazyDemoOpener() 47 { 48 super( false, true ); 50 51 System.out.println( "LOG: RrdOpener object created." ); 52 } 53 54 57 public RrdDb getRrd( String name, RrdBackendFactory backendFactory ) throws RrdException, IOException 58 { 59 RrdDb db = null; 60 61 System.out.println( "LOG: Access request for RRD with name " + name + " (backend: " + backendFactory.getFactoryName() + ")" ); 62 db = super.getRrd( name, backendFactory ); 63 64 if ( db == null ) 65 System.out.println( "LOG: FAILURE locating RRD with name " + name ); 66 else 67 System.out.println( "LOG: SUCCESS locating RRD with name " + name ); 68 69 return db; 70 } 71 72 75 public void releaseRrd( RrdDb rrdDb ) throws IOException , RrdException 76 { 77 System.out.println( "LOG: Releasing RRD " + rrdDb.getPath() ); 78 79 super.releaseRrd( rrdDb ); 80 } 81 } 82 | Popular Tags |