Package com.articulate.sigma
Class CCheckManager
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
com.articulate.sigma.CCheckManager
- All Implemented Interfaces:
AutoCloseable,Executor,ExecutorService
This class manages the threads that run consistency checks for the different
KBs in the system.
- Author:
- Karen Joy Nomorosa, Rearden Commerce Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumccheckQueue keeps track of the KBs that are currently being checked.Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterExecute(CCheck r, Throwable t) Removes the KB from the list of kbs currently being checked, and add it to the checkedKBs list.ccheckResults(String kbName) This method returns full or partial results of the consistency checks.ccheckStatus(String kbName) Returns the current status of a KBlastCCheck(String kbName) Returns the timestamp of when the last consistency check was run on this KB.performConsistencyCheck(KB kb, String chosenEngine, String systemChosen, String location, String language, int timeout) Main code that performs the consistency check on the KB.Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toStringMethods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
close
-
Constructor Details
-
CCheckManager
public CCheckManager()
-
-
Method Details
-
lastCCheck
Returns the timestamp of when the last consistency check was run on this KB.- Parameters:
kbName- - name of the KB- Returns:
- Timestamp if a consistency check has been run previously, null if it hasn't.
-
ccheckResults
This method returns full or partial results of the consistency checks.- Parameters:
kbName- - name of the KB that we want the results of- Returns:
- SimpleElement of the parsed XML file or null if there are errors or it does not exist.
-
ccheckStatus
Returns the current status of a KB- Parameters:
kbName- - the name of the KB to be checked- Returns:
- true if there is a worker thread currently performing consistency checks on it, and false if not
-
performConsistencyCheck
public CCheckManager.CCheckStatus performConsistencyCheck(KB kb, String chosenEngine, String systemChosen, String location, String language, int timeout) Main code that performs the consistency check on the KB.- Parameters:
kb- - KB to be checked- Returns:
- the status of the check (whether it has been accepted or rejected)
-
afterExecute
Removes the KB from the list of kbs currently being checked, and add it to the checkedKBs list. This method is overridden from the parent class.- Parameters:
r-t-
-