Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to time out calling a function from an application

Reply
Thread Tools

How to time out calling a function from an application

 
 
Mullin
Guest
Posts: n/a
 
      04-06-2005
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;
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
time in milliseconds by calling time.time() scriptlearner@gmail.com Python 3 07-25-2009 06:18 AM
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
calling virtual function results in calling function of base class... Andreas Lagemann C++ 8 01-10-2005 11:03 PM
calling virtual function results in calling function of base class ... tiwy C++ 0 01-09-2005 11:17 PM



Advertisments