| Method from org.jboss.varia.property.SystemPropertiesService Detail: |
public void addListener(PropertyListener listener) {
Property.addListener(listener);
}
|
public void addListener(String typename) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
Class type = Class.forName(typename);
PropertyListener listener = (PropertyListener) type.newInstance();
addListener(listener);
}
Construct and add a property listener. |
public void addListeners(PropertyListener[] listeners) {
Property.addListeners(listeners);
}
Add an array of property listeners. |
public boolean exists(String name) {
return Property.exists(name);
}
Check if a system property of the given name exists. |
public String get(String name) {
return Property.get(name);
}
|
public String get(String name,
String defaultValue) {
return Property.get(name, defaultValue);
}
|
public List getArray(String name) {
String[] array = Property.getArray(name);
return Arrays.asList(array);
}
Get an array style system property. |
public List getArray(String base,
List defaultValues) {
String[] array = new String[defaultValues.size()];
defaultValues.toArray(array);
String[] values = Property.getArray(base, array);
return Arrays.asList(values);
}
Get an array style system property. |
public PropertyGroup getGroup(String basename) {
return Property.getGroup(basename);
}
Get a property group for under the given system property base. |
public PropertyGroup getGroup(String basename,
int index) {
return Property.getGroup(basename, index);
}
Get a property group for under the given system property base
at the given index. |
public void load(URL url) throws IOException {
log.trace("Loading system properties from: " + url);
Properties props = System.getProperties();
InputStream is = url.openConnection().getInputStream();
props.load(is);
is.close();
log.info("Loaded system properties from: " + url);
}
Load some system properties from the given URL. |
public void load(String url) throws IOException, MalformedURLException {
load(Strings.toURL(url, serverHome));
}
Load some system properties from the given URL. |
public ObjectName preRegister(MBeanServer server,
ObjectName name) throws Exception {
// get server's home for relative paths, need this for making urls
serverHome = ServerConfigLocator.locate().getServerHomeDir().getPath();
return super.preRegister(server, name);
}
Setup our reference to the server's home directory. This is done
here because one or more attribute setters makes use of this value. |
public String remove(String name) {
return Property.remove(name);
}
Remove a system property. |
public boolean removeListener(PropertyListener listener) {
return Property.removeListener(listener);
}
Remove a property listener. |
public String set(String name,
String value) {
return Property.set(name, value);
}
|
public void setProperties(Properties props) throws IOException {
log.debug("Merging with system properties: " + props);
System.getProperties().putAll(props);
}
Set system properties by merging the given properties object. This will
replace valid references to properties of the form ${x} in 'props' or a
System property with the value of x. |
public void setURLList(String list) throws MalformedURLException, IOException {
StringTokenizer stok = new StringTokenizer(list, ",");
while (stok.hasMoreTokens())
{
String url = stok.nextToken();
load(url);
}
}
Load system properties for each of the given comma separated urls. |
public Map showAll() {
return new HTMLMap(System.getProperties());
}
Return a Map of System.getProperties() with a toString implementation
that provides an html table of the key/value pairs. |
public Map showGroup(String basename) {
return new HTMLMap(getGroup(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. |