KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > varia > property > SystemPropertiesServiceMBean


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.varia.property;
23
24 /**
25  * MBean interface.
26  */

27 public interface SystemPropertiesServiceMBean extends org.jboss.system.ServiceMBean {
28
29    //default object name
30
public static final javax.management.ObjectName JavaDoc OBJECT_NAME = org.jboss.mx.util.ObjectNameFactory.create("jboss.varia:type=Service,name=SystemProperties");
31
32    /**
33     * Set a system property.
34     * @param name The name of the property to set.
35     * @param value The value of the property.
36     * @return Previous property value or null */

37   java.lang.String JavaDoc set(java.lang.String JavaDoc name,java.lang.String JavaDoc value) ;
38
39    /**
40     * Get a system property.
41     * @param name Property name
42     * @param defaultValue Default property value
43     * @return Property value or default */

44   java.lang.String JavaDoc get(java.lang.String JavaDoc name,java.lang.String JavaDoc defaultValue) ;
45
46    /**
47     * Get a system property.
48     * @param name Property name
49     * @return Property value or null */

50   java.lang.String JavaDoc get(java.lang.String JavaDoc name) ;
51
52    /**
53     * Remove a system property.
54     * @param name The name of the property to remove.
55     * @return Removed property value or null */

56   java.lang.String JavaDoc remove(java.lang.String JavaDoc name) ;
57
58    /**
59     * Get an array style system property.
60     * @param base Base property name
61     * @param defaultValues Default property values
62     * @return ArrayList of property values or default */

63   java.util.List JavaDoc getArray(java.lang.String JavaDoc base,java.util.List JavaDoc defaultValues) ;
64
65    /**
66     * Get an array style system property.
67     * @param name Property name
68     * @return ArrayList of property values or empty array */

69   java.util.List JavaDoc getArray(java.lang.String JavaDoc name) ;
70
71    /**
72     * Check if a system property of the given name exists.
73     * @param name Property name
74     * @return True if property exists */

75   boolean exists(java.lang.String JavaDoc name) ;
76
77    /**
78     * Get a property group for under the given system property base.
79     * @param basename Base property name
80     * @return Property group */

81   org.jboss.util.property.PropertyGroup getGroup(java.lang.String JavaDoc basename) ;
82
83    /**
84     * Get a property group for under the given system property base at the given index.
85     * @param basename Base property name
86     * @param index Array property index
87     * @return Property group */

88   org.jboss.util.property.PropertyGroup getGroup(java.lang.String JavaDoc basename,int index) ;
89
90    /**
91     * Add a property listener.
92     * @param listener Property listener to add */

93   void addListener(org.jboss.util.property.PropertyListener listener) ;
94
95    /**
96     * Add an array of property listeners.
97     * @param listeners Array of property listeners to add */

98   void addListeners(org.jboss.util.property.PropertyListener[] listeners) ;
99
100    /**
101     * Remove a property listener.
102     * @param listener Property listener to remove
103     * @return True if listener was removed */

104   boolean removeListener(org.jboss.util.property.PropertyListener listener) ;
105
106    /**
107     * Load some system properties from the given URL.
108     * @param url The url to load properties from. */

109   void load(java.net.URL JavaDoc url) throws java.io.IOException JavaDoc;
110
111    /**
112     * Load some system properties from the given URL.
113     * @param url The url to load properties from. */

114   void load(java.lang.String JavaDoc url) throws java.io.IOException JavaDoc, java.net.MalformedURLException JavaDoc;
115
116    /**
117     * Construct and add a property listener.
118     * @param type The type of property listener to add. */

119   void addListener(java.lang.String JavaDoc typename) throws java.lang.ClassNotFoundException JavaDoc, java.lang.IllegalAccessException JavaDoc, java.lang.InstantiationException JavaDoc;
120
121    /**
122     * Load system properties for each of the given comma separated urls.
123     * @param list A list of comma separated urls. */

124   void setURLList(java.lang.String JavaDoc list) throws java.net.MalformedURLException JavaDoc, java.io.IOException JavaDoc;
125
126    /**
127     * 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.
128     * @param props Properties object to merge. */

129   void setProperties(java.util.Properties JavaDoc props) throws java.io.IOException JavaDoc;
130
131    /**
132     * Return a Map of System.getProperties() with a toString implementation that provides an html table of the key/value pairs.
133     */

134   java.util.Map JavaDoc showAll() ;
135
136    /**
137     * 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.
138     * @param basename Base property name
139     * @return Property group */

140   java.util.Map JavaDoc showGroup(java.lang.String JavaDoc basename) ;
141
142 }
143
Popular Tags