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 class
LogEventHandlerImpl.Indent
-
Field Summary
Fields Modifier and Type Field Description private long[]
data
private static int
DEFAULT_INCREMENT
private static int
DEFAULT_SIZE
private static java.lang.String
ENTER_REP
private static java.lang.String
EXIT_REP
private int
increment
private int
nextFree
private int
size
-
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 void
clear()
Discard the contents of the log.void
display(java.io.PrintStream arg, java.lang.String msg)
Display the contents of this log in formatted form to the PrintStream.private void
initData(int size, int increment)
java.util.Iterator<TimerEvent>
iterator()
private void
log(int id, long time)
void
notify(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:
iterator
in interfacejava.lang.Iterable<TimerEvent>
-
initData
private void initData(int size, int increment)
-
notify
public void notify(TimerEvent event)
- Specified by:
notify
in interfaceTimerEventHandler
-
log
private void log(int id, long time)
-
clear
public void clear()
Description copied from interface:LogEventHandler
Discard the contents of the log.- Specified by:
clear
in interfaceLogEventHandler
-
display
public void display(java.io.PrintStream arg, java.lang.String msg)
Description copied from interface:LogEventHandler
Display the contents of this log in formatted form to the PrintStream.- Specified by:
display
in interfaceLogEventHandler
-
-