public void importXml(Element element) throws DeploymentException {
super.importXml(element);
String rp = MetaData.getElementContent(MetaData.getOptionalChild(element, "remover-period"));
String ml = MetaData.getElementContent(MetaData.getOptionalChild(element, "max-bean-life"));
try
{
if (rp != null)
{
int p = Integer.parseInt(rp);
if (p < = 0)
{
throw new DeploymentException("Remover period can't be < = 0");
}
m_removerPeriod = p * 1000;
}
if (ml != null)
{
int a = Integer.parseInt(ml);
if (a < = 0)
{
throw new DeploymentException("Max bean life can't be < = 0");
}
m_maxBeanLife = a * 1000;
}
}
catch (NumberFormatException x)
{
throw new DeploymentException("Can't parse policy configuration", x);
}
}
Reads from the configuration the parameters for this cache policy, that
are all optionals. |