|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.svc.repository.service.BaseService
atg.svc.repository.service.SharedService
atg.svc.repository.service.SolutionScoringService
atg.svc.repository.service.AsyncSolutionScoringService
public class AsyncSolutionScoringService
Queues solution scoring changes to a separate thread so solution scores and the view count, use count and hot use count are updated asynchronously. This prevents the user from blocking on the updates and helps prevent lock contention from multiple updates to the same solution blocking one another. Subclasses SolutionScoringService and overrides the methods that update the score.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.svc.repository.service.SolutionScoringService |
---|
sLISTORDERING_ASC, sLISTORDERING_DESC, sLISTTYPE_HOT, sLISTTYPE_QOAA, sLISTTYPE_TOP, sSOLUTION_SCORING_FILTER_CONTEXT_PATH |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
AsyncSolutionScoringService()
|
Method Summary | |
---|---|
SolutionRelevance |
create(java.lang.String pSolutionId,
java.lang.String pSolutionClassId)
Creates a new solution relevance bean for the specified SolutionId and SolutionClassId Use save to persist the solution relevance
object. |
int |
decrementHotUseCount(java.lang.String pSolutionId)
Decrements the hot use count for the solution and saves it. |
int |
decrementUseCount(java.lang.String pSolutionId)
Decrements the Use count for the solution and saves it. |
void |
doStartService()
Start up the service... |
void |
doStopService()
|
SolutionRelevance |
getSolutionRelevance(java.lang.String pSolutionId,
java.lang.String pSolutionClassId)
Gets a SolutionRelevance object for the given solution id. |
javax.transaction.TransactionManager |
getTransactionManager()
|
int |
incrementHotUseCount(java.lang.String pSolutionId)
Increments the hot use count for the solution and saves it. |
int |
incrementUseCount(java.lang.String pSolutionId)
Overrides the synchronous implementation in SolutionScoringService.incrementUseCount(String) . |
int |
incrementViewCount(java.lang.String pSolutionId)
Increments the view count for the solution and saves it. |
protected void |
internalProcessUpdate(SolutionRelevanceCountUpdate pCountUpdate)
Actually write the item changed event to the repository. |
boolean |
isEnableHotUseCountUpdate()
|
boolean |
isEnableUseCountUpdate()
|
boolean |
isEnableViewCountUpdate()
|
boolean |
isQueueInSeparateThread()
Whether to queue in a separate thread. |
SolutionRelevanceCountUpdate |
nextQueuedCountUpdate()
Return the next queued item changed. |
void |
processUpdate(SolutionRelevanceCountUpdate pCountUpdate)
Queue an item changed event. |
void |
setEnableHotUseCountUpdate(boolean pEnableHotUseCountUpdate)
|
void |
setEnableUseCountUpdate(boolean pEnableUseCountUpdate)
|
void |
setEnableViewCountUpdate(boolean pEnableViewCountUpdate)
|
int |
setHotUseCount(java.lang.String pSolutionId,
int pHotUseCount)
Sets the hot use count for the solution and saves it. |
void |
setQueueInSeparateThread(boolean pQueueInSeparateThread)
Whether to queue incrementing the view/use/hotuse count in a separate thread. |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
|
int |
updateHotUseCount(java.lang.String pSolutionId,
java.lang.String pSolutionClassId)
Increments the hot use count for the solution and saves it. |
Methods inherited from class atg.svc.repository.service.SharedService |
---|
getServiceSharedBeanHomes, getServiceSharedBeanHomesName, getServiceSharedRepositoryHomes, getServiceSharedRepositoryHomesName, setServiceSharedBeanHomesName, setServiceSharedRepositoryHomesName |
Methods inherited from class atg.svc.repository.service.BaseService |
---|
getRepositoryService, getToday, setRepositoryService |
Methods inherited from class atg.nucleus.GenericService |
---|
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
Constructor Detail |
---|
public AsyncSolutionScoringService()
Method Detail |
---|
public javax.transaction.TransactionManager getTransactionManager()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public boolean isEnableUseCountUpdate()
public void setEnableUseCountUpdate(boolean pEnableUseCountUpdate)
public boolean isEnableHotUseCountUpdate()
public void setEnableHotUseCountUpdate(boolean pEnableHotUseCountUpdate)
public boolean isEnableViewCountUpdate()
public void setEnableViewCountUpdate(boolean pEnableViewCountUpdate)
public void setQueueInSeparateThread(boolean pQueueInSeparateThread)
public boolean isQueueInSeparateThread()
public void doStartService() throws atg.nucleus.ServiceException
doStartService
in class atg.nucleus.GenericService
atg.nucleus.ServiceException
public void doStopService() throws atg.nucleus.ServiceException
doStopService
in class atg.nucleus.GenericService
atg.nucleus.ServiceException
public void processUpdate(SolutionRelevanceCountUpdate pCountUpdate)
protected void internalProcessUpdate(SolutionRelevanceCountUpdate pCountUpdate)
public SolutionRelevanceCountUpdate nextQueuedCountUpdate()
public SolutionRelevance create(java.lang.String pSolutionId, java.lang.String pSolutionClassId) throws javax.ejb.CreateException
save
to persist the solution relevance
object.
create
in class SolutionScoringService
pSolutionId
- Solution Repository IdpSolutionClassId
- SolutionClass Repository Id
javax.ejb.CreateException
- If the create fails.public SolutionRelevance getSolutionRelevance(java.lang.String pSolutionId, java.lang.String pSolutionClassId) throws ObjectNotFoundException, javax.ejb.CreateException, PersistenceException
pSolutionId
- Solution Repository IdpSolutionClassId
- SolutionClass Repository Id
ObjectNotFoundException
- when the solution is not found
javax.ejb.CreateException
- If the create for solution relevance object fails.
PersistenceException
- If unable to save the newly created solution relevance objectpublic int incrementUseCount(java.lang.String pSolutionId) throws javax.ejb.CreateException, ObjectNotFoundException, PersistenceException
SolutionScoringService.incrementUseCount(String)
.
incrementUseCount
in class SolutionScoringService
pSolutionId
- The RepId of the solution
javax.ejb.CreateException
- If the create for solution relevance object fails.
ObjectNotFoundException
- when a solution is not found
PersistenceException
- problems saving the solution relevance objectpublic int decrementUseCount(java.lang.String pSolutionId) throws javax.ejb.CreateException, ObjectNotFoundException, PersistenceException
decrementUseCount
in class SolutionScoringService
pSolutionId
- The RepId of the solution
javax.ejb.CreateException
- If the create for solution relevance object fails.
ObjectNotFoundException
- when a solution is not found
PersistenceException
- problems saving the solution relevance objectpublic int incrementViewCount(java.lang.String pSolutionId) throws javax.ejb.CreateException, ObjectNotFoundException, PersistenceException
incrementViewCount
in class SolutionScoringService
pSolutionId
- The RepId of the solution
javax.ejb.CreateException
- If the create for solution relevance object fails.
ObjectNotFoundException
- when a solution is not found
PersistenceException
- problems saving the solution relevance objectpublic int updateHotUseCount(java.lang.String pSolutionId, java.lang.String pSolutionClassId) throws javax.ejb.CreateException, ObjectNotFoundException, PersistenceException
pSolutionId
- The RepId of the solutionpSolutionClassId
- The repId of the SolutionClass
javax.ejb.CreateException
- If the create for solution relevance object fails.
ObjectNotFoundException
- when a solution is not found
PersistenceException
- problems saving the solution relevance objectpublic int incrementHotUseCount(java.lang.String pSolutionId) throws javax.ejb.CreateException, ObjectNotFoundException, PersistenceException
incrementHotUseCount
in class SolutionScoringService
pSolutionId
- The RepId of the solution
javax.ejb.CreateException
- If the create for solution relevance object fails.
ObjectNotFoundException
- when a solution is not found
PersistenceException
- problems saving the solution relevance objectpublic int decrementHotUseCount(java.lang.String pSolutionId) throws javax.ejb.CreateException, ObjectNotFoundException, PersistenceException
decrementHotUseCount
in class SolutionScoringService
pSolutionId
- The RepId of the solution
javax.ejb.CreateException
- If the create for solution relevance object fails.
ObjectNotFoundException
- when a solution is not found
PersistenceException
- problems saving the solution relevance objectpublic int setHotUseCount(java.lang.String pSolutionId, int pHotUseCount) throws javax.ejb.CreateException, ObjectNotFoundException, PersistenceException
setHotUseCount
in class SolutionScoringService
pSolutionId
- The RepId of the solutionpHotUseCount
-
javax.ejb.CreateException
- If the create for solution relevance object fails.
ObjectNotFoundException
- when a solution is not found
PersistenceException
- problems saving the solution relevance object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |