Package org.glassfish.pfl.tf.timer.impl
Class LogEventHandlerImpl
- java.lang.Object
-
- org.glassfish.pfl.tf.timer.spi.NamedBase
-
- org.glassfish.pfl.tf.timer.impl.LogEventHandlerImpl
-
- All Implemented Interfaces:
java.lang.Iterable<TimerEvent>,LogEventHandler,Named,TimerEventHandler
public class LogEventHandlerImpl extends NamedBase implements LogEventHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classLogEventHandlerImpl.Indent
-
Field Summary
Fields Modifier and Type Field Description private long[]dataprivate static intDEFAULT_INCREMENTprivate static intDEFAULT_SIZEprivate static java.lang.StringENTER_REPprivate static java.lang.StringEXIT_REPprivate intincrementprivate intnextFreeprivate intsize
-
Constructor Summary
Constructors Constructor Description LogEventHandlerImpl(TimerFactory factory, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Discard the contents of the log.voiddisplay(java.io.PrintStream arg, java.lang.String msg)Display the contents of this log in formatted form to the PrintStream.private voidinitData(int size, int increment)java.util.Iterator<TimerEvent>iterator()private voidlog(int id, long time)voidnotify(TimerEvent event)-
Methods inherited from class org.glassfish.pfl.tf.timer.spi.NamedBase
equals, factory, hashCode, name, setFactory, toString
-
-
-
-
Field Detail
-
DEFAULT_SIZE
private static final int DEFAULT_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_INCREMENT
private static final int DEFAULT_INCREMENT
- See Also:
- Constant Field Values
-
data
private long[] data
-
size
private int size
-
increment
private int increment
-
nextFree
private int nextFree
-
ENTER_REP
private static final java.lang.String ENTER_REP
- See Also:
- Constant Field Values
-
EXIT_REP
private static final java.lang.String EXIT_REP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LogEventHandlerImpl
LogEventHandlerImpl(TimerFactory factory, java.lang.String name)
-
-
Method Detail
-
iterator
public java.util.Iterator<TimerEvent> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<TimerEvent>
-
initData
private void initData(int size, int increment)
-
notify
public void notify(TimerEvent event)
- Specified by:
notifyin interfaceTimerEventHandler
-
log
private void log(int id, long time)
-
clear
public void clear()
Description copied from interface:LogEventHandlerDiscard the contents of the log.- Specified by:
clearin interfaceLogEventHandler
-
display
public void display(java.io.PrintStream arg, java.lang.String msg)Description copied from interface:LogEventHandlerDisplay the contents of this log in formatted form to the PrintStream.- Specified by:
displayin interfaceLogEventHandler
-
-