1 23 package com.sun.enterprise.diagnostics; 24 25 import com.sun.enterprise.diagnostics.collect.Collector; 26 import com.sun.enterprise.diagnostics.collect.PEHarvester; 27 import com.sun.enterprise.diagnostics.report.html.HTMLReportWriter; 28 import java.util.Map ; 29 30 34 public class PEBackendObjectFactory extends SingleInstanceObjectFactory { 35 36 37 public PEBackendObjectFactory(Map map) { 38 super(map); 39 } 40 41 public Collector createHarvester() throws DiagnosticException { 42 return new PEHarvester(getReportConfig()); 43 } 44 45 public HTMLReportWriter createHTMLReportWriter() 46 throws DiagnosticException { 47 return new HTMLReportWriter(getReportConfig()); 48 } 49 50 public TargetResolver createTargetResolver(boolean local) 51 throws DiagnosticException { 52 if(options != null) { 53 if(local) 54 return new PELocalTargetResolver(options.getTargetName(), 55 options.getTargetDir(), local); 56 else 57 return new PERemoteTargetResolver(options.getTargetName(), 58 options.getTargetDir(), local); 59 } 60 throw new DiagnosticException("Null input for resolving target"); 61 } 62 63 public ReportGenerator createReportGenerator(ReportConfig config, 64 Collector harvester,HTMLReportWriter reportWriter) 65 throws DiagnosticException{ 66 return new ReportGenerator(config, harvester, reportWriter); 67 } 68 69 } 70 | Popular Tags |