001/*
002 *  jDTAUS Core API
003 *  Copyright (C) 2005 Christian Schulte
004 *  <cs@schulte.it>
005 *
006 *  This library is free software; you can redistribute it and/or
007 *  modify it under the terms of the GNU Lesser General Public
008 *  License as published by the Free Software Foundation; either
009 *  version 2.1 of the License, or any later version.
010 *
011 *  This library is distributed in the hope that it will be useful,
012 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
013 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 *  Lesser General Public License for more details.
015 *
016 *  You should have received a copy of the GNU Lesser General Public
017 *  License along with this library; if not, write to the Free Software
018 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
019 *
020 */
021package org.jdtaus.core.lang;
022
023/**
024 * Implementation runtime.
025 * <p>The implementation runtime allows applications to interface with the
026 * environment implementations are running in.</p>
027 * <p>Example: Accessing the runtime of all jDTAUS Core SPI compliant
028 * implementations in the system<br/><pre>
029 * Runtime runtime =
030 *     (Runtime) ContainerFactory.getContainer().
031 *     getImplementation(Runtime.class, "jDTAUS Core SPI");
032 * </pre></p>
033 *
034 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
035 * @version $JDTAUS: Runtime.java 8641 2012-09-27 06:45:17Z schulte $
036 */
037public interface Runtime
038{
039    //--Runtime-----------------------------------------------------------------
040
041    /**
042     * Computes the amount of allocated memory in percent.
043     *
044     * @return percent of memory currently allocated
045     * (so that {@code 100 - getAllocatedPercent()}% of memory is currently
046     * available to allocation).
047     */
048    long getAllocatedPercent();
049
050    /**
051     * Computes the maximum number of byte values currently being available to
052     * allocation.
053     *
054     * @return number of byte values currently available to allocation.
055     */
056    long getAvailableBytes();
057
058    /**
059     * Computes the maximum number of short values currently being available to
060     * allocation.
061     *
062     * @return number of short values currently available to allocation.
063     */
064    long getAvailableShorts();
065
066    /**
067     * Computes the maximum number of integer values currently being available
068     * to allocation.
069     *
070     * @return number of integer values currently available to allocation.
071     */
072    long getAvailableIntegers();
073
074    /**
075     * Computes the maximum number of long values currently being available
076     * to allocation.
077     *
078     * @return number of long values currently available to allocation.
079     */
080    long getAvailableLongs();
081
082    /**
083     * Computes the maximum number of char values currently being available
084     * to allocation.
085     *
086     * @return number of char values currently available to allocation.
087     */
088    long getAvailableChars();
089
090    /**
091     * Computes the maximum number of float values currently being available
092     * to allocation.
093     *
094     * @return number of float values currently available to allocation.
095     */
096    long getAvailableFloats();
097
098    /**
099     * Computes the maximum number of double values currently being available
100     * to allocation.
101     *
102     * @return number of double values currently available to allocation.
103     */
104    long getAvailableDoubles();
105
106    /**
107     * Computes the maximum number of boolean values currently being available
108     * to allocation.
109     *
110     * @return number of boolean values currently available to allocation.
111     */
112    long getAvailableBooleans();
113
114    //-----------------------------------------------------------------Runtime--
115}