The contraint is the requirement that “access to the data would have to be synchronized”. This means that there isn’t a way to have multiple concurrent read operations, then you will always have a bottleneck.
I would think that configuration data could have a “synchronized mode” for use during development, when the configuration data is being changed often, but then could be set to run in unsynchronized read mode during production. You could have a service that could set the mode back to synchronized in case the production system configuration needs to be tweeked. You configuration get/set methods could look something like:
private HashMap configData = new HashMap();
private static boolean shouldSynchronize = true;
private static int DATA1_DEFAULT = 10;
public int getConfigData1(int data1Value)
{
if (shouldSynchronize) {
synchronize(configData) {
return getConfigData1Unsynchronized();
}
else
return getConfigData1Unsynchronized();
}
private int getConfigData1Unsynchronized()
{
Integer data1 = (Integer)configData.get("data1");
if (data1 != null) return data1.intValue();
else return DATA1_DEFAULT;
}
public void setConfigData1(int data1Value)
{
synchronize(configData) {
setConfigData1Unsynchronized(data1Value);
}
}
private void setConfigData1Unsynchronized(int data1Value)
{
configData.put("data1", new Integer(data1Value));
}
public void setShouldSynchronize(boolean value)
{
shouldSynchronize = value;
}
public boolean isShouldSynchronize()
{
return shouldSynchronize;
}
What does everyone think?
#webMethods#webMethods-General#Integration-Server-and-ESB