org.apache.jcs.utils.access
Interface JCSWorkerHelper

All Known Implementing Classes:
AbstractJCSWorkerHelper

public interface JCSWorkerHelper

Interface for doing a piece of work which is expected to be cached. This is ment to be used in conjunction with JCSWorker.

Implement doWork() to return the work being done. isFinished() should return false until setFinished(true) is called, after which time it should return true.

Author:
tsavo

Method Summary
 java.lang.Object doWork()
          The method to implement to do the work that should be cached.
 boolean isFinished()
          Tells us weather or not the work has been completed.
 void setFinished(boolean isFinished)
          Sets weather or not the work has been done.
 

Method Detail

isFinished

boolean isFinished()
Tells us weather or not the work has been completed. This will be called automatically by JCSWorker. You should not call it yourself.

Returns:
True if the work has allready been done, otherwise false.

setFinished

void setFinished(boolean isFinished)
Sets weather or not the work has been done.

Parameters:
isFinished - True if the work has allready been done, otherwise false.

doWork

java.lang.Object doWork()
                        throws java.lang.Exception
The method to implement to do the work that should be cached. JCSWorker will call this itself! You should not call this directly.

Returns:
The result of doing the work to be cached.
Throws:
java.lang.Exception - If anything goes wrong while doing the work, an Exception should be thrown.


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.