|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.wso2.carbon.registry.core.utils.LogWriter
public class LogWriter
Writes log records to the database on a separate thread
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
LogWriter(LogQueue logQueue,
DataAccessManager dataAccessManager)
Constructor accepting a queue of logs. |
Method Summary | |
---|---|
void |
addLog(String resourcePath,
String userName,
int action,
String actionData)
Adds log record to queue |
LogQueue |
getLogQueue()
Obtains the queue for holding and retrieving logs. |
void |
run()
The main business logic. |
void |
setLogQueue(LogQueue logQueue)
Sets the queue for holding and retrieving logs. |
void |
start()
Starts writing logs. |
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, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LogWriter(LogQueue logQueue, DataAccessManager dataAccessManager)
logQueue
- the queue of logs.dataAccessManager
- the manager class that can be used to obtain access to the back-end
database.Method Detail |
---|
public void setLogQueue(LogQueue logQueue)
logQueue
- the queue for holding and retrieving logs.public LogQueue getLogQueue()
public void start()
start
in class Thread
public void run()
run
in interface Runnable
run
in class Thread
public void addLog(String resourcePath, String userName, int action, String actionData) throws RegistryException
resourcePath
- the resource path.userName
- the name of the user who performed the action on the resource.action
- an identifier of the action that happened.actionData
- the data for further information.
RegistryException
- if the operation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |