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


Java TaskExecutionException类代码示例

本文整理汇总了Java中org.apache.pivot.util.concurrent.TaskExecutionException的典型用法代码示例。如果您正苦于以下问题:Java TaskExecutionException类的具体用法?Java TaskExecutionException怎么用?Java TaskExecutionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TaskExecutionException类属于org.apache.pivot.util.concurrent包,在下文中一共展示了TaskExecutionException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toErrorString

import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
public static String toErrorString(Throwable t, String separator) {
    StringBuilder result = new StringBuilder();
    while (true) {
        if (t instanceof TaskExecutionException) {
            t = t.getCause();
        } else if (t instanceof InvocationTargetException) {
            t = ((InvocationTargetException) t).getTargetException();
        } else {
            result.append(t.getClass().getSimpleName());
            if (!isNullOrEmpty(t.getMessage()))
                result.append(": ").append(t.getMessage());
            if (t.getCause() != t && t.getCause() != null) {
                result.append(separator);
                t = t.getCause();
            } else {
                break;
            }
        }
    }
    return result.toString().trim();
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:22,代码来源:MiscUtils.java

示例2: getIcon

import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
public static Image getIcon(String iconResource, Class<?> relativeTo) {
    if (iconResource == null) {
        throw new IllegalArgumentException("iconResource is null");
    }
    URL iconURL = relativeTo.getResource(iconResource);
    if (iconURL == null) {
        throw new IllegalArgumentException("iconResource not found: " + iconResource);
    }
    Image icon = (Image) ApplicationContext.getResourceCache().get(iconURL);
    if (icon == null) {
        try {
            icon = Image.load(iconURL);
        } catch (TaskExecutionException ex) {
            throw new IllegalArgumentException(ex);
        }
        ApplicationContext.getResourceCache().put(iconURL, icon);
    }
    return icon;
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:20,代码来源:WtkUtil.java

示例3: PlaylistCellRenderer

import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
public PlaylistCellRenderer(PlayService playService) {
    this.playService = playService;
    try {
        this.pointerImage = Image.load(getClass().getResource("images/pointer.png"));
    } catch (TaskExecutionException ex) {
        throw new RuntimeException(ex);
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:9,代码来源:PlaylistCellRenderer.java

示例4: createSearchTask

import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
private Task<SearchResult<T>> createSearchTask() {
    return new Task<SearchResult<T>>() {
        @Override
        public SearchResult<T> execute() throws TaskExecutionException {
            try {
                return content.search();
            } catch (Exception ex) {
                throw new TaskExecutionException(ex);
            }
        }
    };
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:13,代码来源:LazyLoadingPane.java

示例5: execute

import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
@Override
public final List<V> execute() throws TaskExecutionException {
    if (abort) {
        throw new AbortException();
    }
    try {
        List<V> suggestions = suggestionsProvider.getSuggestions(query);
        return abort ? null : suggestions;
    } catch (Exception ex) {
        throw new TaskExecutionException("error getting suggestions for " + query, ex);
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:13,代码来源:SuggestionPopupTextInputContentListener.java

示例6: setDefaultImage

import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
public void setDefaultImage(URL defaultImageURL) {
    if (defaultImageURL == null) {
        throw new IllegalArgumentException("defaultImageURL is null.");
    }
    Image defaultImage = (Image) ApplicationContext.getResourceCache().get(defaultImageURL);
    if (defaultImage == null) {
        try {
            defaultImage = Image.load(defaultImageURL);
        } catch (TaskExecutionException ex) {
            throw new IllegalArgumentException(ex);
        }
        ApplicationContext.getResourceCache().put(defaultImageURL, defaultImage);
    }
    setDefaultImage(defaultImage);
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:16,代码来源:ImageLoader.java

示例7: setIcon

import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
public void setIcon(String ICON)
{
    this.icon = ICON;
    try {
        setIcon( Image.load(getClass().getResource(icon)) );
    } catch (TaskExecutionException e) {
        e.printStackTrace();
    }
}
 
开发者ID:DevComPack,项目名称:setupmaker,代码行数:10,代码来源:Pack.java

示例8: execute

import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
@Override
public Integer execute() throws TaskExecutionException
{
    try
    {
        wait(1000);
    }
    catch (InterruptedException e)
    {
        e.printStackTrace();
    }
    return 0;
}
 
开发者ID:DevComPack,项目名称:setupmaker,代码行数:14,代码来源:TaskWait.java

示例9: execute

import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
public T execute() throws TaskExecutionException; 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:2,代码来源:ApplicationTask.java


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