|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectav.msg.MsgManager
public class MsgManager
Manages Messager instances.
You only need to concern with this class when you want to load message contents from a different repository or configure messagers by a different repository.
The default contents repository loads XML resources with
".msg.xml" extension, from the java
classpath. This repository covers automatic generated resources by Message
Facility according to message definitions in java source files those
annotated with Msg.
The default configuration repository is
MetaBundle.defaultRepository.
If you really need different contents repositories or messagers configured by
different repositories, construct a instance of this class with these two
repositories, and obtain Messagers with getMessager() series
methods.
Otherwise, you can simply obtains Messagers with
Messager.get() series methods of Messager.
| Field Summary | |
|---|---|
MetaRepository |
confRepository
Repository used to load messager configurations. |
MetaRepository |
msgRepository
Repository used to load message contents. |
| Constructor Summary | |
|---|---|
MsgManager(MetaRepository confRepository,
MetaRepository msgRepository)
Construct a new instance. |
|
| Method Summary | |
|---|---|
Messager |
getMessager()
Get a messager with the same name of the calling class, managed by this manager. |
Messager |
getMessager(Class<?> klass)
Get a messager with the same name of the specified class, managed by this manager. |
Messager |
getMessager(Package pkg)
Get a messager with the same name of the specified class, managed by this manager. |
Messager |
getMessager(String name)
Get a messager with specified name managed by this manager. |
void |
reload()
Reload all Messagers, reconfigure them. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final MetaRepository confRepository
public final MetaRepository msgRepository
| Constructor Detail |
|---|
public MsgManager(MetaRepository confRepository,
MetaRepository msgRepository)
confRepository - repository used to configure new Messagers.msgRepository - used by new Messagers to load message
contents.| Method Detail |
|---|
public void reload()
Messagers, reconfigure them. After all
Handlers and
Formatters reloaded due to new configuration.
public Messager getMessager(String name)
name - the messager's name
namepublic Messager getMessager(Class<?> klass)
klass - a class
klasspublic Messager getMessager(Package pkg)
pkg - a package
pkgpublic Messager getMessager()
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||