|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.amis.pogamut.base.utils.logging.LogPublisher
cz.cuni.amis.pogamut.base.utils.logging.jmx.JMXLogPublisher
public class JMXLogPublisher
Nested Class Summary |
---|
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.base.utils.logging.LogPublisher |
---|
LogPublisher.ConsolePublisher, LogPublisher.FilePublisher |
Field Summary | |
---|---|
protected String |
categoryName
Category name of the publisher. |
protected NotificationBroadcasterSupport |
notification
Support for the JMX notification broadcasting. |
protected long |
sequenceNumber
Sequence number for the published logs. |
Fields inherited from class cz.cuni.amis.pogamut.base.utils.logging.LogPublisher |
---|
formatter |
Constructor Summary | |
---|---|
JMXLogPublisher()
Initialize publisher with the simplest formatter - just publishing the message. |
|
JMXLogPublisher(Formatter formatter)
Initialize the publisher with prespecified formatter. |
|
JMXLogPublisher(ObjectName parent,
String categoryName)
|
Method Summary | |
---|---|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
void |
close()
From JavaDoc API: Close the Handler and free all associated resources. |
void |
flush()
From JavaDoc API: Flush any buffered output. |
String |
getCategoryName()
|
MBeanNotificationInfo[] |
getNotificationInfo()
|
void |
publish(LogRecord record)
From JavaDoc API: Publish a LogRecord. |
void |
publish(LogRecord record,
String formattedMsg)
Not used, things are published directly via publish(LogRecord) |
void |
removeNotificationListener(NotificationListener listener)
|
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
Methods inherited from class cz.cuni.amis.pogamut.base.utils.logging.LogPublisher |
---|
getFormatter, setFormatter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected NotificationBroadcasterSupport notification
protected String categoryName
protected long sequenceNumber
Constructor Detail |
---|
public JMXLogPublisher()
public JMXLogPublisher(Formatter formatter)
WARNING: if formatter is null, nothing will be published via JMX!
formatter
- public JMXLogPublisher(ObjectName parent, String categoryName) throws MalformedObjectNameException
MalformedObjectNameException
Method Detail |
---|
public String getCategoryName()
getCategoryName
in interface JMXLogPublisherMBean
public void close() throws SecurityException
ILogPublisher
Close the Handler and free all associated resources.
The close method will perform a flush and then close the Handler. After close has been called this Handler should no longer be used. Method calls may either be silently ignored or may throw runtime exceptions.
close
in interface ILogPublisher
close
in class LogPublisher
SecurityException
- if a security manager exists and if
the caller does not have LoggingPermission("control").public void flush()
ILogPublisher
Flush any buffered output.
flush
in interface ILogPublisher
flush
in class LogPublisher
public void publish(LogRecord record)
ILogPublisher
Publish a LogRecord.
The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.
The Handler is responsible for formatting the message, when and if necessary. The formatting should include localization.
publish
in interface ILogPublisher
publish
in class LogPublisher
record
- description of the log event. A null record is
silently ignored and is not publishedpublic void publish(LogRecord record, String formattedMsg)
publish
in class LogPublisher
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationEmitter
ListenerNotFoundException
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
addNotificationListener
in interface NotificationBroadcaster
IllegalArgumentException
public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface NotificationBroadcaster
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationBroadcaster
ListenerNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |