Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
String beanCache = null;
try{
beanCache = getXPathValue("/sun-ejb-jar/enterprise-beans/ejb[ejb-name=\""+descriptor.getName()+"\"]/bean-cache");
if(beanCache!=null)
{
if(descriptor instanceof EjbEntityDescriptor
|| (descriptor instanceof EjbSessionDescriptor
&& ((EjbSessionDescriptor)descriptor).getSessionType().equals(EjbSessionDescriptor.STATEFUL)))
{
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName()+".passed",
"PASSED [AS-EJB ejb] : bean-cache Element parsed"));
}
else
{
addWarningDetails(result, compName);
result.warning(smh.getLocalString(getClass().getName()+".warning1",
"WARNING [AS-EJB ejb] : bean-cache should be defined only for Stateful Session and Entity Beans"));
}
}
else
{
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-EJB ejb] : bean-cache element not defined"));
}
}catch(Exception ex)
{
addErrorDetails(result, compName);
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".notRun",
"NOT RUN [AS-EJB] : Could not get a beanCache object"));
}
return result;