|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jmx4odp.dynamicManagement.PropertyReaderFactory
public final class PropertyReaderFactory
This object fetches PropertyReaders.
If this object exists within the same JVM as a JMX agent,
it will keep track of all PropertyReaders created by
resource files and will make sure that there are only
on instance per resource. So if five processes request a
PropertyReader for resource X, they will all get the same
property reader.
This Factory will also try to register itself with the local
JMX agent.
The follow snippet will load the log4j.properies file out of the class path
and create a PropertyReader object. The PropertyReader will be instrumented
as an mbean. At this point, the properties will be stored in an in memory
singleton tracked by the PropertyReaderFactory.
To create PropertyReader objects:
PropertyReader pr = PropertyReaderFactory.getPropertyReader("log4j");
| Method Summary | |
|---|---|
static PropertyReader |
getPropertyReader(java.lang.Class classDef,
java.util.HashMap map)
Create a new property reader based upon this hash map. |
static PropertyReader |
getPropertyReader(java.lang.Class classDef,
java.lang.String resource)
Get a propertyReader from a resource bundle. |
static PropertyReader |
getPropertyReader(java.util.HashMap map)
Create a new property reader based upon this hash map. |
static PropertyReader |
getPropertyReader(java.lang.String resource)
same as getpropertyReader(resource, true); |
static PropertyReader |
getPropertyReader(java.lang.String resource,
boolean keep)
Get a propertyReader from a resource bundle. |
static void |
initialize()
If possible, create the hash cache for PropertyReaders and register itself as a MBean with the local JMX agent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void initialize()
public static PropertyReader getPropertyReader(java.lang.String resource)
public static PropertyReader getPropertyReader(java.lang.String resource,
boolean keep)
resource, - name of resource bundlekeep, - true to keep reference to property reader, false to just create and let gopublic static PropertyReader getPropertyReader(java.util.HashMap map)
public static PropertyReader getPropertyReader(java.lang.Class classDef,
java.lang.String resource)
throws java.lang.Exception
exception - if it cannot instantiate the class
java.lang.Exception
public static PropertyReader getPropertyReader(java.lang.Class classDef,
java.util.HashMap map)
throws java.lang.Exception
exception - if it cannot instantiate the class
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||