站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

Turbo (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore.turbo
Class Turbo

java.lang.Object
  extended byorg.netbeans.modules.vcscore.turbo.Turbo

public final class Turbo
extends Object

Client code main entry point. It's defacto implementation of FileStatusProvider interface (enhanced by being event source).

It enhances org.netbeans.modules.vcscore.turbo.local contract by ability to synchronously and asynchronously issue remote repository commands and translate their results to callbacks.


Method Summary
 void addTurboListener(TurboListener l)
           
static FileProperties getCachedMeta(FileObject fileObject)
          Request cached status, it never connects to repository.
static FileProperties getMemoryMeta(FileObject fileObject)
          Access memory layer.
static FileProperties getMeta(FileObject fileObject)
          Request last known status from first level that responds (memory, disk or repository).
static FileProperties getRepositoryMeta(FileObject fileObject)
          Request fresh status from repository caching it.
static boolean prepareMeta(FileObject fileObject)
          Instruct system to load data from slow layers.
 void removeTurboListener(TurboListener l)
           
static void setMeta(File file, FileProperties status)
          Deprecated. Internal contract: it allows the VCSFS to address FileObject prenatal situations.
static void setMeta(FileObject fileObject, FileProperties status)
          Populate cache by given attributes.
static void shutdown()
          Notifies turbo tha t it's not needed anymore.
static Turbo singleton()
          You do not need this until you need add event listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMeta

public static FileProperties getMeta(FileObject fileObject)
Request last known status from first level that responds (memory, disk or repository). As side effect it can contact repository and using status command load a subset of properties (related to status).

Threading: for convenience (or confusion) it protects callers from introducing UI freezes. If called from GUI thread it rather returns null and spawns asynchronous thread than synchronously computing the value.

Returns:
status or null for unknown

getRepositoryMeta

public static FileProperties getRepositoryMeta(FileObject fileObject)
Request fresh status from repository caching it. May block forever. Hence it must not be called from GUI thread.

Returns:
status or null for unknown

prepareMeta

public static boolean prepareMeta(FileObject fileObject)
Instruct system to load data from slow layers. Data can be actualy delivered sometimes in future. It's possible to attach a listener to get notified.

Parameters:
fileObject -
Returns:
true on available data, no listener will fire

getCachedMeta

public static FileProperties getCachedMeta(FileObject fileObject)
Request cached status, it never connects to repository. Handled promptly but can return unknown rather often.

Threading: for convenience (or confusion) it protects callers from introducing UI freezes. If called from GUI thread it rather returns null and spawns asynchronous thread than synchronously computing the value.

Returns:
status or null for unknown

getMemoryMeta

public static FileProperties getMemoryMeta(FileObject fileObject)
Access memory layer. On missing entry return null and schedule background fetching at DISK level.

Returns:
status or null for unknown

setMeta

public static void setMeta(FileObject fileObject,
                           FileProperties status)
Populate cache by given attributes. Makes them immutable. To be used by commands that can determine fresh properties as side effect of their execution.

Parameters:
status - new status or for invalidating

setMeta

public static void setMeta(File file,
                           FileProperties status)
Deprecated. Internal contract: it allows the VCSFS to address FileObject prenatal situations.

Populates the cache by given attributes. It tries to locate live fileobject. If it fails it silently stores the status without distributing change event.

Parameters:
file -

addTurboListener

public void addTurboListener(TurboListener l)

removeTurboListener

public void removeTurboListener(TurboListener l)

singleton

public static Turbo singleton()
You do not need this until you need add event listeners. There are static methods for all other oprations. Listeners must be added on default instance in order to support WeakListeners. WeakListeners are crucial here as Turbo's lifetime (it's static) exceeds lifetime of most potentional listeners.


shutdown

public static void shutdown()
Notifies turbo tha t it's not needed anymore. It comes on IDE shutdown.


 

Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.