本文整理汇总了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();
}
示例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;
}
示例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);
}
}
示例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);
}
}
};
}
示例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);
}
}
示例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);
}
示例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();
}
}
示例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;
}
示例9: execute
import org.apache.pivot.util.concurrent.TaskExecutionException; //导入依赖的package包/类
public T execute() throws TaskExecutionException;