src/share/classes/sun/font/CreatedFontTracker.java

Print this page




  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.font;
  27 
  28 import java.io.File;
  29 import java.io.OutputStream;
  30 import java.security.AccessController;
  31 import java.security.PrivilegedAction;
  32 import java.util.HashMap;
  33 import java.util.Map;
  34 import java.util.concurrent.Semaphore;
  35 import java.util.concurrent.TimeUnit;
  36 
  37 import sun.awt.AppContext;
  38 import sun.misc.ThreadGroupUtils;
  39 
  40 public class CreatedFontTracker {
  41 
  42     public static final int MAX_FILE_SIZE = 32 * 1024 * 1024;
  43     public static final int MAX_TOTAL_BYTES = 10 * MAX_FILE_SIZE;
  44 
  45     static CreatedFontTracker tracker;
  46     int numBytes;
  47 
  48     public static synchronized CreatedFontTracker getTracker() {
  49         if (tracker == null) {
  50             tracker = new CreatedFontTracker();
  51         }
  52         return tracker;
  53     }
  54 
  55     private CreatedFontTracker() {
  56         numBytes = 0;
  57     }
  58 




  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.font;
  27 
  28 import java.io.File;
  29 import java.io.OutputStream;
  30 import java.security.AccessController;
  31 import java.security.PrivilegedAction;
  32 import java.util.HashMap;
  33 import java.util.Map;
  34 import java.util.concurrent.Semaphore;
  35 import java.util.concurrent.TimeUnit;
  36 
  37 import sun.awt.AppContext;
  38 import sun.awt.util.ThreadGroupUtils;
  39 
  40 public class CreatedFontTracker {
  41 
  42     public static final int MAX_FILE_SIZE = 32 * 1024 * 1024;
  43     public static final int MAX_TOTAL_BYTES = 10 * MAX_FILE_SIZE;
  44 
  45     static CreatedFontTracker tracker;
  46     int numBytes;
  47 
  48     public static synchronized CreatedFontTracker getTracker() {
  49         if (tracker == null) {
  50             tracker = new CreatedFontTracker();
  51         }
  52         return tracker;
  53     }
  54 
  55     private CreatedFontTracker() {
  56         numBytes = 0;
  57     }
  58