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

com.espertech.esper.runtime.internal.kernel.thread.ThreadingService Maven / Gradle / Ivy

/*
 ***************************************************************************************
 *  Copyright (C) 2006 EsperTech, Inc. All rights reserved.                            *
 *  http://www.espertech.com/esper                                                     *
 *  http://www.espertech.com                                                           *
 *  ---------------------------------------------------------------------------------- *
 *  The software in this package is published under the terms of the GPL license       *
 *  a copy of which has been included with this distribution in the license.txt file.  *
 ***************************************************************************************
 */
package com.espertech.esper.runtime.internal.kernel.thread;

import com.espertech.esper.common.internal.statement.thread.ThreadingCommon;
import com.espertech.esper.runtime.internal.kernel.service.EPEventServiceImpl;
import com.espertech.esper.runtime.internal.kernel.service.EPServicesContext;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * Engine-level threading services.
 */
public interface ThreadingService extends ThreadingCommon {
    /**
     * Destroy thread pools.
     */
    public void destroy();

    /**
     * Initialize thread pools.
     *
     * @param services runtime-level service context
     * @param runtime  runtime
     */
    public void initThreading(EPServicesContext services, EPEventServiceImpl runtime);

    /**
     * Returns true for timer execution threading enabled.
     *
     * @return indicator
     */
    public boolean isTimerThreading();

    /**
     * Submit timer execution work unit.
     *
     * @param timerUnit unit of work
     */
    public void submitTimerWork(TimerUnit timerUnit);

    /**
     * Returns true for inbound threading enabled.
     *
     * @return indicator
     */
    public boolean isInboundThreading();

    /**
     * Submit inbound work unit.
     *
     * @param unit unit of work
     */
    public void submitInbound(InboundUnitRunnable unit);

    /**
     * Returns true for route execution threading enabled.
     *
     * @return indicator
     */
    public boolean isRouteThreading();

    /**
     * Submit route work unit.
     *
     * @param unit unit of work
     */
    public void submitRoute(RouteUnitRunnable unit);

    /**
     * Returns true for outbound threading enabled.
     *
     * @return indicator
     */
    public boolean isOutboundThreading();

    /**
     * Submit outbound work unit.
     *
     * @param unit unit of work
     */
    public void submitOutbound(OutboundUnitRunnable unit);

    /**
     * Returns the outbound queue.
     *
     * @return queue
     */
    public BlockingQueue getOutboundQueue();

    /**
     * Returns the outbound thread pool
     *
     * @return thread pool
     */
    public ThreadPoolExecutor getOutboundThreadPool();

    /**
     * Returns the route queue.
     *
     * @return queue
     */
    public BlockingQueue getRouteQueue();

    /**
     * Returns the route thread pool
     *
     * @return thread pool
     */
    public ThreadPoolExecutor getRouteThreadPool();

    /**
     * Returns the timer queue.
     *
     * @return queue
     */
    public BlockingQueue getTimerQueue();

    /**
     * Returns the timer thread pool
     *
     * @return thread pool
     */
    public ThreadPoolExecutor getTimerThreadPool();

    /**
     * Returns the inbound queue.
     *
     * @return queue
     */
    public BlockingQueue getInboundQueue();

    /**
     * Returns the inbound thread pool
     *
     * @return thread pool
     */
    public ThreadPoolExecutor getInboundThreadPool();

    public Thread makeEventSourceThread(String runtimeURI, String sourceName, Runnable runnable);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy