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