Author: ron.sigal(a)jboss.com
Date: 2009-01-17 23:16:08 -0500 (Sat, 17 Jan 2009)
New Revision: 4828
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/ConnectionValidator.java
Log:
JBREM-1082: If "useAllParams" parameter is set to "true", uses
InvokerLocator parameters.
Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/ConnectionValidator.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/ConnectionValidator.java 2009-01-18
04:13:28 UTC (rev 4827)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/ConnectionValidator.java 2009-01-18
04:16:08 UTC (rev 4828)
@@ -415,6 +415,10 @@
private void getParameters(Client client, Map metadata)
{
+ if (checkUseParametersFromLocator(client, metadata))
+ {
+ getParametersFromMap(client.getInvoker().getLocator().getParameters());
+ }
getParametersFromMap(client.getConfiguration());
getParametersFromMap(metadata);
@@ -429,6 +433,54 @@
}
}
+ private boolean checkUseParametersFromLocator(Client client, Map metadata)
+ {
+ if (client.getInvoker() == null)
+ {
+ return false;
+ }
+ Object o =
client.getInvoker().getLocator().getParameters().get(Client.USE_ALL_PARAMS);
+ if (o != null)
+ {
+ if (o instanceof String)
+ {
+ return Boolean.valueOf(((String) o)).booleanValue();
+ }
+ else
+ {
+ log.warn(this + " could not convert " + Client.USE_ALL_PARAMS +
" value" +
+ " in InvokerLocator to a boolean: must be a String");
+ }
+ }
+ o = client.getConfiguration().get(Client.USE_ALL_PARAMS);
+ if (o != null)
+ {
+ if (o instanceof String)
+ {
+ return Boolean.valueOf(((String) o)).booleanValue();
+ }
+ else
+ {
+ log.warn(this + " could not convert " + Client.USE_ALL_PARAMS +
" value" +
+ " in Client configuration map to a boolean: must be a
String");
+ }
+ }
+ o = metadata.get(Client.USE_ALL_PARAMS);
+ if (o != null)
+ {
+ if (o instanceof String)
+ {
+ return Boolean.valueOf(((String) o)).booleanValue();
+ }
+ else
+ {
+ log.warn(this + " could not convert " + Client.USE_ALL_PARAMS +
" value" +
+ " in metadata map to a boolean: must be a String");
+ }
+ }
+ return false;
+ }
+
private void getParametersFromMap(Map config)
{
if (config != null)
Show replies by date