|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.logging.Handler de.fhg.igd.logging.sun.URLHandler
Depending on the configured buffer size, this
Handler
will open a URLOutputStream
which will be linked into either a simple StreamHandler
or an
AsynchronousStreamHandler
which is being wrapped by this class.
On dynamic configuration changes, this wrapped Handler
might
get exchanged accordingly.
Field Summary | |
protected Integer |
buffersize_
The buffer size |
private static Set |
cache_
The storage for deployed URLHandler objects |
private Chronometer |
cm_
The Chronometer that is assigned to the output
destination of this Handler |
private int |
cnt_
The reference counter |
protected StreamHandler |
sh_
The wrapped target StreamHandler |
Fields inherited from class java.util.logging.Handler |
|
Constructor Summary | |
protected |
URLHandler(Chronometer cm)
Hidden URLHandler construction. |
Method Summary | |
void |
close()
This method will close underlying streams, remove this Handler from the cache in case no further
reference exists. |
private static StreamHandler |
createTarget(OutputStream os,
Formatter formatter,
int bufsize)
Create the target StreamHandler . |
boolean |
equals(Object obj)
|
(package private) static URLHandler |
findFor(Chronometer cm)
Find a URLHandler instance that has already been created
before. |
void |
flush()
|
Integer |
getBufferSize()
Get the size of the internal message buffer. |
URL |
getOutputDestination()
Get the output destination URL . |
int |
hashCode()
|
void |
publish(LogRecord record)
Hand over a record to the target Handler . |
(package private) static URLHandler |
requestFor(Chronometer cm)
Request a URLHandler . |
String |
toString()
|
void |
updateBufferSize(Integer buffersize)
Update the size of the internal message buffer. |
Methods inherited from class java.util.logging.Handler |
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static Set cache_
URLHandler
objects
private int cnt_
private Chronometer cm_
Chronometer
that is assigned to the output
destination of this Handler
protected Integer buffersize_
protected StreamHandler sh_
StreamHandler
Constructor Detail |
protected URLHandler(Chronometer cm)
URLHandler
construction.
cm
- The Chronometer
that is assigned to the
URL
to create the Handler
for
LoggingException
- if creating the corresponding
URLOutputStream
failedMethod Detail |
static URLHandler requestFor(Chronometer cm)
URLHandler
. In case the requested instance
has been created before, a reference to the existing instance will
be returned and counted.
cm
- The Chronometer
that is assigned to the
URL
that the Handler
is requested for
Handler
objectstatic URLHandler findFor(Chronometer cm)
URLHandler
instance that has already been created
before. If no instance could be found for the given URL
,
null
will be returned.
cm
- The Chronometer
that is assigned to the
URL
to find the corresponding Handler
for
URLHandler
or null
if no instance for the given Chronometer
has been
created yetprivate static StreamHandler createTarget(OutputStream os, Formatter formatter, int bufsize)
StreamHandler
.
os
- The underlying output streamformatter
- The log record formatterbufsize
- The size of the internal message bufferpublic void publish(LogRecord record)
Handler
.
record
- The log record to be publishedpublic void flush()
public void close()
Handler
from the cache in case no further
reference exists.
public URL getOutputDestination()
Forwarder
URL
.
getOutputDestination
in interface Forwarder
public Integer getBufferSize()
Forwarder
getBufferSize
in interface Forwarder
public void updateBufferSize(Integer buffersize) throws LoggingException
Forwarder
updateBufferSize
in interface Forwarder
buffersize
- The new size of the internal message buffer
LoggingException
- in case updating the message buffer size failedpublic 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 |