org.netbeans.bootstrap/1 2.52

org.netbeans
Class Stamps

java.lang.Object
  extended by org.netbeans.Stamps

public final class Stamps
extends Object

Support for optimal checking of time stamps of certain files in NetBeans directory structure.

Since:
2.9

Nested Class Summary
static interface Stamps.Updater
          A callback interface to flush content of some cache at a suitable point in time.
 
Method Summary
 ByteBuffer asByteBuffer(String cache)
          Opens the access to cache object as a stream.
 MappedByteBuffer asMappedByteBuffer(String cache)
          Getter for mmapped buffer access to the cache.
 InputStream asStream(String cache)
          Opens the access to cache object as a stream.
 void discardCaches()
           
 boolean exists(String cache)
          Checks whether a cache exists
 void flush(int delay)
          Flushes all caches.
static Stamps getModulesJARs()
          Creates instance of stamp that checks timestamp for all files that affect module classloading and related caches.
 long lastModified()
          Finds out the time of last modifications of files that influnce this cache.
 void scheduleSave(Stamps.Updater updater, String cache, boolean append)
          Method for registering updates to caches.
 void shutdown()
          Waits for the worker to finish
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getModulesJARs

public static Stamps getModulesJARs()
Creates instance of stamp that checks timestamp for all files that affect module classloading and related caches.


lastModified

public long lastModified()
Finds out the time of last modifications of files that influnce this cache. Each cached file needs to be "younger".

Returns:
time in ms since epoch

exists

public boolean exists(String cache)
Checks whether a cache exists

Parameters:
cache - name of the cache
Returns:
true if the cache exists and is not out of date

asStream

public InputStream asStream(String cache)
Opens the access to cache object as a stream.

Parameters:
name - name of the cache
Returns:
stream to read from the cache or null if the cache is not valid

asMappedByteBuffer

public MappedByteBuffer asMappedByteBuffer(String cache)
Getter for mmapped buffer access to the cache.

Parameters:
cache - the file to access
Returns:
mmapped read only buffer

asByteBuffer

public ByteBuffer asByteBuffer(String cache)
Opens the access to cache object as a stream.

Parameters:
name - name of the cache
Returns:
stream to read from the cache or null if the cache is not valid

scheduleSave

public void scheduleSave(Stamps.Updater updater,
                         String cache,
                         boolean append)
Method for registering updates to caches.

Parameters:
updater - the callback to start when flushing caches
file - name of the file to store the cache into
append - write from scratch or append?

flush

public void flush(int delay)
Flushes all caches.

Parameters:
delay - the delay to wait with starting the parsing, if zero, that also means we want to wait for the end of parsing

shutdown

public void shutdown()
Waits for the worker to finish


discardCaches

public void discardCaches()

org.netbeans.bootstrap/1 2.52

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.