All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.petals.binding.soap.monitoring.Monitoring Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2012 EBM WebSourcing, 2012-2023 Linagora
 *
 * This program/library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or (at your
 * option) any later version.
 *
 * This program/library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program/library; If not, see http://www.gnu.org/licenses/
 * for the GNU Lesser General Public License version 2.1.
 */
package org.ow2.petals.binding.soap.monitoring;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Timer;

import javax.management.MBeanNotificationInfo;
import javax.management.openmbean.CompositeDataSupport;
import javax.management.openmbean.CompositeType;
import javax.management.openmbean.OpenDataException;
import javax.management.openmbean.OpenType;
import javax.management.openmbean.SimpleType;
import javax.management.openmbean.TabularData;
import javax.management.openmbean.TabularDataSupport;
import javax.management.openmbean.TabularType;

import org.apache.axis2.client.ServiceClient;
import org.apache.commons.pool2.impl.GenericObjectPool;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.ow2.petals.binding.soap.listener.incoming.jetty.IncomingProbes;
import org.ow2.petals.binding.soap.listener.incoming.jetty.IncomingServiceKey;
import org.ow2.petals.binding.soap.listener.outgoing.OutgoingProbes;
import org.ow2.petals.binding.soap.listener.outgoing.ServiceClientKey;
import org.ow2.petals.binding.soap.monitoring.defect.HTTPServerThreadPoolExhaustedDefectCreator;
import org.ow2.petals.binding.soap.monitoring.defect.ServiceClientPoolExhaustedDefectCreator;
import org.ow2.petals.binding.soap.monitoring.sensor.HttpThreadPoolActiveThreadsDefectDetector;
import org.ow2.petals.binding.soap.monitoring.sensor.HttpThreadPoolActiveThreadsGaugeSensor;
import org.ow2.petals.binding.soap.monitoring.sensor.HttpThreadPoolIdleThreadsGaugeSensor;
import org.ow2.petals.binding.soap.monitoring.sensor.HttpThreadPoolQueuedRequestsGaugeSensor;
import org.ow2.petals.binding.soap.monitoring.sensor.WsClientPoolExhaustionsDefectDetector;
import org.ow2.petals.binding.soap.monitoring.sensor.WsClientPoolsClientsInUseGaugeSensor;
import org.ow2.petals.component.framework.clientserver.api.monitoring.exception.MonitoringProbeNotInitializedException;
import org.ow2.petals.component.framework.clientserver.api.monitoring.exception.MonitoringProbeNotStartedException;
import org.ow2.petals.component.framework.clientserver.api.monitoring.exception.MonitoringServiceException;
import org.ow2.petals.probes.api.KeyedProbesFactory;
import org.ow2.petals.probes.api.KeyedProbesFactoryBuilder;
import org.ow2.petals.probes.api.ProbesFactory;
import org.ow2.petals.probes.api.ProbesFactoryBuilder;
import org.ow2.petals.probes.api.exceptions.MultipleProbesFactoriesFoundException;
import org.ow2.petals.probes.api.exceptions.NoProbesFactoryFoundException;
import org.ow2.petals.probes.api.exceptions.NoResponseTimeException;
import org.ow2.petals.probes.api.exceptions.ProbeInitializationException;
import org.ow2.petals.probes.api.exceptions.ProbeInitializedException;
import org.ow2.petals.probes.api.exceptions.ProbeNotInitializedException;
import org.ow2.petals.probes.api.exceptions.ProbeNotStartedException;
import org.ow2.petals.probes.api.exceptions.ProbeShutdownException;
import org.ow2.petals.probes.api.exceptions.ProbeStartedException;
import org.ow2.petals.probes.api.exceptions.ProbeStartupException;
import org.ow2.petals.probes.api.exceptions.ProbeStopException;
import org.ow2.petals.probes.api.key.ExecutionStatusProbeKey;
import org.ow2.petals.probes.api.key.ProbeKey;
import org.ow2.petals.probes.api.key.StringProbeKey;
import org.ow2.petals.probes.api.probes.CounterProbe;
import org.ow2.petals.probes.api.probes.GaugeProbe;
import org.ow2.petals.probes.api.probes.KeyedCounterProbe;
import org.ow2.petals.probes.api.probes.KeyedCounterProbeWithExecutionStatus;
import org.ow2.petals.probes.api.probes.KeyedGaugeProbe;
import org.ow2.petals.probes.api.probes.KeyedResponseTimeProbe;
import org.ow2.petals.probes.api.probes.ResponseTimeRelativeValues;

/**
 * The monitoring MBean of the BC SOAP
 *
 * @author Christophe DENEUX (PetalsLink)
 * @author Pierre SOUQUET - Linagora
 */
public class Monitoring extends org.ow2.petals.component.framework.monitoring.Monitoring implements MonitoringMBean {

    // --- Probes --- //

    private static String[] OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_ITEM_NAMES;

    private static TabularType OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE;

    private static TabularType INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE;

    private static String[] INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_ITEM_NAMES;

    /**
     * The probe counting unknown URLs received by the Jetty server.
     */
    private final CounterProbe probeUnknownServlet;

    /**
     * The probe counting information URLs received by the Jetty server.
     */
    private final CounterProbe probeInformationServlet;

    /**
     * The probe counting request to get service contract (WSDL) received by the Jetty server.
     */
    private final KeyedCounterProbe probeServiceContractsServlet;

    /**
     * The probe counting service invocation by web-service, web-service client and execution status, received by the
     * Jetty server.
     */
    private final KeyedCounterProbeWithExecutionStatus probeHttpRequestsInvocationsCount;

    /**
     * The probe measuring the response time of service invocation by web-service, web-service client and execution
     * status, received by the Jetty server.
     */
    private final KeyedResponseTimeProbe probeIncomingWsRequestResponseTime;

    /**
     * The probe measuring the response time of WS client invocation by external web-service, operation, MEP and
     * execution status.
     */
    private final KeyedResponseTimeProbe probeOutgoingWsRequestResponseTime;

    /**
     * The probe counting active threads of HTTP server thread pool.
     */
    private final GaugeProbe probeHttpServerThreadPoolActiveThreads;

    /**
     * The probe counting idle threads in the thread pool of the HTTP server.
     */
    private final GaugeProbe probeHttpServerThreadPoolIdleThreads;

    /**
     * The probe counting requests in the queue of the thread pool of the HTTP server.
     */
    private final GaugeProbe probeHttpServerThreadPoolQueuedRequests;

    /**
     * The probe counting allocated ws-clients in the pool.
     */
    private final KeyedGaugeProbe probeWsClientPoolClientsInUse;

    /**
     * The probe counting the number of ws-client pool exhaustions.
     */
    private final KeyedCounterProbe probeWsClientPoolExhaustions;

    /**
     * The probe counting external web-service invocation by web-service, web-service operation and MEP.
     */
    private final KeyedCounterProbeWithExecutionStatus probeWsRequestsInvocationsCount;

    /**
     * The thread pool of the HTTP server
     */
    private QueuedThreadPool httpThreadPool;

    /**
     * The pools of service clients used to call external web services.
     */
    private Map> wsClientPools;

    /**
     * Technical monitoring probes needed by incoming request processing
     */
    private final IncomingProbes incomingProbes;

    /**
     * Technical monitoring probes needed by outgoing request processing
     */
    private final OutgoingProbes outgoingProbes;

    /**
     * Sensor attached to the active threads of the HTTP thread pool.
     */
    private final HttpThreadPoolActiveThreadsGaugeSensor httpThreadPoolActiveThreadsGaugeSensor;

    /**
     * Defect detector attached to the active threads of the HTTP thread pool.
     */
    private final HttpThreadPoolActiveThreadsDefectDetector httpThreadPoolActiveThreadsDefectDetector;

    /**
     * Defect creator attached to the defect 'HTTP thread pool exhausted'.
     */
    private final HTTPServerThreadPoolExhaustedDefectCreator httpServerThreadPoolExhaustedDefectCreator;

    /**
     * Sensor attached to the idle threads of the HTTP thread pool.
     */
    private final HttpThreadPoolIdleThreadsGaugeSensor httpThreadPoolIdleThreadsGaugeSensor;

    /**
     * Sensor attached to the queued requests of the HTTP thread pool.
     */
    private final HttpThreadPoolQueuedRequestsGaugeSensor httpThreadPoolQueuedRequestsGaugeSensor;

    /**
     * Sensor attached to the clients in use of the pools of service clients
     */
    private final WsClientPoolsClientsInUseGaugeSensor wsClientPoolsClientsInUseGaugeSensor;

    /**
     * Defect creator attached to the defect 'Web-service client pool exhausted'.
     */
    private final ServiceClientPoolExhaustedDefectCreator serviceClientPoolExhaustedDefectCreator;

    // --- OpenMBean Types --- //

    private static final String[] INCOMING_WS_REQUESTS_COUNTER_ITEM_NAMES;

    private static final TabularType INCOMING_WS_REQUESTS_COUNTER_TABULAR_TYPE;

    private static final String[] INCOMING_WS_REQUESTS_RESPONSE_TIME_ABS_ITEM_NAMES;

    private static final TabularType INCOMING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE;

    private static final String[] INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_ITEM_NAMES;

    private static final TabularType INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE;

    private static final String[] OUTGOING_WS_REQUESTS_COUNTER_ITEM_NAMES;

    private static final TabularType OUTGOING_WS_REQUESTS_COUNTER_TABULAR_TYPE;

    private static final String[] OUTGOING_WS_REQUESTS_RESPONSE_TIME_ABS_ITEM_NAMES;

    private static final TabularType OUTGOING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE;

    private static final String[] OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_ITEM_NAMES;

    private static final TabularType OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE;

    private static final String[] WS_CLIENT_POOL_CLIENTS_IN_USE_MAX_ITEM_NAMES;

    private static final TabularType WS_CLIENT_POOL_CLIENTS_IN_USE_MAX_TABULAR_TYPE;

    private static final String[] WS_CLIENT_POOL_CLIENTS_IN_USE_CURRENT_ITEM_NAMES;

    private static final TabularType WS_CLIENT_POOL_CLIENTS_IN_USE_CURRENT_TABULAR_TYPE;

    private static final String[] WS_CLIENT_POOL_EXHAUSTION_ITEM_NAMES;

    private static final TabularType WS_CLIENT_POOL_EXHAUSTION_TABULAR_TYPE;

    private static final String[] SERVICE_CONTRACTS_COUNTER_ITEM_NAMES;

    private static final TabularType SERVICE_CONTRACTS_COUNTER_TABULAR_TYPE;

    /**
     * Creates the monitoring MBean
     *
     * @param responseTimeProbesTimer
     *            The timer used as sampler by response time probes. The caller is responsible to cancel the timer to
     *            free resources attached.
     * @param samplePeriod
     *            The duration of a sample, in milliseconds.
     * @throws NoProbesFactoryFoundException
     *             No probe implementation found in the classloader
     * @throws MultipleProbesFactoriesFoundException
     *             Several probe implementations found in the classloader
     */
    public Monitoring(final Timer responseTimeProbesTimer, final long samplePeriod)
            throws MultipleProbesFactoriesFoundException, NoProbesFactoryFoundException {

        super(responseTimeProbesTimer, samplePeriod);

        final ProbesFactoryBuilder probesFactoryBuilder = new ProbesFactoryBuilder();
        final ProbesFactory probesFactory = probesFactoryBuilder.getProbesFactory();

        this.probeUnknownServlet = probesFactory.createCounterProbe();
        this.probeInformationServlet = probesFactory.createCounterProbe();
        this.httpThreadPoolActiveThreadsGaugeSensor = new HttpThreadPoolActiveThreadsGaugeSensor();
        this.httpServerThreadPoolExhaustedDefectCreator = new HTTPServerThreadPoolExhaustedDefectCreator(this);
        this.httpThreadPoolActiveThreadsDefectDetector = new HttpThreadPoolActiveThreadsDefectDetector(
                new HTTPServerThreadPoolExhaustedDefectCreator(this));
        this.probeHttpServerThreadPoolActiveThreads = probesFactory.createGaugeProbe(
                this.httpThreadPoolActiveThreadsGaugeSensor, this.httpThreadPoolActiveThreadsDefectDetector);
        this.httpThreadPoolIdleThreadsGaugeSensor = new HttpThreadPoolIdleThreadsGaugeSensor();
        this.probeHttpServerThreadPoolIdleThreads = probesFactory
                .createGaugeProbe(this.httpThreadPoolIdleThreadsGaugeSensor);
        this.httpThreadPoolQueuedRequestsGaugeSensor = new HttpThreadPoolQueuedRequestsGaugeSensor();
        this.probeHttpServerThreadPoolQueuedRequests = probesFactory
                .createGaugeProbe(this.httpThreadPoolQueuedRequestsGaugeSensor);

        this.probeServiceContractsServlet = new KeyedProbesFactoryBuilder()
                .getKeyedProbesFactory().createKeyedCounterProbe();

        final KeyedProbesFactoryBuilder incomingProbesFactoryBuilder = new KeyedProbesFactoryBuilder();
        final KeyedProbesFactory incomingProbesFactory = incomingProbesFactoryBuilder
                .getKeyedProbesFactory();

        this.probeHttpRequestsInvocationsCount = incomingProbesFactory.createKeyedCounterProbeWithExecutionStatus();
        this.probeIncomingWsRequestResponseTime = incomingProbesFactory.createKeyedResponseTimeProbe(
                responseTimeProbesTimer, samplePeriod);
        this.incomingProbes = new IncomingProbes(this.probeUnknownServlet, this.probeInformationServlet,
                this.probeServiceContractsServlet, this.probeHttpServerThreadPoolActiveThreads,
                this.probeHttpServerThreadPoolIdleThreads, this.probeHttpServerThreadPoolQueuedRequests,
                this.probeHttpRequestsInvocationsCount, this.probeIncomingWsRequestResponseTime);

        final KeyedProbesFactoryBuilder outgoingProbesFactoryBuilder = new KeyedProbesFactoryBuilder();
        final KeyedProbesFactory outgoingProbesFactory = outgoingProbesFactoryBuilder
                .getKeyedProbesFactory();

        this.probeOutgoingWsRequestResponseTime = outgoingProbesFactory.createKeyedResponseTimeProbe(
                responseTimeProbesTimer, samplePeriod);
        this.serviceClientPoolExhaustedDefectCreator = new ServiceClientPoolExhaustedDefectCreator(this);
        this.probeWsClientPoolExhaustions = outgoingProbesFactory
                .createKeyedCounterProbe(new WsClientPoolExhaustionsDefectDetector(
                        this.serviceClientPoolExhaustedDefectCreator));
        this.wsClientPoolsClientsInUseGaugeSensor = new WsClientPoolsClientsInUseGaugeSensor();
        this.probeWsClientPoolClientsInUse = outgoingProbesFactory
                .createKeyedGaugeProbe(this.wsClientPoolsClientsInUseGaugeSensor);
        this.probeWsRequestsInvocationsCount = outgoingProbesFactory.createKeyedCounterProbeWithExecutionStatus();

        this.outgoingProbes = new OutgoingProbes(this.probeWsClientPoolClientsInUse, this.probeWsClientPoolExhaustions,
                this.probeWsRequestsInvocationsCount, this.probeOutgoingWsRequestResponseTime);

    }

    @Override
    public void doInit() throws ProbeInitializedException, ProbeStartedException, ProbeInitializationException {

        this.probeUnknownServlet.init();
        this.probeInformationServlet.init();
        this.probeServiceContractsServlet.init();
        this.probeHttpServerThreadPoolActiveThreads.init();
        this.probeHttpServerThreadPoolIdleThreads.init();
        this.probeHttpServerThreadPoolQueuedRequests.init();
        this.probeHttpRequestsInvocationsCount.init();
        this.probeIncomingWsRequestResponseTime.init();
        this.probeWsClientPoolClientsInUse.init();
        this.probeWsClientPoolExhaustions.init();
        this.probeWsRequestsInvocationsCount.init();
        this.probeOutgoingWsRequestResponseTime.init();
    }

    public void setHttpThreadPool(final QueuedThreadPool httpThreadPool) {
        this.httpThreadPool = httpThreadPool;
    }

    public void setWsClientPools(final Map> wsClientPools) {
        this.wsClientPools = wsClientPools;
    }

    @Override
    public void doStart() throws ProbeNotInitializedException, ProbeStartedException, ProbeStartupException {
        this.httpThreadPoolActiveThreadsDefectDetector.setHttpThreadPool(this.httpThreadPool);
        this.httpThreadPoolActiveThreadsGaugeSensor.setHttpThreadPool(this.httpThreadPool);
        this.httpThreadPoolIdleThreadsGaugeSensor.setHttpThreadPool(this.httpThreadPool);
        this.httpThreadPoolQueuedRequestsGaugeSensor.setHttpThreadPool(this.httpThreadPool);

        this.wsClientPoolsClientsInUseGaugeSensor.setWsClientPools(this.wsClientPools);

        this.probeUnknownServlet.start();
        this.probeInformationServlet.start();
        this.probeServiceContractsServlet.start();
        this.probeHttpServerThreadPoolActiveThreads.start();
        this.probeHttpServerThreadPoolIdleThreads.start();
        this.probeHttpServerThreadPoolQueuedRequests.start();
        this.probeHttpRequestsInvocationsCount.start();
        this.probeIncomingWsRequestResponseTime.start();
        this.probeWsClientPoolClientsInUse.start();
        this.probeWsClientPoolExhaustions.start();
        this.probeWsRequestsInvocationsCount.start();
        this.probeOutgoingWsRequestResponseTime.start();
    }

    @Override
    public void doStop() throws ProbeNotInitializedException, ProbeNotStartedException, ProbeStopException {
        this.probeUnknownServlet.stop();
        this.probeInformationServlet.stop();
        this.probeServiceContractsServlet.stop();
        this.probeHttpServerThreadPoolActiveThreads.stop();
        this.probeHttpServerThreadPoolIdleThreads.stop();
        this.probeHttpServerThreadPoolQueuedRequests.stop();
        this.probeHttpRequestsInvocationsCount.stop();
        this.probeIncomingWsRequestResponseTime.stop();
        this.probeWsClientPoolClientsInUse.stop();
        this.probeWsClientPoolExhaustions.stop();
        this.probeWsRequestsInvocationsCount.stop();
        this.probeOutgoingWsRequestResponseTime.stop();
    }

    @Override
    public void doShutdown() throws ProbeShutdownException, ProbeStartedException, ProbeNotInitializedException {
        this.probeUnknownServlet.shutdown();
        this.probeInformationServlet.shutdown();
        this.probeServiceContractsServlet.shutdown();
        this.probeHttpServerThreadPoolActiveThreads.shutdown();
        this.probeHttpServerThreadPoolIdleThreads.shutdown();
        this.probeHttpServerThreadPoolQueuedRequests.shutdown();
        this.probeHttpRequestsInvocationsCount.shutdown();
        this.probeIncomingWsRequestResponseTime.shutdown();
        this.probeWsClientPoolClientsInUse.shutdown();
        this.probeWsClientPoolExhaustions.shutdown();
        this.probeWsRequestsInvocationsCount.shutdown();
        this.probeOutgoingWsRequestResponseTime.shutdown();
    }

    @Override
    public List addNotificationInfo() {
        return Arrays.asList(new MBeanNotificationInfo[] {
                this.httpServerThreadPoolExhaustedDefectCreator.getNotificationInfo(),
                this.serviceClientPoolExhaustedDefectCreator.getNotificationInfo() });
    }

    // Probe accessors //

    /**
     * @return Technical monitoring probes needed by incoming request processing
     */
    public IncomingProbes getIncomingProbes() {
        return this.incomingProbes;
    }

    /**
     * @return Technical monitoring probes needed by outgoing request processing
     */
    public OutgoingProbes getOutgoingProbes() {
        return this.outgoingProbes;
    }

    // ---------------- //

    @Override
    public long getHttpServerThreadPoolMaxSize() throws MonitoringServiceException {
        return this.httpThreadPool.getMaxThreads();
    }

    @Override
    public long getHttpServerThreadPoolMinSize() throws MonitoringServiceException {
        return this.httpThreadPool.getMinThreads();
    }

    @Override
    public long getHttpServerThreadPoolActiveThreadsMax()
            throws MonitoringProbeNotInitializedException,
            MonitoringServiceException {
        try {
            return this.probeHttpServerThreadPoolActiveThreads.getMaxValue();
        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    @Override
    public long getHttpServerThreadPoolActiveThreadsCurrent()
            throws MonitoringProbeNotStartedException,
            MonitoringServiceException {
        try {
            return this.probeHttpServerThreadPoolActiveThreads.getInstantValue();
        } catch (final ProbeNotStartedException e) {
            throw new MonitoringProbeNotStartedException(e);
        }
    }

    @Override
    public long getHttpServerThreadPoolIdleThreadsMax() throws MonitoringProbeNotInitializedException,
            MonitoringServiceException {
        try {
            return this.probeHttpServerThreadPoolIdleThreads.getMaxValue();
        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    @Override
    public long getHttpServerThreadPoolIdleThreadsCurrent() throws MonitoringProbeNotStartedException,
            MonitoringServiceException {
        try {
            return this.probeHttpServerThreadPoolIdleThreads.getInstantValue();
        } catch (final ProbeNotStartedException e) {
            throw new MonitoringProbeNotStartedException(e);
        }
    }

    @Override
    public long getHttpServerThreadPoolQueuedRequestsMax() throws MonitoringProbeNotInitializedException,
            MonitoringServiceException {
        try {
            return this.probeHttpServerThreadPoolQueuedRequests.getMaxValue();
        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    @Override
    public long getHttpServerThreadPoolQueuedRequestsCurrent() throws MonitoringProbeNotStartedException,
            MonitoringServiceException {
        try {
            return this.probeHttpServerThreadPoolQueuedRequests.getInstantValue();
        } catch (final ProbeNotStartedException e) {
            throw new MonitoringProbeNotStartedException(e);
        }
    }

    // -------------------//

    @Override
    public long getUnknownURLsCounter() throws MonitoringProbeNotInitializedException, MonitoringServiceException {
        try {
            return this.probeUnknownServlet.getValue();
        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    // -------------------//

    @Override
    public long getInformationURLsCounter() throws MonitoringProbeNotInitializedException, MonitoringServiceException {
        try {
            return this.probeInformationServlet.getValue();
        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    // -------------------//

    @Override
    public TabularData getServiceContractsCounter()
            throws MonitoringProbeNotInitializedException, MonitoringServiceException, OpenDataException {
        try {
            assert SERVICE_CONTRACTS_COUNTER_TABULAR_TYPE != null;
            final TabularDataSupport tabServiceContract = new TabularDataSupport(SERVICE_CONTRACTS_COUNTER_TABULAR_TYPE);

            final Iterator> itValues = this.probeServiceContractsServlet.getConvertedValues()
                    .entrySet().iterator();

            while (itValues.hasNext()) {
                final Entry entry = itValues.next();

                final CompositeDataSupport support = new CompositeDataSupport(
                        SERVICE_CONTRACTS_COUNTER_TABULAR_TYPE.getRowType(),
                        SERVICE_CONTRACTS_COUNTER_ITEM_NAMES,
                        new Object[] { entry.getKey()[0], entry.getValue() });

                tabServiceContract.put(support);
            }
            return tabServiceContract;
        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    // -------------------//

    @Override
    public TabularData getWsClientPoolClientsInUseMax()
            throws MonitoringProbeNotInitializedException, MonitoringServiceException, OpenDataException {
        try {
            assert WS_CLIENT_POOL_CLIENTS_IN_USE_MAX_TABULAR_TYPE != null;

            final Map maxClientInUse = this.probeWsClientPoolClientsInUse.getConvertedMaxValues();

            final TabularDataSupport tabClientsInUse = new TabularDataSupport(
                    WS_CLIENT_POOL_CLIENTS_IN_USE_MAX_TABULAR_TYPE);

            for (final Entry e : maxClientInUse.entrySet()) {
                final String[] keys = e.getKey();
                assert keys.length == 3;

                final Object[] itemValues = new Object[] { keys[0], keys[1], keys[2], e.getValue() };
                final CompositeDataSupport support = new CompositeDataSupport(
                        WS_CLIENT_POOL_CLIENTS_IN_USE_MAX_TABULAR_TYPE.getRowType(),
                        WS_CLIENT_POOL_CLIENTS_IN_USE_MAX_ITEM_NAMES, itemValues);

                tabClientsInUse.put(support);
            }
            return tabClientsInUse;
        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    @Override
    public TabularData getWsClientPoolClientsInUseCurrent()
            throws MonitoringProbeNotStartedException, MonitoringServiceException, OpenDataException {
        try {
            assert WS_CLIENT_POOL_CLIENTS_IN_USE_CURRENT_TABULAR_TYPE != null;

            final Map currentClientInUse = this.probeWsClientPoolClientsInUse.getConvertedInstantValues();

            final TabularDataSupport tabClientsInUse = new TabularDataSupport(
                    WS_CLIENT_POOL_CLIENTS_IN_USE_CURRENT_TABULAR_TYPE);

            for (final Entry e : currentClientInUse.entrySet()) {
                final String[] keys = e.getKey();
                assert keys.length == 3;

                final Object[] itemValues = new Object[] { keys[0], keys[1], keys[2], e.getValue() };

                final CompositeDataSupport support = new CompositeDataSupport(
                        WS_CLIENT_POOL_CLIENTS_IN_USE_CURRENT_TABULAR_TYPE.getRowType(),
                        WS_CLIENT_POOL_CLIENTS_IN_USE_CURRENT_ITEM_NAMES, itemValues);

                tabClientsInUse.put(support);
            }
            return tabClientsInUse;
        } catch (final ProbeNotStartedException e) {
            throw new MonitoringProbeNotStartedException(e);
        }
    }

    @Override
    public TabularData getWsClientPoolExhaustions()
            throws MonitoringProbeNotInitializedException, MonitoringServiceException, OpenDataException {
        try {
            assert WS_CLIENT_POOL_EXHAUSTION_TABULAR_TYPE != null;

            final Map currentClientInUse = this.probeWsClientPoolExhaustions.getConvertedValues();
            final TabularDataSupport tabExhaustion = new TabularDataSupport(WS_CLIENT_POOL_EXHAUSTION_TABULAR_TYPE);

            for (final Entry e : currentClientInUse.entrySet()) {
                final String[] keys = e.getKey();
                assert keys.length == 3;

                final Object[] itemValues = new Object[] { keys[0], keys[1], keys[2], e.getValue() };

                final CompositeDataSupport support = new CompositeDataSupport(
                        WS_CLIENT_POOL_EXHAUSTION_TABULAR_TYPE.getRowType(), WS_CLIENT_POOL_EXHAUSTION_ITEM_NAMES,
                        itemValues);

                tabExhaustion.put(support);
            }
            return tabExhaustion;
        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    @Override
    public TabularData getIncomingWsRequestsCounter() throws MonitoringProbeNotInitializedException,
            MonitoringServiceException, OpenDataException {
        try {
            assert INCOMING_WS_REQUESTS_COUNTER_TABULAR_TYPE != null;

            final Map incWsReq = this.probeHttpRequestsInvocationsCount.getConvertedValues();
            final TabularDataSupport tabIncWsRequest = new TabularDataSupport(
                    INCOMING_WS_REQUESTS_COUNTER_TABULAR_TYPE);

            for (final Entry e : incWsReq.entrySet()) {
                final String[] keys = e.getKey();
                assert keys.length == 4;

                final Object[] itemValues = new Object[] { keys[0], keys[1], keys[2], keys[3], e.getValue() };

                final CompositeDataSupport support = new CompositeDataSupport(
                        INCOMING_WS_REQUESTS_COUNTER_TABULAR_TYPE.getRowType(),
                        INCOMING_WS_REQUESTS_COUNTER_ITEM_NAMES,
                        itemValues);

                tabIncWsRequest.put(support);
            }
            return tabIncWsRequest;

        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    @Override
    public TabularData getIncomingWsRequestsResponseTimeAbs()
            throws MonitoringProbeNotInitializedException, MonitoringServiceException, OpenDataException {
        try {
            assert INCOMING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE != null;

            final Map reqRespTime = this.probeIncomingWsRequestResponseTime.getConvertedAbsoluteResponseTimeValues();
            final TabularDataSupport result = new TabularDataSupport(
                    INCOMING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE);

            for (final Entry e : reqRespTime.entrySet()) {
                final String[] keys = e.getKey();
                final Long[] values = e.getValue();
                assert keys.length == 4;
                assert values.length == 3;

                final Object[] itemValues = new Object[] { keys[0], keys[1], keys[2], keys[3],
                        values[0], values[1], values[2] };

                final CompositeDataSupport support = new CompositeDataSupport(
                        INCOMING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE.getRowType(),
                        INCOMING_WS_REQUESTS_RESPONSE_TIME_ABS_ITEM_NAMES, itemValues);

                result.put(support);
            }
            return result;

        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    @Override
    public TabularData getIncomingWsRequestsResponseTimeRel()
            throws MonitoringProbeNotStartedException, MonitoringServiceException, OpenDataException {
        try {
            assert INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE != null;

            final Map invocations = this.probeIncomingWsRequestResponseTime
                    .getConvertedRelativeResponseTimeValues();
            final TabularDataSupport tabServiceInvocations = new TabularDataSupport(
                    INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE);

            for (final Entry e : invocations.entrySet()) {
                final String[] keys = e.getKey();
                final Long[] values = e.getValue();
                assert keys.length == 4;
                assert values.length == 6;

                final Object[] itemValues = new Object[] { keys[0], keys[1], keys[2], keys[3],
                        values[0], values[1], values[2], values[3], values[4], values[5] };

                final CompositeDataSupport support = new CompositeDataSupport(
                        INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE.getRowType(),
                        INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_ITEM_NAMES, itemValues);

                tabServiceInvocations.put(support);
            }
            return tabServiceInvocations;

        } catch (final ProbeNotStartedException e) {
            throw new MonitoringProbeNotStartedException(e);
        }
    }

    @Override
    public TabularData getIncomingWsRequestsResponseTimeRelGroupedBySvcOpAndExecStatus()
            throws MonitoringProbeNotStartedException, MonitoringServiceException, OpenDataException {
        try {
            final Map, LinkedList> responseTimes = this.probeIncomingWsRequestResponseTime
                    .getRelativeResponseTimes();
            final Map, LinkedList> aggregatedTimes = new HashMap, LinkedList>();

            // merge response times:
            for (final Map.Entry, LinkedList> e : responseTimes
                    .entrySet()) {
                final String[] oKey = e.getKey().getOriginalKey().toStringArray();
                final String execStatus = e.getKey().getExecutionStatus().toString();
                final List newKey = Arrays.asList(oKey[0], oKey[1], execStatus);

                if (!aggregatedTimes.containsKey(newKey)) {
                    aggregatedTimes.put(newKey, e.getValue());
                } else {
                    aggregatedTimes.get(newKey).addAll(e.getValue());
                }
            }

            assert INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE != null;
            final TabularDataSupport tabServiceInvocations = new TabularDataSupport(
                    INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE);

            for (final Entry, LinkedList> e : aggregatedTimes.entrySet()) {
                final List keys = e.getKey();
                final ResponseTimeRelativeValues values = new ResponseTimeRelativeValues(e.getValue());

                final Object[] itemValues = new Object[] { keys.get(0), keys.get(1), keys.get(2), values.getMax(),
                        values.getAvg(), values.getMin(), values.getPercent10(), values.getPercent50(),
                        values.getPercent90() };

                final CompositeDataSupport support = new CompositeDataSupport(
                        INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE.getRowType(),
                        INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_ITEM_NAMES, itemValues);

                tabServiceInvocations.put(support);
            }
            return tabServiceInvocations;

        } catch (final ProbeNotStartedException e) {
            throw new MonitoringProbeNotStartedException(e);
        } catch (final NoResponseTimeException e1) {
            throw new MonitoringServiceException(e1);
        }
    }

    @Override
    public TabularData getOutgoingWsRequestsCounter()
            throws MonitoringProbeNotInitializedException, MonitoringServiceException, OpenDataException {
        try {
            assert OUTGOING_WS_REQUESTS_COUNTER_TABULAR_TYPE != null;

            final Map outWsReq = this.probeWsRequestsInvocationsCount.getConvertedValues();
            final TabularDataSupport tabRequestCounter = new TabularDataSupport(OUTGOING_WS_REQUESTS_COUNTER_TABULAR_TYPE);

            for (final Entry e : outWsReq.entrySet()) {
                final String[] keys = e.getKey();
                assert keys.length == 4;

                final Object[] itemValues = new Object[] { keys[0], keys[1], keys[2], keys[3], e.getValue() };

                final CompositeDataSupport support = new CompositeDataSupport(
                        OUTGOING_WS_REQUESTS_COUNTER_TABULAR_TYPE.getRowType(), OUTGOING_WS_REQUESTS_COUNTER_ITEM_NAMES,
                        itemValues);

                tabRequestCounter.put(support);
            }
            return tabRequestCounter;

        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    @Override
    public TabularData getOutgoingWsRequestsResponseTimeAbs() throws MonitoringProbeNotInitializedException,
            MonitoringServiceException, OpenDataException {
        try {
            assert OUTGOING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE != null;

            final Map reqRespTime = this.probeOutgoingWsRequestResponseTime.getConvertedAbsoluteResponseTimeValues();
            final TabularDataSupport result = new TabularDataSupport(
                    OUTGOING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE);

            for (final Entry e : reqRespTime.entrySet()) {
                final String[] keys = e.getKey();
                final Long[] values = e.getValue();
                assert keys.length == 4;
                assert values.length == 3;

                final Object[] itemValues = new Object[] { keys[0], keys[1], keys[2], keys[3],
                        values[0], values[1], values[2] };

                final CompositeDataSupport support = new CompositeDataSupport(
                        OUTGOING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE.getRowType(),
                        OUTGOING_WS_REQUESTS_RESPONSE_TIME_ABS_ITEM_NAMES, itemValues);

                result.put(support);
            }
            return result;

        } catch (final ProbeNotInitializedException e) {
            throw new MonitoringProbeNotInitializedException(e);
        }
    }

    @Override
    public TabularData getOutgoingWsRequestsResponseTimeRel()
            throws MonitoringProbeNotStartedException, MonitoringServiceException, OpenDataException {
        try {
            assert OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE != null;

            final Map invocations = this.probeOutgoingWsRequestResponseTime
                    .getConvertedRelativeResponseTimeValues();
            final TabularDataSupport tabServiceInvocations = new TabularDataSupport(
                    OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE);

            for (final Entry e : invocations.entrySet()) {
                final String[] keys = e.getKey();
                final Long[] values = e.getValue();
                assert keys.length == 4;
                assert values.length == 6;

                final Object[] itemValues = new Object[] { keys[0], keys[1], keys[2], keys[3],
                        values[0], values[1], values[2], values[3], values[4], values[5] };

                final CompositeDataSupport support = new CompositeDataSupport(
                        OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE.getRowType(),
                        OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_ITEM_NAMES, itemValues);

                tabServiceInvocations.put(support);
            }
            return tabServiceInvocations;

        } catch (final ProbeNotStartedException e) {
            throw new MonitoringProbeNotStartedException(e);
        }
    }

    @Override
    public TabularData getOutgoingWsRequestsResponseTimeRelGroupedBySvcOpAndExecStatus()
            throws MonitoringProbeNotStartedException, MonitoringServiceException, OpenDataException {
        try {
            final Map, LinkedList> responseTimes = this.probeOutgoingWsRequestResponseTime
                    .getRelativeResponseTimes();
            final Map, LinkedList> aggregatedTimes = new HashMap, LinkedList>();

            // merge response times:
            for (final Map.Entry, LinkedList> e : responseTimes
                    .entrySet()) {
                final String[] oKey = e.getKey().getOriginalKey().toStringArray();
                final String execStatus = e.getKey().getExecutionStatus().toString();
                final List newKey = Arrays.asList(oKey[0], oKey[1], execStatus);

                if (!aggregatedTimes.containsKey(newKey)) {
                    aggregatedTimes.put(newKey, e.getValue());
                } else {
                    aggregatedTimes.get(newKey).addAll(e.getValue());
                }
             }

            assert OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE != null;
            final TabularDataSupport tabServiceInvocations = new TabularDataSupport(
                    OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE);

            for (final Entry, LinkedList> e : aggregatedTimes.entrySet()) {
                final List keys = e.getKey();
                final ResponseTimeRelativeValues values = new ResponseTimeRelativeValues(e.getValue());

                final Object[] itemValues = new Object[] { keys.get(0), keys.get(1), keys.get(2), values.getMax(),
                        values.getAvg(), values.getMin(), values.getPercent10(), values.getPercent50(),
                        values.getPercent90() };

                final CompositeDataSupport support = new CompositeDataSupport(
                        OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE.getRowType(),
                        OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_ITEM_NAMES, itemValues);

                tabServiceInvocations.put(support);
            }
            return tabServiceInvocations;

        } catch (final ProbeNotStartedException e) {
            throw new MonitoringProbeNotStartedException(e);
        } catch (final NoResponseTimeException e1) {
            throw new MonitoringServiceException(e1);
        }
    }

    //
    // --- OpenMbean constants initialization
    //
    static {
        try {
            // Item names set used to uniquely identify an incoming webservice requests in a TabularType (somewhat like
            // a primary key)
            final String[] incomingWsRequestsUIDItemNames = new String[] { "wsUrl", "operationName",
                    "wsClientIp", "executionStatus" };

            // Item names set used to uniquely identify an outgoing webservice requests in a TabularType (somewhat like
            // a primary key)
            final String[] outgoingWsRequestsUIDItemNames = new String[] { "wsUrl", "operationName",
                    "mep", "executionStatus" };

            // Item names set used to uniquely identify a webservice client in a TabularType (somewhat like a primary
            // key)
            final String[] wsClientUIDItemNames = new String[] { "wsUrl", "operationName", "mep", };

            //
            // --- Incoming webservice requests
            //
            INCOMING_WS_REQUESTS_COUNTER_ITEM_NAMES = new String[] {"wsUrl", "operationName",
                    "wsClientIp", "executionStatus", "value" };

            final CompositeType incomingWsRequestsCompositeType = new CompositeType(
                    "IncomingWsRequestsCounter",
                    "The number of incoming webservice requests",
                    INCOMING_WS_REQUESTS_COUNTER_ITEM_NAMES,
                    new String[] {
                            "path of the invoked web-service URL",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "ws-client IP address",
                            "operation execution status",
                            "number of incoming webservice requests since the last startup of the component" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.LONG });

            INCOMING_WS_REQUESTS_COUNTER_TABULAR_TYPE = new TabularType(
                    "IncomingWsRequestsCounter",
                    "The number of incoming webservice requests",
                    incomingWsRequestsCompositeType,
                    incomingWsRequestsUIDItemNames);

            //
            // --- Incoming webservice request ABSOLUTE response time
            //
            INCOMING_WS_REQUESTS_RESPONSE_TIME_ABS_ITEM_NAMES = new String[] { "wsUrl", "operationName",
                    "wsClientIp", "executionStatus", "maximumValue", "averageValue", "minimumValue" };

            final CompositeType incomingWsRequestsResponseTimeAbsCompositeType = new CompositeType(
                    "IncomingWsRequestsResponseTimeAbs",
                    "The aggregated response times of the incoming web-service requests since the last startup of the component",
                    INCOMING_WS_REQUESTS_RESPONSE_TIME_ABS_ITEM_NAMES,
                    new String[] {
                            "path of the invoked web-service URL",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "ws-client IP address",
                            "operation execution status",
                            "the maximum response time since the last start of the component on which the service provider is running",
                            "the average response time since the last start of the component on which the service provider is running",
                            "the minimum response time since the last start of the component on which the service provider is running" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG });

            INCOMING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE = new TabularType(
                    "IncomingWsRequestsResponseTimeAbs",
                    "Tabular representation of the aggregated response times of the incoming web-service requests since the last startup of the component",
                    incomingWsRequestsResponseTimeAbsCompositeType,
                    incomingWsRequestsUIDItemNames);

            //
            // --- Incoming webservice request RELATIVE response time
            //
            INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_ITEM_NAMES = new String[] { "wsUrl", "operationName", "wsClientIp",
                    "executionStatus", "maximumValue", "averageValue", "minimumValue", "percentile-10Value",
                    "percentile-50Value", "percentile-90Value" };

            final CompositeType incomingWsRequestsResponseTimeRelCompositeType = new CompositeType(
                    "IncomingWsRequestsResponseTimeRel",
                    "The aggregated response times of the incoming web-service requests on the last sample",
                    INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_ITEM_NAMES,
                    new String[] {
                            "path of the invoked web-service URL",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "ws-client IP address",
                            "operation execution status",
                            "the maximum response time on the last sample",
                            "the average response time on the last sample",
                            "the minimum response time on the last sample" ,
                            "the 10-percentile response time (10% of the response times are lesser than this value)",
                            "the 50-percentile response time (50% of the response times are lesser than this value)",
                            "the 90-percentile response time (90% of the response times are lesser than this value)" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG,
                            SimpleType.LONG, SimpleType.LONG });

            INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE = new TabularType(
                    "IncomingWsRequestsResponseTimeRel",
                    "The aggregated response times of the incoming web-service requests on the last sample",
                    incomingWsRequestsResponseTimeRelCompositeType,
                    incomingWsRequestsUIDItemNames);


            //
            // --- Incoming webservice request RELATIVE response time grouped by service and execution status
            //
            INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_ITEM_NAMES = new String[] { "wsUrl", "operationName",
                    "executionStatus", "maximumValue", "averageValue", "minimumValue", "percentile-10Value",
                    "percentile-50Value", "percentile-90Value" };

            final CompositeType incomingWsRequestsResponseTimeRelGroupedCompositeType = new CompositeType(
                    "IncomingWsRequestsResponseTimeRelGroupedBySvcOpAndExecStatus",
                    "The aggregated response times of the incoming web-service requests on the last sample grouped by service and execution status",
                    INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_ITEM_NAMES,
                    new String[] {
                            "path of the invoked web-service URL",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "operation execution status",
                            "the maximum response time on the last sample",
                            "the average response time on the last sample",
                            "the minimum response time on the last sample" ,
                            "the 10-percentile response time (10% of the response times are lesser than this value)",
                            "the 50-percentile response time (50% of the response times are lesser than this value)",
                            "the 90-percentile response time (90% of the response times are lesser than this value)" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG,
                            SimpleType.LONG, SimpleType.LONG });

            INCOMING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE = new TabularType(
                    "IncomingWsRequestsResponseTimeRelGroupedBySvcOpAndExecStatus",
                    "The aggregated response times of the incoming web-service requests on the last sample grouped by service and execution status",
                    incomingWsRequestsResponseTimeRelGroupedCompositeType,
                    new String[] { "wsUrl", "operationName", "executionStatus"});

            //
            // --- Outgoing webservice requests
            //
            OUTGOING_WS_REQUESTS_COUNTER_ITEM_NAMES = new String[] {"wsUrl", "operationName",
                    "mep", "executionStatus", "value" };

            final CompositeType outgoingWsRequestsCompositeType = new CompositeType(
                    "OutgoingWsRequestsCounter",
                    "The number of outgoing web-service requests to external web-service",
                    OUTGOING_WS_REQUESTS_COUNTER_ITEM_NAMES,
                    new String[] {
                            "URL of the external web-service to invoke",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "the message exchange pattern, as URI",
                            "operation execution status",
                            "number of outgoing webservice requests since the last startup of the component" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.LONG });

            OUTGOING_WS_REQUESTS_COUNTER_TABULAR_TYPE = new TabularType(
                    "OutgoingWsRequestsCounter",
                    "The number of outgoing web-service requests to external web-service",
                    outgoingWsRequestsCompositeType,
                    outgoingWsRequestsUIDItemNames);

            //
            // --- Outgoing webservice request ABSOLUTE response time
            //
            OUTGOING_WS_REQUESTS_RESPONSE_TIME_ABS_ITEM_NAMES = new String[] { "wsUrl", "operationName",
                    "mep", "executionStatus", "maximumValue", "averageValue", "minimumValue" };

            final CompositeType outgoingWsRequestsResponseTimeAbsCompositeType = new CompositeType(
                    "OutgoingWsRequestsResponseTimeAbs",
                    "The aggregated response times of the outgoing web-service requests since the last startup of the component",
                    OUTGOING_WS_REQUESTS_RESPONSE_TIME_ABS_ITEM_NAMES,
                    new String[] {
                            "URL of the external web-service to invoke",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "the message exchange pattern, as URI",
                            "operation execution status",
                            "the maximum response time since the last start of the component on which the service provider is running",
                            "the average response time since the last start of the component on which the service provider is running",
                            "the minimum response time since the last start of the component on which the service provider is running" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG });

            OUTGOING_WS_REQUESTS_RESPONSE_TIME_ABS_TABULAR_TYPE = new TabularType(
                    "OutgoingWsRequestsResponseTimeAbs",
                    "The aggregated response times of the outgoing web-service requests since the last startup of the component",
                    outgoingWsRequestsResponseTimeAbsCompositeType,
                    outgoingWsRequestsUIDItemNames);

            //
            // --- Outgoing webservice request RELATIVE response time
            //
            OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_ITEM_NAMES = new String[] { "wsUrl", "operationName", "mep",
                    "executionStatus", "maximumValue", "averageValue", "minimumValue", "percentile-10Value",
                    "percentile-50Value", "percentile-90Value" };

            final CompositeType outgoingWsRequestsResponseTimeRelCompositeType = new CompositeType(
                    "OutgoingWsRequestsResponseTimeRel",
                    "The aggregated response times of the outgoing web-service requests on the last sample, ",
                    OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_ITEM_NAMES,
                    new String[] {
                            "path of the invoked web-service URL",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "message exchange pattern",
                            "operation execution status",
                            "the maximum response time on the last sample",
                            "the average response time on the last sample",
                            "the minimum response time on the last sample" ,
                            "the 10-percentile response time (10% of the response times are lesser than this value)",
                            "the 50-percentile response time (50% of the response times are lesser than this value)",
                            "the 90-percentile response time (90% of the response times are lesser than this value)" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG,
                            SimpleType.LONG, SimpleType.LONG });

            OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_TABULAR_TYPE = new TabularType(
                    "OutgoingWsRequestsResponseTimeRel",
                    "The aggregated response times of the outgoing web-service requests on the last sample, ",
                    outgoingWsRequestsResponseTimeRelCompositeType,
                    outgoingWsRequestsUIDItemNames);

            //
            // --- Outgoing webservice request RELATIVE response time grouped by Svc & ExecStatus
            //
            OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_ITEM_NAMES = new String[] { "wsUrl", "operationName",
                    "executionStatus", "maximumValue", "averageValue", "minimumValue", "percentile-10Value",
                    "percentile-50Value", "percentile-90Value" };

            final CompositeType outgoingWsRequestsResponseTimeRelGroupesCompositeType = new CompositeType(
                    "OutgoingWsRequestsResponseTimeRelGroupedBySvcOpAndExecStatus",
                    "The aggregated response times of the outgoing web-service requests on the last sample grouped by service and execution status",
                    OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_ITEM_NAMES,
                    new String[] {
                            "path of the invoked web-service URL",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "operation execution status",
                            "the maximum response time on the last sample",
                            "the average response time on the last sample",
                            "the minimum response time on the last sample" ,
                            "the 10-percentile response time (10% of the response times are lesser than this value)",
                            "the 50-percentile response time (50% of the response times are lesser than this value)",
                            "the 90-percentile response time (90% of the response times are lesser than this value)" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING,SimpleType.STRING,
                            SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG,
                            SimpleType.LONG, SimpleType.LONG });

            OUTGOING_WS_REQUESTS_RESPONSE_TIME_REL_GROUPED_TABULAR_TYPE = new TabularType(
                    "OutgoingWsRequestsResponseTimeRelGroupedBySvcOpAndExecStatus",
                    "The aggregated response times of the outgoing web-service requests on the last sample grouped by service and execution status",
                    outgoingWsRequestsResponseTimeRelGroupesCompositeType,
                    new String[] { "wsUrl", "operationName", "executionStatus" });

            //
            // --- webservice client pool in use max
            //

            WS_CLIENT_POOL_CLIENTS_IN_USE_MAX_ITEM_NAMES = new String[] { "wsUrl", "operationName", "mep", "value" };

            final CompositeType wsClientPoolClientsInUseMaxCompositeType = new CompositeType(
                    "WsClientPoolClientsInUseMax",
                    "The maximum number of web-service client in use",
                    WS_CLIENT_POOL_CLIENTS_IN_USE_MAX_ITEM_NAMES,
                    new String[] {
                            "URL of the external web-service to invoke",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "the message exchange pattern, as URI",
                            "The maximum number of web-service client in use since the last startup of the component" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.LONG });

            WS_CLIENT_POOL_CLIENTS_IN_USE_MAX_TABULAR_TYPE = new TabularType(
                    "WsClientPoolClientsInUseMax",
                    "The maximum number of web-service client in use",
                    wsClientPoolClientsInUseMaxCompositeType,
                    wsClientUIDItemNames);

            //
            // --- webservice client pool in use current
            //

            WS_CLIENT_POOL_CLIENTS_IN_USE_CURRENT_ITEM_NAMES = new String[] { "wsUrl", "operationName", "mep",
                    "value" };

            final CompositeType wsClientPoolClientsInUseCurrentCompositeType = new CompositeType(
                    "WsClientPoolClientsInUseCurrent",
                    "The current number of web-service client in use",
                    WS_CLIENT_POOL_CLIENTS_IN_USE_CURRENT_ITEM_NAMES,
                    new String[] {
                            "URL of the external web-service to invoke",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "the message exchange pattern, as URI",
                            "The current number of web-service client in use" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.LONG });

            WS_CLIENT_POOL_CLIENTS_IN_USE_CURRENT_TABULAR_TYPE = new TabularType(
                    "WsClientPoolClientsInUseCurrent",
                    "The current number of web-service client in use",
                    wsClientPoolClientsInUseCurrentCompositeType,
                    wsClientUIDItemNames);

            //
            // --- webservice client pool exhaustion
            //

            WS_CLIENT_POOL_EXHAUSTION_ITEM_NAMES = new String[] { "wsUrl", "operationName", "mep", "value" };

            final CompositeType wsClientPoolExhaustionCompositeType = new CompositeType(
                    "WsClientPoolExhaustions",
                    "The number of exhaustion of the web-service client pool",
                    WS_CLIENT_POOL_EXHAUSTION_ITEM_NAMES,
                    new String[] {
                            "URL of the external web-service to invoke",
                            "invoked operation of the service provider, as qualified name expressed as '{}local-part'",
                            "the message exchange pattern, as URI",
                            "The maximum number of web-service client in use since the last startup of the component" },
                    new OpenType[] { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.LONG });

            WS_CLIENT_POOL_EXHAUSTION_TABULAR_TYPE = new TabularType(
                    "WsClientPoolExhaustions",
                    "The number of exhaustion of the web-service client pool",
                    wsClientPoolExhaustionCompositeType,
                    wsClientUIDItemNames);

            //
            // --- Service Contracts Counter
            //

            SERVICE_CONTRACTS_COUNTER_ITEM_NAMES = new String[] { "soapService", "value" };

            final CompositeType serviceContractsCounterCompositeType = new CompositeType(
                    "ServiceContractsCounter",
                    "The number of a service contract request ",
                    SERVICE_CONTRACTS_COUNTER_ITEM_NAMES,
                    new String[] {
                            "HTTP(S)/SOAP service in the following format: 'http://:/petals/services/?wsdl'",
                            "The number of a service contract request since the last startup of the component" },
                    new OpenType[] { SimpleType.STRING, SimpleType.LONG });

            SERVICE_CONTRACTS_COUNTER_TABULAR_TYPE = new TabularType(
                    "ServiceContractsCounter",
                    "The number of a service contract request ",
                    serviceContractsCounterCompositeType,
                    new String[] { "soapService" });

        }
        catch (final OpenDataException e) {
            throw new RuntimeException(e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy