当前位置: 首页>>代码示例>>Java>>正文


Java NotPrefetchedError类代码示例

本文整理汇总了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);
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:41,代码来源:AbstractController.java

示例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);
}
 
开发者ID:ShiftMediaProject,项目名称:libbluray,代码行数:11,代码来源:BDHandler.java


注:本文中的javax.media.NotPrefetchedError类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。