/* Copyright (c) 2002 by Oracle Corporation. All Rights Reserved. */

package oracle.portal.provider.v1;


/**
 * This interface contains a single method used to detect whether a request
 * has execeeded a set maximum time.
 */
public interface PortletExecutionTracker
{
    /**
     * Returns the time at which the request started. Time is defined in number
     * of milliseconds since January 1, 1970 UTC.
     *
     * return start time of the request
     */
    public long getPortletStartTime();

    /**
     * Returns the maximum time that the portlet should take to be rendered.
     *
     * @return the portlet timeout in milliseconds
     */
    public long getPortletTimeout();

    /**
     * Indicates whether this request has exceeded an execution timeout.
     * The execution timeout is picked up from an initialisation argument
     * or from a system default (in that order of preference.
     *
     * @return true if the portlet has timed out, false otherwise
     */
    public boolean hasPortletTimeoutElapsed();

    /**
     * Returns the maximum time that a portlet may take to execute, after which
     * it should be forcefully terminated.
     *
     * @return the portlet maximum execution time in milliseconds
     */
    public long getPortletKillTimeout();

    /**
     * Indicates whether this request has exceeded its 'kill time', i.e, the
     * time after which the thread should be forcefully stopped.
     *
     * @return true if the kill time has been exceeded, false otherwise.
     */
    public boolean hasPortletKillTimeoutElapsed();
}


