|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.logging.Chronometer
This is a factory for timestamps and interval anchor entries. Each
Chronometer
needs to be assigned to a URL
, so it can
be reused in case the underlying logging mechanism needs to be exchanged.
Field Summary | |
private static Set |
cache_
The storage for all used Chronometer instances as
WeakReference objects |
protected boolean |
first_
This flag will be set to false as soon as the first
interval has been requested |
protected static Long |
interval_
The length of an interval in milliseconds |
protected static DateFormat |
TIMESTAMP_FORMAT_
Contains the output pattern for a timestamp (actually uses SimpleDateFormat ) |
protected URL |
url_
The URL assignment for this
Chronometer |
protected long |
zerotime_
Timestamp of last interval |
Constructor Summary | |
protected |
Chronometer(URL url)
Hidden construction. |
Method Summary | |
(package private) static void |
changeInterval(Long interval)
Change the interval length |
boolean |
equals(Object obj)
|
void |
finalize()
Remove this instance and null references from the storage
of deployed Chronometer objects. |
URL |
getURL()
Get the URL this Chronometer instance
has been assigned to. |
int |
hashCode()
|
protected static Chronometer |
instanceFor(URL url)
Get the Chronometer instance for a given URL . |
StringBuffer |
nextInterval(long logtime)
Get the current timestamp which is either a number of anchor timestamps for each interval followed by the number of milliseconds elapsed since the last interval or only the complete date and time info in case the interval has been set to zero. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final DateFormat TIMESTAMP_FORMAT_
SimpleDateFormat
)
private static Set cache_
Chronometer
instances as
WeakReference
objects
protected static Long interval_
protected URL url_
URL
assignment for this
Chronometer
protected long zerotime_
protected boolean first_
false
as soon as the first
interval has been requested
Constructor Detail |
protected Chronometer(URL url)
url
- The assigned URL
Method Detail |
protected static Chronometer instanceFor(URL url)
Chronometer
instance for a given URL
.
If there has no Chronometer
instance assigned to the
specified URL
yet, a new instance will be created.
url
- The URL
to create the
Chronometer
for
Chronometer
instance assigned to
the given URL
static void changeInterval(Long interval)
interval
- The new interval lengthpublic URL getURL()
URL
this Chronometer
instance
has been assigned to.
URL
public StringBuffer nextInterval(long logtime)
logtime
- Timestamp of last log message
public void finalize()
null
references from the storage
of deployed Chronometer
objects.
public boolean equals(Object obj)
public int hashCode()
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |