View Javadoc

1   /*
2    *  jDTAUS Core API
3    *  Copyright (C) 2005 Christian Schulte
4    *  <cs@schulte.it>
5    *
6    *  This library is free software; you can redistribute it and/or
7    *  modify it under the terms of the GNU Lesser General Public
8    *  License as published by the Free Software Foundation; either
9    *  version 2.1 of the License, or any later version.
10   *
11   *  This library is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   *  Lesser General Public License for more details.
15   *
16   *  You should have received a copy of the GNU Lesser General Public
17   *  License along with this library; if not, write to the Free Software
18   *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19   *
20   */
21  package org.jdtaus.core.lang;
22  
23  /**
24   * Implementation runtime.
25   * <p>The implementation runtime allows applications to interface with the
26   * environment implementations are running in.</p>
27   * <p>Example: Accessing the runtime of all jDTAUS Core SPI compliant
28   * implementations in the system<br/><pre>
29   * Runtime runtime =
30   *     (Runtime) ContainerFactory.getContainer().
31   *     getImplementation(Runtime.class, "jDTAUS Core SPI");
32   * </pre></p>
33   *
34   * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
35   * @version $JDTAUS: Runtime.java 8641 2012-09-27 06:45:17Z schulte $
36   */
37  public interface Runtime
38  {
39      //--Runtime-----------------------------------------------------------------
40  
41      /**
42       * Computes the amount of allocated memory in percent.
43       *
44       * @return percent of memory currently allocated
45       * (so that {@code 100 - getAllocatedPercent()}% of memory is currently
46       * available to allocation).
47       */
48      long getAllocatedPercent();
49  
50      /**
51       * Computes the maximum number of byte values currently being available to
52       * allocation.
53       *
54       * @return number of byte values currently available to allocation.
55       */
56      long getAvailableBytes();
57  
58      /**
59       * Computes the maximum number of short values currently being available to
60       * allocation.
61       *
62       * @return number of short values currently available to allocation.
63       */
64      long getAvailableShorts();
65  
66      /**
67       * Computes the maximum number of integer values currently being available
68       * to allocation.
69       *
70       * @return number of integer values currently available to allocation.
71       */
72      long getAvailableIntegers();
73  
74      /**
75       * Computes the maximum number of long values currently being available
76       * to allocation.
77       *
78       * @return number of long values currently available to allocation.
79       */
80      long getAvailableLongs();
81  
82      /**
83       * Computes the maximum number of char values currently being available
84       * to allocation.
85       *
86       * @return number of char values currently available to allocation.
87       */
88      long getAvailableChars();
89  
90      /**
91       * Computes the maximum number of float values currently being available
92       * to allocation.
93       *
94       * @return number of float values currently available to allocation.
95       */
96      long getAvailableFloats();
97  
98      /**
99       * 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 }