|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.varia.property.SystemPropertiesService
A service to access system properties.
| Nested Class Summary | |
protected static class |
SystemPropertiesService.HTMLMap
A helper to render a map as HTML on toString() |
| Field Summary | |
protected String |
serverHome
The server's home dir as a string (for making urls). |
| Fields inherited from class org.jboss.system.ServiceMBeanSupport |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
| Fields inherited from interface org.jboss.varia.property.SystemPropertiesServiceMBean |
OBJECT_NAME |
| Fields inherited from interface org.jboss.system.ServiceMBean |
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(org.jboss.util.property.PropertyListener listener)
Add a property listener. |
void |
addListener(String typename)
Construct and add a property listener. |
void |
addListeners(org.jboss.util.property.PropertyListener[] listeners)
Add an array of property listeners. |
boolean |
exists(String name)
Check if a system property of the given name exists. |
String |
get(String name)
Get a system property. |
String |
get(String name,
String defaultValue)
Get a system property. |
List |
getArray(String name)
Get an array style system property. |
List |
getArray(String base,
List defaultValues)
Get an array style system property. |
org.jboss.util.property.PropertyGroup |
getGroup(String basename)
Get a property group for under the given system property base. |
org.jboss.util.property.PropertyGroup |
getGroup(String basename,
int index)
Get a property group for under the given system property base at the given index. |
void |
load(String url)
Load some system properties from the given URL. |
void |
load(URL url)
Load some system properties from the given URL. |
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
Setup our reference to the server's home directory. |
String |
remove(String name)
Remove a system property. |
boolean |
removeListener(org.jboss.util.property.PropertyListener listener)
Remove a property listener. |
String |
set(String name,
String value)
Set a system property. |
void |
setProperties(Properties props)
Set system properties by merging the given properties object. |
void |
setURLList(String list)
Load system properties for each of the given comma separated urls. |
Map |
showAll()
Return a Map of System.getProperties() with a toString implementation that provides an html table of the key/value pairs. |
Map |
showGroup(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 |
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 |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jboss.system.ServiceMBean |
getName, getState, getStateString, jbossInternalLifecycle |
| Methods inherited from interface org.jboss.system.Service |
create, destroy, start, stop |
| Field Detail |
protected String serverHome
| Constructor Detail |
public SystemPropertiesService()
| Method Detail |
public String set(String name,
String value)
set in interface SystemPropertiesServiceMBeanname - The name of the property to set.value - The value of the property.
public String get(String name,
String defaultValue)
get in interface SystemPropertiesServiceMBeanname - Property namedefaultValue - Default property value
public String get(String name)
get in interface SystemPropertiesServiceMBeanname - Property name
public String remove(String name)
remove in interface SystemPropertiesServiceMBeanname - The name of the property to remove.
public List getArray(String base,
List defaultValues)
getArray in interface SystemPropertiesServiceMBeanbase - Base property namedefaultValues - Default property values
public List getArray(String name)
getArray in interface SystemPropertiesServiceMBeanname - Property name
public boolean exists(String name)
exists in interface SystemPropertiesServiceMBeanname - Property name
public org.jboss.util.property.PropertyGroup getGroup(String basename)
getGroup in interface SystemPropertiesServiceMBeanbasename - Base property name
public org.jboss.util.property.PropertyGroup getGroup(String basename,
int index)
getGroup in interface SystemPropertiesServiceMBeanbasename - Base property nameindex - Array property index
public void addListener(org.jboss.util.property.PropertyListener listener)
addListener in interface SystemPropertiesServiceMBeanlistener - Property listener to addpublic void addListeners(org.jboss.util.property.PropertyListener[] listeners)
addListeners in interface SystemPropertiesServiceMBeanlisteners - Array of property listeners to addpublic boolean removeListener(org.jboss.util.property.PropertyListener listener)
removeListener in interface SystemPropertiesServiceMBeanlistener - Property listener to remove
public void load(URL url)
throws IOException
load in interface SystemPropertiesServiceMBeanurl - The url to load properties from.
IOException
public void load(String url)
throws IOException,
MalformedURLException
load in interface SystemPropertiesServiceMBeanurl - The url to load properties from.
IOException
MalformedURLException
public void addListener(String typename)
throws ClassNotFoundException,
IllegalAccessException,
InstantiationException
addListener in interface SystemPropertiesServiceMBeanClassNotFoundException
IllegalAccessException
InstantiationException
public void setURLList(String list)
throws MalformedURLException,
IOException
setURLList in interface SystemPropertiesServiceMBeanlist - A list of comma separated urls.
MalformedURLException
IOException
public void setProperties(Properties props)
throws IOException
setProperties in interface SystemPropertiesServiceMBeanprops - Properties object to merge.
IOExceptionpublic Map showAll()
showAll in interface SystemPropertiesServiceMBeanpublic Map showGroup(String basename)
showGroup in interface SystemPropertiesServiceMBeanbasename - Base property name
public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws Exception
preRegister in interface javax.management.MBeanRegistrationException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||