|
||||||||||
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.jmx.JMXLogCategories
public class JMXLogCategories
JMX decorator for ILogCategories. Every new log category will implicitly have handler with JMXLogPublisher attached.
Field Summary | |
---|---|
protected ILogCategories |
logCategories
Wrapped categories we're decorating. |
protected MBeanServer |
mBeanServer
MBean server for the log categories. |
protected ObjectName |
objectName
Id of the MBean. |
Constructor Summary | |
---|---|
JMXLogCategories(ILogCategories logCategories,
MBeanServer mBeanServer,
ObjectName parent)
JMXLogCategories differs from LogCategories by implicit handler with JMXLogPublisher in every log category it produces. |
Method Summary | |
---|---|
void |
addLogCategory(String name,
LogCategory category)
Adds log category from outside of the object. |
Map<String,LogCategory> |
getCategories()
Returns IMMUTABLE mapping of categories names to instances of those log categories. |
LogCategory |
getCategory(String name)
Returns existing category by the name or adds new one. |
String[] |
getCategoryNames()
Returns names of all existing log categories. |
String[] |
getCategoryNamesSorted()
Returns names of all existing log categories sorted alphabetically. |
ObjectName |
getJMXLogCategoriesName()
Returns actual JMX object name for this object. |
static ObjectName |
getJMXLogCategoriesName(ObjectName parent)
Gets LogCategories's object name given parent's name. |
static ObjectName |
getJMXLogCategoryName(ObjectName parent,
String categoryName)
|
ObjectName |
getJMXLogCategoryName(String categoryName)
Returns jmx name for the specified category name (obtained from getCategoryNames()). |
boolean |
hasCategory(String name)
Whether some category with specified name exists. |
void |
setLevel(Level newLevel)
Set level for all handlers of all categories. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ILogCategories logCategories
protected MBeanServer mBeanServer
protected ObjectName objectName
Constructor Detail |
---|
public JMXLogCategories(ILogCategories logCategories, MBeanServer mBeanServer, ObjectName parent) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, MalformedObjectNameException, NullPointerException
Can't be instantiated twice for one (JMX Domain,mBeanServer)!
logCategories
- mBeanServer
- parent
-
InstanceAlreadyExistsException
- raised if instantiated twice for one jmx domain
MBeanRegistrationException
NotCompliantMBeanException
MalformedObjectNameException
NullPointerException
Method Detail |
---|
public LogCategory getCategory(String name)
Contains handler with JMXLogPublisher attached.
If you wish to add another handler do: LogCategory myCategory = categories.getCategory("my log"); // create new category myCategory.newHandler(new LogPublisher.ConsolePublisher()); // add new handler with output to the console
getCategory
in interface ILogCategories
name
-
public Map<String,LogCategory> getCategories()
ILogCategories
It does not contain instance of IAgentLogger
.
getCategories
in interface ILogCategories
public String[] getCategoryNames()
ILogCategories
getCategoryNames
in interface ILogCategories
getCategoryNames
in interface JMXLogCategoriesMBean
public String[] getCategoryNamesSorted()
ILogCategories
getCategoryNamesSorted
in interface ILogCategories
getCategoryNamesSorted
in interface JMXLogCategoriesMBean
public boolean hasCategory(String name)
ILogCategories
hasCategory
in interface ILogCategories
public void setLevel(Level newLevel)
ILogCategories
setLevel
in interface ILogCategories
setLevel
in interface JMXLogCategoriesMBean
public void addLogCategory(String name, LogCategory category)
ILogCategories
addLogCategory
in interface ILogCategories
public ObjectName getJMXLogCategoryName(String categoryName) throws PogamutJMXNameException
JMXLogCategoriesMBean
getJMXLogCategoryName
in interface JMXLogCategoriesMBean
PogamutJMXNameException
public static ObjectName getJMXLogCategoryName(ObjectName parent, String categoryName) throws PogamutJMXNameException
PogamutJMXNameException
public ObjectName getJMXLogCategoriesName()
JMXLogCategoriesMBean
getJMXLogCategoriesName
in interface JMXLogCategoriesMBean
public static ObjectName getJMXLogCategoriesName(ObjectName parent) throws PogamutJMXNameException
parent
-
PogamutJMXNameException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |