|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.mindtree.techworks.insight.receiver.AbstractReceiver
public abstract class AbstractReceiver
The AbstractReceiver
class is an abstraction of functionality common to all Insight
receiver implementations.
This class doesnot notify registered Log4j Appender instances. Instead it notifies those
appenders that have been registered directly with this class using
#addAppender(Appender appender)
The appenders are notified for every LoggingEvent successfully parsed/received by this receiver. This AbstractReceiver processes events in an asynchronous manner using callback methods on derived implementations for events and their availability.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected long |
interpretedEventCount
Count of events interpreted by this Receiver |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Fields inherited from interface com.mindtree.techworks.insight.receiver.ReceiverInterpreter |
---|
FAILURE, SUCCESS |
Fields inherited from interface com.mindtree.techworks.insight.model.ILogEventModelMutator |
---|
FAILURE, NON_TAILING_MUTATOR, SUCCESS, TAILING_MUTATOR |
Constructor Summary | |
---|---|
AbstractReceiver()
|
Method Summary | |
---|---|
void |
addAppender(org.apache.log4j.Appender appender)
Adds the specified Appender for notification when a LoggingEvent has been parsed |
void |
addMutatorListener(IMutatorListener mutatorListener)
Adds the specified MutatorListener |
void |
addReceiverListener(ReceiverListener receiverListener)
Adds the specified ReceiverListener for notification when a ReceiverSpecifc Events will occur. |
protected abstract void |
deInitialize()
Informs this AbstractReceiver to reset itself. |
abstract LogNamespace[] |
getNamespaces()
Returns the LogNamespace that this AbstractReceiver was initialized with |
protected abstract LogEvent[] |
getNextEvents()
Gets null or the next LoggingEvent(s) processed by this receiver |
protected abstract boolean |
hasMoreEvents()
Determines if this receiver has any more events to process |
protected abstract void |
initialize(LogNamespace namespace,
boolean isTailing)
Informs this AbstractReceiver to initialize itself. |
abstract boolean |
isTailing()
Returns true if this AbstractReceiver tails the LogNamespace |
void |
removeAppender(org.apache.log4j.Appender appender)
Removes the specified Appender for notification when a LoggingEvent has been parsed |
void |
removeMutatorListener(IMutatorListener mutatorListener)
Removes the specified MutatorListener |
void |
removeReceiverListener(ReceiverListener receiverListener)
Removes the specified ReceiverListener for notification when a ReceiverSpecifc Events will occur. |
void |
run()
Overriden Thread super class method |
void |
shutdown()
Informs this receiver to stop processing events from the log namespace. |
void |
startup()
Informs this receiver to start processing events from the log namespace. |
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 |
---|
protected long interpretedEventCount
Constructor Detail |
---|
public AbstractReceiver()
Method Detail |
---|
public void addAppender(org.apache.log4j.Appender appender)
appender
- the Appender instance to be added to the appender listpublic void removeAppender(org.apache.log4j.Appender appender)
appender
- the Appender instance to be added to the appender listpublic void addReceiverListener(ReceiverListener receiverListener)
addReceiverListener
in interface ReceiverInterpreter
receiverListener
- the ReceiverListener instance to be added to the receiverListener listpublic void removeReceiverListener(ReceiverListener receiverListener)
removeReceiverListener
in interface ReceiverInterpreter
receiverListener
- the ReceiverListener instance to be added to the receiverListener listpublic void addMutatorListener(IMutatorListener mutatorListener)
addMutatorListener
in interface ILogEventModelMutator
mutatorListener
- the IMutatorListener to addpublic void removeMutatorListener(IMutatorListener mutatorListener)
removeMutatorListener
in interface ILogEventModelMutator
mutatorListener
- the MutatorListener to removepublic void startup()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
Thread.run()
public void shutdown()
public abstract LogNamespace[] getNamespaces()
public abstract boolean isTailing()
initialize(LogNamespace, boolean)
protected abstract void initialize(LogNamespace namespace, boolean isTailing) throws ReceiverInitializationException
namespace
- the LogNamespace that this AbstractReceiver will process events fromisTailing
- determines if this AbstractReceiver tails the specified LogNamespace
ReceiverInitializationException
- if any problems occurs during the initialization of receiver.shutdown()
protected abstract void deInitialize()
protected abstract LogEvent[] getNextEvents()
protected abstract boolean hasMoreEvents()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |