org.ow2.petals.probes.api.probes.KeyedCounterProbeWithExecutionStatus Maven / Gradle / Ivy
/**
* Copyright (c) 2012 EBMWebsourcing, 2012-2016 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.probes.api.probes;
import org.ow2.petals.probes.api.enums.ExecutionStatus;
import org.ow2.petals.probes.api.exceptions.ProbeKeyMissingException;
import org.ow2.petals.probes.api.exceptions.ProbeNotStartedException;
import org.ow2.petals.probes.api.key.ExecutionStatusProbeKey;
import org.ow2.petals.probes.api.key.ProbeKey;
/**
*
* A counter probe to count the number of something by key (K) and execution
* status, since its last start.
*
*
* Lifecycle: The counter values are incremented only if the probe
* is started. Counter values can be acceded even if the probe is initialized or
* stopped. Counter values are reset when the probe starts or shutdowns.
*
*
* @param
* Type of the key identifying each counter, implementing
* {@link ProbeKey}.
*
* @author Christophe DENEUX (PetalsLink)
*
*/
public interface KeyedCounterProbeWithExecutionStatus extends
KeyedCounterProbe> {
/**
* Increments the value of the counter, as a pending request.
*
* @throws ProbeNotStartedException
* The probe is not started.
*/
public void incPending(final K key) throws ProbeNotStartedException;
/**
* Decrements the value of the pending counter and increments the right
* counter associated to the execution status
*
* @throws ProbeKeyMissingException
* The key
does not exist in the probe.
* @throws ProbeNotStartedException
* The probe is not started.
*/
public void move(final K key, final ExecutionStatus newStatus) throws ProbeKeyMissingException,
ProbeNotStartedException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy