ArgChecker.check((e != null), NULL_ARGUMENT);
AFException afe = new AFException(e.getMessage());
if (e instanceof javax.management.MBeanException)
{
Exception targetException =
((javax.management.MBeanException)e).getTargetException();
if (targetException instanceof AFException)
{
afe = (AFException) targetException;
}
// <addition> srini@sun.com server.xml verifier
else if(targetException instanceof AFRuntimeException)
{
throw (AFRuntimeException)targetException;
}
else if (targetException instanceof javax.management.MBeanException)
{
Exception excpn =
((javax.management.MBeanException)targetException).getTargetException();
if (excpn != null) {
if (excpn instanceof javax.management.InvalidAttributeValueException) {
afe = new com.sun.enterprise.admin.common.exception.InvalidAttributeValueException(
excpn.getLocalizedMessage());
}
}
}
// </addition>
else
{
afe = new AFOtherException(targetException);
}
}
else if (e instanceof javax.management.InstanceNotFoundException)
{
String msg = convertInstanceNotFoundExceptionMessage(e);
afe = new AFTargetNotFoundException(msg);
}
else if (e instanceof javax.management.ReflectionException)
{
afe = new AFOtherException(e);
}
else if (e instanceof javax.management.AttributeNotFoundException)
{
afe = new AttributeNotFoundException(e.getLocalizedMessage());
}
else if (e instanceof javax.management.InvalidAttributeValueException)
{
afe = new InvalidAttributeValueException(e.getLocalizedMessage());
}
else if (e instanceof java.lang.RuntimeException)
{
throw (java.lang.RuntimeException) e;
}
return afe;