|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
org.jboss.varia.property.SystemPropertiesService
A service to access system properties.
Nested Class Summary | |
protected static class |
SystemPropertiesService.HTMLMap (src)
A helper to render a map as HTML on toString() |
Field Summary | |
protected java.lang.String |
serverHome
The server's home dir as a string (for making urls). |
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src) |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean (src) |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
SystemPropertiesService()
|
Method Summary | |
void |
addListener(PropertyListener (src) listener)
Add a property listener. |
void |
addListener(java.lang.String typename)
Construct and add a property listener. |
void |
addListeners(PropertyListener (src) [] listeners)
Add an array of property listeners. |
boolean |
exists(java.lang.String name)
Check if a system property of the given name exists. |
java.lang.String |
get(java.lang.String name)
Get a system property. |
java.lang.String |
get(java.lang.String name,
java.lang.String defaultValue)
Get a system property. |
java.util.List |
getArray(java.lang.String name)
Get an array style system property. |
java.util.List |
getArray(java.lang.String base,
java.util.List defaultValues)
Get an array style system property. |
PropertyGroup (src) |
getGroup(java.lang.String basename)
Get a property group for under the given system property base. |
PropertyGroup (src) |
getGroup(java.lang.String basename,
int index)
Get a property group for under the given system property base at the given index. |
void |
load(java.lang.String url)
Load some system properties from the given URL. |
void |
load(java.net.URL url)
Load some system properties from the given URL. |
ObjectName (src) |
preRegister(MBeanServer (src) server,
ObjectName (src) name)
Setup our reference to the server's home directory. |
java.lang.String |
remove(java.lang.String name)
Remove a system property. |
boolean |
removeListener(PropertyListener (src) listener)
Remove a property listener. |
java.lang.String |
set(java.lang.String name,
java.lang.String value)
Set a system property. |
void |
setProperties(java.util.Properties props)
Set system properties by merging the given properties object. |
void |
setURLList(java.lang.String list)
Load system properties for each of the given comma separated urls. |
java.util.Map |
showAll()
Return a Map of System.getProperties() with a toString implementation that provides an html table of the key/value pairs. |
java.util.Map |
showGroup(java.lang.String basename)
Return a Map of the property group for under the given system property base with a toString implementation that provides an html table of the key/value pairs. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src) |
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, start, startService, stop, stopService |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src) |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String serverHome
Constructor Detail |
public SystemPropertiesService()
Method Detail |
public java.lang.String set(java.lang.String name, java.lang.String value)
name
- The name of the property to set.value
- The value of the property.
public java.lang.String get(java.lang.String name, java.lang.String defaultValue)
name
- Property namedefaultValue
- Default property value
public java.lang.String get(java.lang.String name)
name
- Property name
public java.lang.String remove(java.lang.String name)
name
- The name of the property to remove.
public java.util.List getArray(java.lang.String base, java.util.List defaultValues)
base
- Base property namedefaultValues
- Default property values
public java.util.List getArray(java.lang.String name)
name
- Property name
public boolean exists(java.lang.String name)
name
- Property name
public PropertyGroup (src) getGroup(java.lang.String basename)
basename
- Base property name
public PropertyGroup (src) getGroup(java.lang.String basename, int index)
basename
- Base property nameindex
- Array property index
public void addListener(PropertyListener (src) listener)
listener
- Property listener to addpublic void addListeners(PropertyListener (src) [] listeners)
listeners
- Array of property listeners to addpublic boolean removeListener(PropertyListener (src) listener)
listener
- Property listener to remove
public void load(java.net.URL url) throws java.io.IOException
url
- The url to load properties from.
java.io.IOException
public void load(java.lang.String url) throws java.io.IOException, java.net.MalformedURLException
url
- The url to load properties from.
java.io.IOException
java.net.MalformedURLException
public void addListener(java.lang.String typename) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
public void setURLList(java.lang.String list) throws java.net.MalformedURLException, java.io.IOException
list
- A list of comma separated urls.
java.net.MalformedURLException
java.io.IOException
public void setProperties(java.util.Properties props) throws java.io.IOException
props
- Properties object to merge.
java.io.IOException
public java.util.Map showAll()
public java.util.Map showGroup(java.lang.String basename)
basename
- Base property name
public ObjectName (src) preRegister(MBeanServer (src) server, ObjectName (src) name) throws java.lang.Exception
preRegister
in interface MBeanRegistration (src)
preRegister
in class ServiceMBeanSupport (src)
server
- Reference to the JMX Agent this MBean is registered onname
- Name specified by the creator of the MBean. Note that you can
overwrite it when the given ObjectName is null otherwise the
change is discarded (maybe a bug in JMX-RI).
java.lang.Exception
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |