X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.utils.thread%2Fsrc%2Forg%2Fsimantics%2Futils%2Fthreads%2Fua%2FWorker.java;fp=bundles%2Forg.simantics.utils.thread%2Fsrc%2Forg%2Fsimantics%2Futils%2Fthreads%2Fua%2FWorker.java;h=fa0fe02ebf5bc616f3786a39698e863f62dc7854;hp=1fc3667c8d997a82e44ea360047cfc198561356e;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.utils.thread/src/org/simantics/utils/threads/ua/Worker.java b/bundles/org.simantics.utils.thread/src/org/simantics/utils/threads/ua/Worker.java index 1fc3667c8..fa0fe02eb 100644 --- a/bundles/org.simantics.utils.thread/src/org/simantics/utils/threads/ua/Worker.java +++ b/bundles/org.simantics.utils.thread/src/org/simantics/utils/threads/ua/Worker.java @@ -1,46 +1,46 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.utils.threads.ua; - -import java.util.Collection; - -/** - * Worker executes tasks. - *

- * Hint! To execute work synchronously use:
- * Worker.asyncExec(runnable, null).waitForState(WorkState.FINAL_STATES); - *

- * To cancel all work get the work with getQueuedWork() and invoke cancel() to each. - * - * @see SynchronizedWorker - * @see ThreadPool - * @author Toni Kalajainen (toni.kalajainen@vtt.fi) - */ -public interface Worker extends StatefulExecutor { - - /** - * Execute work (async). - * - * @param runnable - * @param initialListener listener initially set on monitor object or null - * @return async work monitor object - */ - WorkMonitor asyncExec(Runnable runnable, StateListener initialListener) - throws WorkerClosedException; - - /** - * Get a list of all queued work. - * @param result queued work. - */ - void getQueuedWork(Collection result); - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.utils.threads.ua; + +import java.util.Collection; + +/** + * Worker executes tasks. + *

+ * Hint! To execute work synchronously use:
+ * Worker.asyncExec(runnable, null).waitForState(WorkState.FINAL_STATES); + *

+ * To cancel all work get the work with getQueuedWork() and invoke cancel() to each. + * + * @see SynchronizedWorker + * @see ThreadPool + * @author Toni Kalajainen (toni.kalajainen@vtt.fi) + */ +public interface Worker extends StatefulExecutor { + + /** + * Execute work (async). + * + * @param runnable + * @param initialListener listener initially set on monitor object or null + * @return async work monitor object + */ + WorkMonitor asyncExec(Runnable runnable, StateListener initialListener) + throws WorkerClosedException; + + /** + * Get a list of all queued work. + * @param result queued work. + */ + void getQueuedWork(Collection result); + +}