Coverage report

  %line %branch
net.sf.infrared.agent.configmgmt.InfraredProperties
0% 
0% 

 1  
 /* 
 2  
  * Copyright 2005 Tavant Technologies and Contributors
 3  
  * 
 4  
  * Licensed under the Apache License, Version 2.0 (the "License")
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  * 
 16  
  *
 17  
  *
 18  
  * Original Author:  subin.p (Tavant Technologies)
 19  
  * Contributor(s):   -;
 20  
  *
 21  
  */
 22  
 package net.sf.infrared.agent.configmgmt;
 23  
 
 24  
 import net.sf.infrared.agent.MonitorConfig;
 25  
 
 26  
 /**
 27  
  * This class provides the implementation for the InfraredPropertiesMBean. The
 28  
  * changes made to the properties (via a JMX console) are made to reflect on the
 29  
  * MonitorConfig instance.
 30  
  * 
 31  
  * @author subin.p
 32  
  */
 33  
 
 34  
 // @TODO Need to implement the configuration handling
 35  
 public class InfraredProperties implements InfraredPropertiesMBean {
 36  
 
 37  
     private static final String KEY_JDBC_MONITORING_ENABLED = "jdbc-monitoring-enable";
 38  
 
 39  
     private static final String KEY_JDBC_FETCH_STATISTICS_ENABLE = "jdbc-fetch-statistics";
 40  
     
 41  
     private MonitorConfig config;
 42  
 
 43  0
     public InfraredProperties(MonitorConfig config) {
 44  0
         this.config = config;
 45  0
     }
 46  
 
 47  
     public void setMonitoring(boolean monitoring) {
 48  0
         config.enableMonitoring(monitoring);
 49  0
     }
 50  
 
 51  
     public boolean getMonitoring() {
 52  
     	// config.setIsCallFromInfraredPropertiesMBean(true);
 53  0
     	return config.isMonitoringEnabled();
 54  
     }
 55  
 
 56  
     public void setCallTraceProfiling(boolean callTraceProfiling) {
 57  0
         config.enableCallTracing(callTraceProfiling);
 58  0
     }
 59  
 
 60  
     public boolean getCallTraceProfiling() {
 61  
     	// config.setIsCallFromInfraredPropertiesMBean(true);
 62  0
     	return config.isCallTracingEnabled();
 63  
     }
 64  
 
 65  
     public void setJdbcMonitoringEnabled(boolean jdbcMonitoringEnabled) {
 66  0
         config.setProperty(KEY_JDBC_MONITORING_ENABLED, jdbcMonitoringEnabled);
 67  0
     }
 68  
 
 69  
     public boolean getJdbcMonitoringEnabled() {
 70  
     	// config.setIsCallFromInfraredPropertiesMBean(true);
 71  0
     	return config.getProperty(KEY_JDBC_MONITORING_ENABLED, true);
 72  
     }
 73  
 
 74  
     public void setCollectFetchDataEnabled(boolean collectFetchDataEnabled) {
 75  0
         config.setProperty(KEY_JDBC_FETCH_STATISTICS_ENABLE, collectFetchDataEnabled);
 76  0
     }
 77  
 
 78  
     public boolean getCollectFetchDataEnabled() {
 79  
     	// config.setIsCallFromInfraredPropertiesMBean(true);
 80  0
     	return config.getProperty(KEY_JDBC_FETCH_STATISTICS_ENABLE, true);
 81  
     }
 82  
 
 83  
     public void setPruneBelowTime(long pruneBelowTime) {
 84  0
         config.setPruneThreshold(pruneBelowTime);
 85  0
     }
 86  
 
 87  
     public long getPruneBelowTime() {
 88  
     	// config.setIsCallFromInfraredPropertiesMBean(true);
 89  0
     	return config.getPruneThreshold();
 90  
     }
 91  
 
 92  
     // public String getUrlIgnoreList() {
 93  
     // // return config.getUrlIgnoreList();
 94  
     // return "";
 95  
     // }
 96  
     //
 97  
     // public void setUrlIgnoreList(String urlIgnoreList) {
 98  
     // // config.setUrlIgnoreList(urlIgnoreList);
 99  
     // }
 100  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.