1 23 package com.sun.enterprise.admin.mbeans; 24 import com.sun.enterprise.server.pluggable.PluggableFeatureFactory; 25 import com.sun.logging.LogDomains; 26 import com.sun.enterprise.server.ApplicationServer; 27 28 import java.util.logging.Logger ; 29 import java.util.List ; 30 import java.util.Map ; 31 import java.util.logging.Level ; 32 33 34 41 42 public class DomainDiagnostics implements DomainDiagnosticsMBean { 43 44 protected Logger _logger = LogDomains.getLogger(LogDomains.ADMIN_LOGGER); 45 47 private PluggableFeatureFactory featureFactory; 48 51 public DomainDiagnostics() { 52 initPluggableFeatureFactory(); 53 } 54 55 58 public String generateReport(Map input) throws Exception { 59 if(input != null) { 60 if(featureFactory != null) { 61 com.sun.enterprise.diagnostics.DiagnosticAgent agent = 62 featureFactory.getDiagnosticAgent(); 63 return agent.generateReport(input); 64 } 65 throw new Exception ("Unable to retrieve feature factory"); 66 } 67 throw new Exception (" Null input"); 68 } 69 70 71 76 public List <String > getConfidentialProperties() 77 throws Exception { 78 if(featureFactory != null) { 79 com.sun.enterprise.diagnostics.DiagnosticAgent agent = 80 featureFactory.getDiagnosticAgent(); 81 String repositoryDir = ApplicationServer.getServerContext(). 82 getInstanceEnvironment().getInstancesRoot(); 83 return agent.getConfidentialProperties(repositoryDir); 84 } 85 throw new Exception (" Unable to retrive Pluggable Feature Factory"); 86 } 87 88 89 private void initPluggableFeatureFactory() { 90 featureFactory = 91 ApplicationServer.getServerContext().getPluggableFeatureFactory(); 92 if (featureFactory == null) { 93 _logger.log(Level.WARNING, 94 "diagnostic-service.error_initalize_pluggable_factory"); 95 } 96 } 97 } 98 | Popular Tags |