Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
String pool = null;
String poolIdleTimeout = null;
try
{
pool = getXPathValue("/sun-ejb-jar/enterprise-beans/ejb[ejb-name=\""+descriptor.getName()+"\"]/bean-pool");
if (pool!=null)
{
poolIdleTimeout = getXPathValue("/sun-ejb-jar/enterprise-beans/ejb[ejb-name=\""+descriptor.getName()+"\"]/bean-pool/pool-idle-timeout-in-seconds");
try{
if (poolIdleTimeout!=null)
{
poolIdleTimeout = poolIdleTimeout.trim();
if (poolIdleTimeout.length()==0)
{
addErrorDetails(result, compName);
result.failed(smh.getLocalString(getClass().getName()+".failed",
"FAILED [AS-EJB bean-pool] : pool-idle-timeout-in-seconds cannot be empty"));
}else
{
long value = new Integer(poolIdleTimeout).longValue();
if(value < 0 || value > Long.MAX_VALUE)
{
addErrorDetails(result, compName);
result.failed(smh.getLocalString(getClass().getName()+".failed1",
"FAILED [AS-EJB bean-pool] : pool-idle-timeout-in-seconds cannot be {0}. It should be between 0 and {1}",
new Object[]{new Long(value),new Long(Long.MAX_VALUE)}));
}
else
{
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName()+".passed",
"PASSED [AS-EJB bean-pool] : pool-idle-timeout-in-seconds is {0}",
new Object[]{new Long(value)}));
}
}
}else // if pool-idle-timeout is not specified
{
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-EJB bean-pool] : pool-idle-timeout-in-seconds element not defined"));
}
}catch(NumberFormatException nfex){
Verifier.debug(nfex);
addErrorDetails(result, compName);
result.failed(smh.getLocalString(getClass().getName()+".failed2",
"FAILED [AS-EJB bean-pool] : The value [ {0} ] for pool-idle-timeout-in-seconds is not a valid Integer number",new Object[]{poolIdleTimeout}));
}
}else //if bean-pool elememnt is not present
{
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable1",
"NOT APPLICABLE [AS-EJB] : bean-pool element not defined"));
}
}catch (Exception ex){
addErrorDetails(result, compName);
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".notRun",
"NOT RUN [AS-EJB] : Could not create the descriptor object"));
}
return result;