001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Nuxeo - initial API and implementation
011 *
012 * $Id$
013 */
014package org.nuxeo.ecm.core.management.events;
015
016/**
017 * Monitoring interface.
018 *
019 * @author Thierry Delprat
020 */
021public interface EventMonitoringMBean {
022
023    /**
024     * Gets the number of events in process or waiting for available slots.
025     */
026    int getEventsInQueueCount();
027
028    /**
029     * Gets number of active threads.
030     */
031    int getActiveThreadsCount();
032
033    /**
034     * Tells if time tracking is active for Async event handlers.
035     */
036    boolean isAsyncHandlersTrackingEnabled();
037
038    /**
039     * Enables or disables time tracking for Async event handlers.
040     */
041    void setAsyncHandlersTrackingEnabled(boolean collectAsyncHandlersExecTime);
042
043    /**
044     * Tells if time tracking is active for Sync event handlers.
045     */
046    boolean isSyncHandlersTrackingEnabled();
047
048    /**
049     * Enables or disables time tracking for Sync event handlers.
050     */
051    void setSyncHandlersTrackingEnabled(boolean collectSyncHandlersExecTime);
052
053    /**
054     * Returns the statistics for Async Handlers.
055     */
056    String getAsyncHandlersExecTime();
057
058    /**
059     * Returns the statistics for Sync Handlers.
060     */
061    String getSyncHandlersExecTime();
062
063    /**
064     * Resets the statistics.
065     */
066    void resetHandlersExecTime();
067
068    /**
069     * Tells if async handlers execution is blocked.
070     */
071    boolean isBlockAsyncHandlers();
072
073    /**
074     * Blocks or enables async handlers execution.
075     */
076    void setBlockAsyncHandlers(boolean blockAsyncHandlers);
077
078    /**
079     * Tells if post-commit sync handlers execution is blocked.
080     */
081    boolean isBlockSyncPostCommitHandlers();
082
083    /**
084     * Blocks or enables post-commit sync handlers execution.
085     */
086    void setBlockSyncPostCommitHandlers(boolean blockSyncPostCommitHandlers);
087
088    /**
089     * Get a summary of all registered listeners (name - type - enabled).
090     */
091    String getListenersConfig();
092
093    /**
094     * Enables or disables a listener by its name.
095     */
096    void setListenerEnabledFlag(String listenerName, boolean enabled);
097
098    /**
099     * Getter for bulkMode processing. Bulk mode may be used by listeners to drop some processing.
100     */
101    boolean isBulkModeEnabled();
102
103    /**
104     * Enables/Disables bulkMode processing.
105     */
106    void setBulkModeEnabled(boolean bulkModeEnabled);
107
108}