|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.jafer.databeans.ActiveBean
class ActiveBean
This inner class represents a thread that performs a search on a Jafer Client (AbstractClient). It is configured and utilised by the DataBeanManager in order to facilitate parallel searches.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private boolean |
autoPopulateCache
Stores a reference to whether pre filling of the caching is enabled or not. |
private java.lang.String |
cacheRecordSchema
Stores a reference to record schema to use when preopoulating the cache |
private Databean |
databean
Stores a reference to the bean that this ActiveBean uses to perform searches and to retrieve results from. |
private int |
endOffset
Stores a reference to the offset this ActiveBean ends at in the super result set of all the ActiveBeans |
private static java.util.logging.Logger |
logger
Stores a reference to logger instance |
private java.lang.Object |
query
Stores a reference to query that should be submited to the jaferClientBean when the thread is executed |
private JaferException |
searchException
Stores a reference to exception that occured in the last search or null if no errors occured |
private int |
startOffset
Stores a reference to the offset this ActiveBean starts at in the super result set of all the ActiveBeans |
private boolean |
stillSearching
Stores a reference to whether the search is still executing. |
private boolean |
stopActiveBeanSearch
Stores a reference to a flag that indicates that the thread should terminate and prefilling of the cache should stop if it has not yet completed |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ActiveBean()
|
Method Summary | |
---|---|
boolean |
autoPopulateCache()
Returns whether this active bean should prepopulate cache after search |
boolean |
containsRecord(int recordIndex)
Returns a boolean to indicate if the record index supplied is contained with in the result set of this ActiveBean. |
Databean |
getDatabean()
Gets a reference to the JaferClientBean for this ActiveBean |
int |
getNumberOfResults()
Get the number of results that were found the last time the ActiveBeans thread was executed |
protected java.lang.String |
getPrepoulateCacheRecordSchema()
Get the record schema to use when prepoulating cache |
java.lang.Object |
getQuery()
get the query that will be executed when this ActiveBeans thread is run |
Field |
getRecord(int recordIndex,
java.lang.String schema)
Retrieve the record at the specified recordIndex |
protected Field |
getRecord(int recordIndex,
java.lang.String schema,
boolean applyOffsets)
Retrieve the record at the specified recordIndex |
JaferException |
getSearchException()
This method returns the JaferException from the last search. |
void |
run()
Executes the thread to perform the search |
void |
setAutoPopulateCache(boolean autoPopulate)
Sets whether this active bean should prepopulate cache after search |
void |
setDatabean(Databean bean)
sets a reference to the JaferClientBean for this ActiveBean |
void |
setOffsets(int start,
int end)
Sets the offsets for this ActiveBean result set in respect to the super result set of all the ActiveBeans |
protected void |
setPrepoulateCacheRecordSchema(java.lang.String recordSchema)
Set the record schema to use when prepoulating cache |
protected void |
setSearchException(JaferException exc)
This method sets the last exception that occurred during a search |
boolean |
stillSearching()
This method checks if the search is still executing |
protected void |
stillSearching(boolean searchStatus)
This method sets the flag to indicate if the search is executing or not |
protected boolean |
stopActiveBeanSearch()
Checks to see if the search should be stopped premeturely |
void |
stopActiveBeanSearch(boolean stopStatus)
This method allows the caller to set the stop active bean search flag |
void |
submitQuery(java.lang.Object query,
java.lang.String schema)
Set the query that will be executed when this ActiveBeans thread is run |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private boolean stopActiveBeanSearch
private boolean stillSearching
private boolean autoPopulateCache
private java.lang.String cacheRecordSchema
private int startOffset
private int endOffset
private Databean databean
private java.lang.Object query
private static java.util.logging.Logger logger
private JaferException searchException
Constructor Detail |
---|
ActiveBean()
Method Detail |
---|
public void setOffsets(int start, int end)
start
- The starting offset indexend
- The ending offset indexpublic boolean containsRecord(int recordIndex)
recordIndex
- The index to search for
public Databean getDatabean()
public void setDatabean(Databean bean)
bean
- The JaferClientBean to store in this ActiveBeanpublic JaferException getSearchException()
protected void setSearchException(JaferException exc)
exc
- The exception that occurredpublic void submitQuery(java.lang.Object query, java.lang.String schema)
query
- The query to executeschema
- The schema used to auto populate cachepublic java.lang.Object getQuery()
protected void setPrepoulateCacheRecordSchema(java.lang.String recordSchema)
recordSchemamThe
- schema to prepopulate the cache withprotected java.lang.String getPrepoulateCacheRecordSchema()
public int getNumberOfResults()
public Field getRecord(int recordIndex, java.lang.String schema) throws JaferException
recordIndex
- The recordIndex to retrieveschema
- The schema to apply
JaferException
protected Field getRecord(int recordIndex, java.lang.String schema, boolean applyOffsets) throws JaferException
recordIndex
- The recordIndex to retrieveschema
- The schema to applyapplyOffsets
- Should the offsets be applied to the record index,
This is normally true apart from when the autopopulation of cache
needs to refer to local indexs
JaferException
public boolean stillSearching()
protected void stillSearching(boolean searchStatus)
searchStatus
- The search status - true if executing searchpublic boolean autoPopulateCache()
public void setAutoPopulateCache(boolean autoPopulate)
autoPopulate
- true if the cache should be auto populatedpublic void stopActiveBeanSearch(boolean stopStatus)
protected boolean stopActiveBeanSearch()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |