M
Mullin
inside my program, it will call a function of 3rd party java class,
but sometimes it may hang and no error/exception thrown. then, my
application doesn't work properly.
i want to know how to make the following thrown an exception after a
period of time to my main program, some timeout exception? then, my
application can continue processing.
try {
objLog.info("before convert");
jpegConverted =
objConvertService.convert(_objAttachment.getData(),sExtension,"JPEG",((docconv.service.ImageProfile)
(objObject)));
objLog.info("after convert");
} catch(IllegalFileTypeException _objIlegalfiletypeexception)
{
objLog.err(sContentName + ": Illegal File Type Exception
returned by transcoder.",_objIlegalfiletypeexception);
convertSuccess = false;
} catch(ConvertException _objConvertexception) {
objLog.err(sContentName + ": Convert Exception returned by
transcoder.",_objConvertexception);
convertSuccess = false;
} catch(Exception _objException) {
objLog.err(sContentName + ": Others Exception returned by
transcoder.",_objException);
convertSuccess = false;
}
but sometimes it may hang and no error/exception thrown. then, my
application doesn't work properly.
i want to know how to make the following thrown an exception after a
period of time to my main program, some timeout exception? then, my
application can continue processing.
try {
objLog.info("before convert");
jpegConverted =
objConvertService.convert(_objAttachment.getData(),sExtension,"JPEG",((docconv.service.ImageProfile)
(objObject)));
objLog.info("after convert");
} catch(IllegalFileTypeException _objIlegalfiletypeexception)
{
objLog.err(sContentName + ": Illegal File Type Exception
returned by transcoder.",_objIlegalfiletypeexception);
convertSuccess = false;
} catch(ConvertException _objConvertexception) {
objLog.err(sContentName + ": Convert Exception returned by
transcoder.",_objConvertexception);
convertSuccess = false;
} catch(Exception _objException) {
objLog.err(sContentName + ": Others Exception returned by
transcoder.",_objException);
convertSuccess = false;
}