本文整理汇总了Java中javax.media.NotPrefetchedError类的典型用法代码示例。如果您正苦于以下问题:Java NotPrefetchedError类的具体用法?Java NotPrefetchedError怎么用?Java NotPrefetchedError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NotPrefetchedError类属于javax.media包,在下文中一共展示了NotPrefetchedError类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: syncStart
import javax.media.NotPrefetchedError; //导入依赖的package包/类
/**
* SyncStart Controller on new thread. Subclasses should
* override doSyncStart() to do the actual work to transition the
* Controller.
* <p>
* Checks for Controller state prerequisites and creates a
* SyncStartThread to syncstart the AbstractController. The
* target state of the AbstractController is then set to
* Started and the thread is started.
* <p>
* Asynchronous method -- Start synchronous transition on
* another thread and return ASAP.
*/
public final synchronized void syncStart(final Time t) {
// Enforce state prereqs
if (currentState == Started) {
throw new ClockStartedError(
"syncStart() cannot be called on a started Clock");
}
// Enforce state prereqs
if(currentState != Prefetched) {
throw new NotPrefetchedError(
"Cannot start the Controller before it has been prefetched");
}
// Set the target state
setTargetState(Started);
// SyncStart on a separate thread
Thread thread = new Thread() {
public void run() {
if( AbstractController.this.getState() < Started ) {
synchronousSyncStart(t);
}
}
};
threadqueue.addThread(thread);
}
示例2: syncStart
import javax.media.NotPrefetchedError; //导入依赖的package包/类
public void syncStart(Time at) {
synchronized (this) {
if (state != Prefetched)
throw new NotPrefetchedError("syncStart");
}
if (isClosed) return;
PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_START, at);
commandQueue.put(action);
}