|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.util.SwingWorker | +--org.opencyc.util.CycWorker
This is a convenient event callback wrapper around the the SwingWorker class. It's inteded to allow easily running tasks in the background. Users of this class will be notified when the worker is started, interrupted or finished with its work. If finished, the rusults of the work will be made available as well.
Here is some example code:
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CycWorkerListener
,
CycWorkerEvent
,
SwingWorker
Inner classes inherited from class org.opencyc.util.SwingWorker |
SwingWorker.ThreadVar |
Fields inherited from class org.opencyc.util.SwingWorker |
threadVar |
Constructor Summary | |
CycWorker()
Creates a new instance of CycWorker |
Method Summary | |
void |
addListener(CycWorkerListener cwl)
Adds a new worker listener to this worker. |
void |
finished()
This method should be called internally only...public for Java related reasons only. |
java.lang.Object[] |
getListeners()
Return a list of all CycWorkerListeners listening to this CycWorker. |
java.lang.Object |
getWork()
Exposed the get() method from SwingWorker class. |
void |
interrupt()
This method interrupts a currently running CycWorker. |
void |
removeListener(CycWorkerListener cwl)
Removes a worker listener from this worker. |
void |
start()
This method starts the backround processing of a particular CycWorker. |
Methods inherited from class org.opencyc.util.SwingWorker |
construct, get, getValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CycWorker()
Method Detail |
public void addListener(CycWorkerListener cwl)
cwl
- The CycWorkerListener that wishes to listen to
this workerpublic void removeListener(CycWorkerListener cwl)
cwl
- The CycWorkerListener that no longer wishes to
be notified of this workers events.public java.lang.Object[] getListeners()
public void start()
start
in class SwingWorker
public void interrupt()
interrupt
in class SwingWorker
public void finished()
finished
in class SwingWorker
public java.lang.Object getWork()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |