"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "moskito-core/src/main/java/net/anotheria/moskito/core/config/MoskitoConfiguration.java" between
moskito-moskito-2.9.3.tar.gz and moskito-moskito-2.10.0.tar.gz

About: MoSKito (Monitoring System Kit) is a framework for java application monitoring. Sources.

MoskitoConfiguration.java  (moskito-moskito-2.9.3):MoskitoConfiguration.java  (moskito-moskito-2.10.0)
package net.anotheria.moskito.core.config; package net.anotheria.moskito.core.config;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import net.anotheria.moskito.core.config.accumulators.AccumulatorsConfig; import net.anotheria.moskito.core.config.accumulators.AccumulatorsConfig;
import net.anotheria.moskito.core.config.dashboards.DashboardsConfig; import net.anotheria.moskito.core.config.dashboards.DashboardsConfig;
import net.anotheria.moskito.core.config.errorhandling.ErrorHandlingConfig; import net.anotheria.moskito.core.config.errorhandling.ErrorHandlingConfig;
import net.anotheria.moskito.core.config.filter.FilterConfig; import net.anotheria.moskito.core.config.filter.FilterConfig;
import net.anotheria.moskito.core.config.gauges.GaugesConfig; import net.anotheria.moskito.core.config.gauges.GaugesConfig;
import net.anotheria.moskito.core.config.journey.JourneyConfig; import net.anotheria.moskito.core.config.journey.JourneyConfig;
import net.anotheria.moskito.core.config.loadfactors.LoadFactorsConfiguration;
import net.anotheria.moskito.core.config.plugins.PluginsConfig; import net.anotheria.moskito.core.config.plugins.PluginsConfig;
import net.anotheria.moskito.core.config.producers.BuiltinProducersConfig; import net.anotheria.moskito.core.config.producers.BuiltinProducersConfig;
import net.anotheria.moskito.core.config.producers.MBeanProducerConfig; import net.anotheria.moskito.core.config.producers.MBeanProducerConfig;
import net.anotheria.moskito.core.config.producers.TomcatRequestProcessorProduce rConfig; import net.anotheria.moskito.core.config.producers.TomcatRequestProcessorProduce rConfig;
import net.anotheria.moskito.core.config.tagging.TaggingConfig; import net.anotheria.moskito.core.config.tagging.TaggingConfig;
import net.anotheria.moskito.core.config.thresholds.ThresholdsAlertsConfig; import net.anotheria.moskito.core.config.thresholds.ThresholdsAlertsConfig;
import net.anotheria.moskito.core.config.thresholds.ThresholdsConfig; import net.anotheria.moskito.core.config.thresholds.ThresholdsConfig;
import net.anotheria.moskito.core.config.tracing.TracingConfiguration; import net.anotheria.moskito.core.config.tracing.TracingConfiguration;
import net.anotheria.moskito.core.stats.Interval; import net.anotheria.moskito.core.stats.Interval;
import net.anotheria.moskito.core.stats.impl.IntervalRegistry; import net.anotheria.moskito.core.stats.impl.IntervalRegistry;
import net.anotheria.moskito.core.tracer.TracerRepository;
import net.anotheria.moskito.core.util.AfterStartTasks; import net.anotheria.moskito.core.util.AfterStartTasks;
import org.configureme.annotations.AfterConfiguration; import org.configureme.annotations.AfterConfiguration;
import org.configureme.annotations.Configure; import org.configureme.annotations.Configure;
import org.configureme.annotations.ConfigureMe; import org.configureme.annotations.ConfigureMe;
import org.configureme.annotations.DontConfigure; import org.configureme.annotations.DontConfigure;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
/** /**
* This class contains complete moskito configuration at runtime. It is configur ed with ConfigureMe, but can be altered * This class contains complete moskito configuration at runtime. It is configur ed with ConfigureMe, but can be altered
* programmatically. Use MoskitoConfigurationHolder.getConfiguration/setConfigur ation to access/alter this class. * programmatically. Use MoskitoConfigurationHolder.getConfiguration/setConfigur ation to access/alter this class.
* *
* @author lrosenberg * @author lrosenberg
* @since 22.10.12 15:59 * @since 22.10.12 15:59
*/ */
@SuppressFBWarnings({"SE_BAD_FIELD", "EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
@ConfigureMe(name="moskito") @ConfigureMe(name="moskito")
public class MoskitoConfiguration implements Serializable{ public class MoskitoConfiguration implements Serializable{
/** /**
* SerialVersionUID. * SerialVersionUID.
*/ */
private static final long serialVersionUID = 6636333765192447227L; private static final long serialVersionUID = 6636333765192447227L;
@Configure @Configure
private String applicationName = ""; private String applicationName = "";
skipping to change at line 101 skipping to change at line 105
private GaugesConfig gaugesConfig = new GaugesConfig(); private GaugesConfig gaugesConfig = new GaugesConfig();
/** /**
* Config object for dashboards. * Config object for dashboards.
*/ */
@Configure @Configure
@SerializedName("@dashboardsConfig") @SerializedName("@dashboardsConfig")
private DashboardsConfig dashboardsConfig = new DashboardsConfig(); private DashboardsConfig dashboardsConfig = new DashboardsConfig();
/** /**
* Configuration object for load factors (beta).
*/
@Configure
@SerializedName("@loadFactorsConfig")
private LoadFactorsConfiguration loadFactorsConfig = new LoadFactorsConfi
guration();
/**
* Config object for accumulators. * Config object for accumulators.
*/ */
@Configure @Configure
@SerializedName("@accumulatorsConfig") @SerializedName("@accumulatorsConfig")
private AccumulatorsConfig accumulatorsConfig = new AccumulatorsConfig(); private AccumulatorsConfig accumulatorsConfig = new AccumulatorsConfig();
/** /**
* Config objects for plugins. * Config objects for plugins.
*/ */
@Configure @Configure
skipping to change at line 150 skipping to change at line 161
private TracingConfiguration tracingConfig = new TracingConfiguration(); private TracingConfiguration tracingConfig = new TracingConfiguration();
/** /**
* Configuration for journey handling. * Configuration for journey handling.
*/ */
@Configure @Configure
@SerializedName("@journeyConfig") @SerializedName("@journeyConfig")
private JourneyConfig journeyConfig = new JourneyConfig(); private JourneyConfig journeyConfig = new JourneyConfig();
/** /**
* Configuration for error config. It configures the behaviour of the bui lt in error procuder. * Configuration for error config. It configures the behaviour of the bui lt in error producer.
*/ */
@Configure @Configure
@SerializedName("@errorHandlingConfig") @SerializedName("@errorHandlingConfig")
private ErrorHandlingConfig errorHandlingConfig = new ErrorHandlingConfig (); private ErrorHandlingConfig errorHandlingConfig = new ErrorHandlingConfig ();
/** /**
* Configuration of generic filters. * Configuration of generic filters.
*/ */
@Configure @Configure
@SerializedName("@filterConfig") @SerializedName("@filterConfig")
skipping to change at line 320 skipping to change at line 331
AfterStartTasks.submitTask(new Runnable() { AfterStartTasks.submitTask(new Runnable() {
@Override @Override
public void run() { public void run() {
if (errorHandlingConfig!=null) if (errorHandlingConfig!=null)
errorHandlingConfig.afterConfiguration(); errorHandlingConfig.afterConfiguration();
} }
}); });
} }
@AfterConfiguration public void executeAfterConfigurationTasks(){
AfterStartTasks.submitTask(new Runnable() {
@Override
public void run() {
//check if there are any tracers already configur
ed (fix for https://github.com/anotheria/moskito/issues/235)
String[] configuredTracers = getTracingConfig().g
etTracers();
if (configuredTracers!=null && configuredTracers.
length!=0){
for (String producerId : configuredTracer
s){
TracerRepository.getInstance().en
ableTracingForProducerId(producerId);
}
}
}
});
}
private void createIntervals(){ private void createIntervals(){
if (intervals==null || intervals.length==0) if (intervals==null || intervals.length==0)
throw new IllegalStateException("Can't run moskito without interv als at all"); throw new IllegalStateException("Can't run moskito without interv als at all");
String[] toConfigure = intervals; //copy variable so it won't be changed within the call. String[] toConfigure = intervals; //copy variable so it won't be changed within the call.
Interval[] newConfiguredIntervals = new Interval[toConfigure.length]; Interval[] newConfiguredIntervals = new Interval[toConfigure.length];
for (int i=0; i<toConfigure.length; i++){ for (int i=0; i<toConfigure.length; i++){
Interval newInterval = IntervalRegistry.getInstance().getInterval (toConfigure[i]); Interval newInterval = IntervalRegistry.getInstance().getInterval (toConfigure[i]);
newConfiguredIntervals[i] = newInterval; newConfiguredIntervals[i] = newInterval;
} }
configuredIntervals = newConfiguredIntervals; configuredIntervals = newConfiguredIntervals;
skipping to change at line 352 skipping to change at line 379
return Arrays.asList(intervals); return Arrays.asList(intervals);
} }
public KillSwitchConfiguration getKillSwitch() { public KillSwitchConfiguration getKillSwitch() {
return killSwitch; return killSwitch;
} }
public void setKillSwitch(KillSwitchConfiguration killSwitch) { public void setKillSwitch(KillSwitchConfiguration killSwitch) {
this.killSwitch = killSwitch; this.killSwitch = killSwitch;
} }
public LoadFactorsConfiguration getLoadFactorsConfig() {
return loadFactorsConfig;
}
public void setLoadFactorsConfig(LoadFactorsConfiguration loadFactorsConf
ig) {
this.loadFactorsConfig = loadFactorsConfig;
}
} }
 End of changes. 8 change blocks. 
1 lines changed or deleted 43 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)