org.apache.struts.config
public class: DataSourceConfig [javadoc |
source]
java.lang.Object
org.apache.struts.config.DataSourceConfig
All Implemented Interfaces:
Serializable
A JavaBean representing the configuration information of a
<data-source>
element from a Struts
configuration file.
WARNING - The properties of this configuration bean
are recognized by the default data source implementation, but some or all
of them may be ignored by custom data source implementations.
- version:
$
- Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
- since:
Struts
- 1.1
Field Summary |
---|
protected boolean | configured | Has this component been completely configured? |
protected String | key | The servlet context attribute key under which this data source
is stored and made available. |
protected HashMap | properties | The custom configuration properties for this data source implementation. |
protected String | type | The fully qualified class name of the javax.sql.DataSource
implementation class. |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.struts.config.DataSourceConfig Detail: |
public void addProperty(String name,
String value) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
properties.put(name, value);
}
Add a new custom configuration property. |
public void freeze() {
configured = true;
}
Freeze the configuration of this data source. |
public String getKey() {
return (this.key);
}
|
public Map getProperties() {
return (this.properties);
}
|
public String getType() {
return (this.type);
}
|
public void setKey(String key) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.key = key;
}
|
public void setType(String type) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.type = type;
}
|
public String toString() {
StringBuffer sb = new StringBuffer("DataSourceConfig[");
sb.append("key=");
sb.append(key);
sb.append(",type=");
sb.append(type);
Iterator names = properties.keySet().iterator();
while (names.hasNext()) {
String name = (String) names.next();
String value = (String) properties.get(name);
sb.append(',');
sb.append(name);
sb.append('=');
sb.append(value);
}
sb.append("]");
return (sb.toString());
}
Return a String representation of this object. |