PATCHES PROPOSED TO BACKPORT:
[ New proposals should be added at the end of the list ]
-* Make server.xml parsing warnings more generic, add support for the NIO connector
-* Connector is no longer an exception case. Any new component can still use setProperty and return a boolean
-* to accept or reject the property
- http://people.apache.org/~fhanik/patches/digester-attribute-warnings.patch
- +1: fhanik, yoavs,funkman
- -1:
-
* IcedTea support. Upcoming Linux distributions will package a (working) open source JRE,
available in /usr. As a result, it could now be possible to use a "/usr/bin/java" binary
if one is present and expect results. [tested on Fedora 8 test 3]
/**
* Set a configured property.
*/
- public void setProperty(String name, String value) {
+ public boolean setProperty(String name, String value) {
String repl = name;
if (replacements.get(name) != null) {
repl = (String) replacements.get(name);
}
- if (!IntrospectionUtils.setProperty(protocolHandler, repl, value)) {
- log.warn("Property " + name + " not found on the protocol handler.");
- }
- }
-
-
- /**
- * Set a configured property.
- */
- public void setPropertyInternal(String name, String value) {
- String repl = name;
- if (replacements.get(name) != null) {
- repl = (String) replacements.get(name);
- }
- IntrospectionUtils.setProperty(protocolHandler, repl, value);
+ return IntrospectionUtils.setProperty(protocolHandler, repl, value);
}
-
/**
* Return a configured property.
*/
public void setAllowTrace(boolean allowTrace) {
this.allowTrace = allowTrace;
- setPropertyInternal("allowTrace", String.valueOf(allowTrace));
+ setProperty("allowTrace", String.valueOf(allowTrace));
}
public void setEmptySessionPath(boolean emptySessionPath) {
this.emptySessionPath = emptySessionPath;
- setPropertyInternal("emptySessionPath", String.valueOf(emptySessionPath));
+ setProperty("emptySessionPath", String.valueOf(emptySessionPath));
}
public void setEnableLookups(boolean enableLookups) {
this.enableLookups = enableLookups;
- setPropertyInternal("enableLookups", String.valueOf(enableLookups));
+ setProperty("enableLookups", String.valueOf(enableLookups));
}
public void setMaxSavePostSize(int maxSavePostSize) {
this.maxSavePostSize = maxSavePostSize;
- setPropertyInternal("maxSavePostSize", String.valueOf(maxSavePostSize));
+ setProperty("maxSavePostSize", String.valueOf(maxSavePostSize));
}
public void setPort(int port) {
this.port = port;
- setPropertyInternal("port", String.valueOf(port));
+ setProperty("port", String.valueOf(port));
}
if(proxyName != null && proxyName.length() > 0) {
this.proxyName = proxyName;
- setPropertyInternal("proxyName", proxyName);
+ setProperty("proxyName", proxyName);
} else {
this.proxyName = null;
removeProperty("proxyName");
public void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
- setPropertyInternal("proxyPort", String.valueOf(proxyPort));
+ setProperty("proxyPort", String.valueOf(proxyPort));
}
public void setRedirectPort(int redirectPort) {
this.redirectPort = redirectPort;
- setPropertyInternal("redirectPort", String.valueOf(redirectPort));
+ setProperty("redirectPort", String.valueOf(redirectPort));
}
public void setSecure(boolean secure) {
this.secure = secure;
- setPropertyInternal("secure", Boolean.toString(secure));
+ setProperty("secure", Boolean.toString(secure));
}
/**
public void setURIEncoding(String URIEncoding) {
this.URIEncoding = URIEncoding;
- setPropertyInternal("uRIEncoding", URIEncoding);
+ setProperty("uRIEncoding", URIEncoding);
}
public void setUseBodyEncodingForURI(boolean useBodyEncodingForURI) {
this.useBodyEncodingForURI = useBodyEncodingForURI;
- setPropertyInternal
+ setProperty
("useBodyEncodingForURI", String.valueOf(useBodyEncodingForURI));
}
*/
public void setXpoweredBy(boolean xpoweredBy) {
this.xpoweredBy = xpoweredBy;
- setPropertyInternal("xpoweredBy", String.valueOf(xpoweredBy));
+ setProperty("xpoweredBy", String.valueOf(xpoweredBy));
}
/**
*/
public void setUseIPVHosts(boolean useIPVHosts) {
this.useIPVHosts = useIPVHosts;
- setPropertyInternal("useIPVHosts", String.valueOf(useIPVHosts));
+ setProperty("useIPVHosts", String.valueOf(useIPVHosts));
}
/**
* @param name
* @param value
*/
- public void setProperty(String name, String value) {
- setProperty(name, (Object) value);
+ public boolean setProperty(String name, String value) {
+ return setProperty(name, (Object) value);
}
/**
* @param name
* @param value
*/
- public void setProperty(String name, Object value) {
- if (log.isTraceEnabled())
- log.trace(sm.getString("SimpleTcpCluster.setProperty", name, value,properties.get(name)));
+ public boolean setProperty(String name, Object value) {
properties.put(name, value);
- //using a dynamic way of setting properties is nice, but a security risk
- //if exposed through JMX. This way you can sit and try to guess property names,
- //we will only allow explicit property names
- log.warn("Dynamic setProperty("+name+",value) has been disabled, please use explicit properties for the element you are trying to identify");
- if(started) {
- // FIXME Hmm, is that correct when some DeltaManagers are direct configured inside Context?
- // Why we not support it for other elements, like sender, receiver or membership?
- // Must we restart element after change?
-// if (name.startsWith("manager")) {
-// String key = name.substring("manager".length() + 1);
-// String pvalue = value.toString();
-// for (Iterator iter = managers.values().iterator(); iter.hasNext();) {
-// Manager manager = (Manager) iter.next();
-// if(manager instanceof DeltaManager && ((ClusterManager) manager).isDefaultMode()) {
-// IntrospectionUtils.setProperty(manager, key, pvalue );
-// }
-// }
-// }
- }
+ return false;
}
/**
* @param name
* @param value
*/
- public void setProperty(String name, Object value) ;
+ public boolean setProperty(String name, Object value) ;
/**
* get current config
connector = new Connector();
connector.setScheme("https");
connector.setSecure(true);
- connector.setPropertyInternal("SSLEnabled","true");
+ connector.setProperty("SSLEnabled","true");
// FIXME !!!! SET SSL PROPERTIES
} else {
connector = new Connector(protocol);
/**
* Set a property.
*/
- public void setProperty(String name, String value) {
+ public boolean setProperty(String name, String value) {
+ setAttribute(name, value);
if ( name!=null && (name.startsWith("socket.") ||name.startsWith("selectorPool.")) ){
- ep.setProperty(name, value);
+ return ep.setProperty(name, value);
} else {
- ep.setProperty(name,value); //make sure we at least try to set all properties
+ return ep.setProperty(name,value); //make sure we at least try to set all properties
}
- setAttribute(name, value);
}
/**
try {
Method methods[] = findMethods(o.getClass());
- Method setPropertyMethod = null;
+ Method setPropertyMethodVoid = null;
+ Method setPropertyMethodBool = null;
// First, the ideal case - a setFoo( String ) method
for (int i = 0; i < methods.length; i++) {
// save "setProperty" for later
if ("setProperty".equals(methods[i].getName())) {
- setPropertyMethod = methods[i];
+ if (methods[i].getReturnType()==Boolean.TYPE){
+ setPropertyMethodBool = methods[i];
+ }else {
+ setPropertyMethodVoid = methods[i];
+ }
+
}
}
// Ok, no setXXX found, try a setProperty("name", "value")
- if (setPropertyMethod != null) {
+ if (setPropertyMethodBool != null || setPropertyMethodVoid != null) {
Object params[] = new Object[2];
params[0] = name;
params[1] = value;
- setPropertyMethod.invoke(o, params);
- return true;
+ if (setPropertyMethodBool != null) {
+ try {
+ return (Boolean) setPropertyMethodBool.invoke(o, params);
+ }catch (IllegalArgumentException biae) {
+ //the boolean method had the wrong
+ //parameter types. lets try the other
+ if (setPropertyMethodVoid!=null) {
+ setPropertyMethodVoid.invoke(o, params);
+ return true;
+ }else {
+ throw biae;
+ }
+ }
+ } else {
+ setPropertyMethodVoid.invoke(o, params);
+ return true;
+ }
}
} catch (IllegalArgumentException ex2) {
/**
* Generic properties, introspected
*/
- public void setProperty(String name, String value) {
+ public boolean setProperty(String name, String value) {
final String selectorPoolName = "selectorPool.";
final String socketName = "socket.";
try {
if (name.startsWith(selectorPoolName)) {
- IntrospectionUtils.setProperty(selectorPool, name.substring(selectorPoolName.length()), value);
+ return IntrospectionUtils.setProperty(selectorPool, name.substring(selectorPoolName.length()), value);
} else if (name.startsWith(socketName)) {
- IntrospectionUtils.setProperty(socketProperties, name.substring(socketName.length()), value);
+ return IntrospectionUtils.setProperty(socketProperties, name.substring(socketName.length()), value);
} else {
- IntrospectionUtils.setProperty(this,name,value);
+ return IntrospectionUtils.setProperty(this,name,value);
}
}catch ( Exception x ) {
log.error("Unable to set attribute \""+name+"\" to \""+value+"\"",x);
+ return false;
}
}
</subsection>
<subsection name="Catalina">
<changelog>
+ <update>Add NIO connector to server.xml parsing warning, remove Connector as exception case</update>
<fix><bug>43653</bug>Fix SSL buffer mixup when response is unable to write more than socket buffer can handle</fix>
<fix><bug>43643</bug>If connector doesn't support external executor, display warning</fix>
<fix><bug>43641</bug>Property bind multicast address for cluster membership</fix>