Package org.rhq.core.pluginapi.util

Examples of org.rhq.core.pluginapi.util.ResponseTimeConfiguration


    @Override
    public void start(ResourceContext<BaseComponent<?>> resourceContext) throws InvalidPluginConfigurationException, Exception {
        super.start(resourceContext);

        Configuration pluginConfig = resourceContext.getPluginConfiguration();
        ResponseTimeConfiguration responseTimeConfig = new ResponseTimeConfiguration(pluginConfig);
        File logFile = responseTimeConfig.getLogFile();
        if (logFile == null) {
            logFile = findLogFile();
        }

        if (logFile != null) {
            if (getLog().isDebugEnabled()) {
                if (logFile.isFile()) {
                    getLog().debug("[" + resourceContext.getResourceKey() + "] is using the response time log file ["
                        + logFile + "]");
                } else {
                    getLog().debug("The response time log file [" + logFile + "] for ["
                        + resourceContext.getResourceKey() + "] does not exist yet.");
                }
            }

            this.responseTimeLogParser = new ResponseTimeLogParser(logFile);
            this.responseTimeLogParser.setExcludes(responseTimeConfig.getExcludes());
            this.responseTimeLogParser.setTransforms(responseTimeConfig.getTransforms());
        } else {
            if (getLog().isDebugEnabled()) {
                getLog().debug("Cannot monitor response time for [" + resourceContext.getResourceKey()
                    + "] - unknown log file location");
            }
View Full Code Here


    public void start(ResourceContext<TomcatVHostComponent> resourceContext) {
        super.start(resourceContext);
        Configuration pluginConfig = getResourceContext().getPluginConfiguration();
        this.webModuleMBean = getWebModuleMBean();

        ResponseTimeConfiguration responseTimeConfig = new ResponseTimeConfiguration(pluginConfig);
        File logFile = responseTimeConfig.getLogFile();
        if (logFile != null) {
            this.logParser = new ResponseTimeLogParser(logFile);
            this.logParser.setExcludes(responseTimeConfig.getExcludes());
            this.logParser.setTransforms(responseTimeConfig.getTransforms());
        }
    }
View Full Code Here

                throw new Exception("Value of '" + URL_CONFIG_PROP + "' connection property ('" + url
                    + "') is not a valid URL.");
            }
        }

        ResponseTimeConfiguration responseTimeConfig = new ResponseTimeConfiguration(pluginConfig);
        File logFile = responseTimeConfig.getLogFile();
        if (logFile != null) {
            this.logParser = new ResponseTimeLogParser(logFile, RESPONSE_TIME_LOG_TIME_MULTIPLIER);
            this.logParser.setExcludes(responseTimeConfig.getExcludes());
            this.logParser.setTransforms(responseTimeConfig.getTransforms());
        }
        this.lastKnownAvailability = UP;
    }
View Full Code Here

    public void start(ResourceContext<ProfileServiceComponent<?>> resourceContext) throws Exception {
        super.start(resourceContext);
        Configuration pluginConfig = getResourceContext().getPluginConfiguration();
        this.servletComponentNamesRegex = ResourceComponentUtils.replacePropertyExpressionsInTemplate(
            SERVLET_COMPONENT_NAMES_REGEX_TEMPLATE, pluginConfig);
        ResponseTimeConfiguration responseTimeConfig = new ResponseTimeConfiguration(pluginConfig);
        File logFile = responseTimeConfig.getLogFile();
        if (logFile != null) {
            this.logParser = new ResponseTimeLogParser(logFile);
            this.logParser.setExcludes(responseTimeConfig.getExcludes());
            this.logParser.setTransforms(responseTimeConfig.getTransforms());
        }
    }
View Full Code Here

        super.start(resourceContext);
        Configuration pluginConfig = getResourceContext().getPluginConfiguration();
        this.jbossWebMBean = getJBossWebMBean();
        this.vhost = pluginConfig.getSimple(VHOST_CONFIG_PROP).getStringValue();
        this.contextRoot = pluginConfig.getSimple(CONTEXT_ROOT_CONFIG_PROP).getStringValue();
        ResponseTimeConfiguration responseTimeConfig = new ResponseTimeConfiguration(pluginConfig);

        File logFile = responseTimeConfig.getLogFile();
        if (logFile != null) {
            this.logParser = new ResponseTimeLogParser(logFile);
            this.logParser.setExcludes(responseTimeConfig.getExcludes());
            this.logParser.setTransforms(responseTimeConfig.getTransforms());
        }
    }
View Full Code Here

        this.resourceContext = resourceContext;

        String logDirectory = getLogDirectory();
        //        String collectionTZ = getResponseTimeCollectionTimeZone();
        String logFormat = getResponseTimeLogFormat();
        ResponseTimeConfiguration responseTimeConfiguration = getResponseTimeConfiguration();

        if (logFormat == null) {
            throw new InvalidPluginConfigurationException("The 'responseTimeLogFormat' property must be specified.");
        }
View Full Code Here

    public String getSiteName() {
        return this.resourceContext.getPluginConfiguration().getSimpleValue("siteName", null);
    }

    public ResponseTimeConfiguration getResponseTimeConfiguration() {
        return new ResponseTimeConfiguration(resourceContext.getPluginConfiguration());
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.pluginapi.util.ResponseTimeConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.