发明名称 Applying timed operations to non-timed functions
摘要 For applying timed operations to non-timed functions, a computer causes the computer to discover, by parsing source code, a caller calling a function. The function does not perform timed operations. The computer further encapsulates the function in a timed method adapter and calls the timed method adapter in place of the function from the caller, passing the timed method adapter an object and an argument for the function. The computer further calls an invoke thread from the set invoker and returns from the set invoker to the timed method adapter. The computer waits for an execution result from the function at the timed method adapter, monitoring for an expiration of a timeout, and invokes the function from the invoke thread, passing the function the object and the argument.
申请公布号 US8799924(B2) 申请公布日期 2014.08.05
申请号 US201213595719 申请日期 2012.08.27
申请人 International Business Machines Corporation 发明人 Wang Zhong P.;Ward Matthew J.
分类号 G06F9/46;G06F9/54;G06F9/48 主分类号 G06F9/46
代理机构 Kunzler Law Group 代理人 Kunzler Law Group
主权项 1. A computer readable storage medium comprising a computer readable program stored on a tangible storage device for applying timed operations to non-timed functions, wherein the computer readable program when executed on a computer causes the computer to: discover, by parsing source code, a caller calling a function, wherein the function does not perform timed operations; encapsulate the function in a timed method adapter; call the timed method adapter in place of the function from the caller, passing the timed method adapter an object and an argument for the function; call a set invoker from the timed method adapter, passing the set invoker the object, the function, and the argument for the function; call an invoke thread from the set invoker; return from the set invoker to the timed method adapter; wait for an execution result from the function at the timed method adapter, monitoring for an expiration of a timeout; invoke the function from the invoke thread, passing the function the object and the argument; if the function returns the execution result before expiration of the timeout, return the execution result to the caller; and if the timeout expires before the function returns the execution result, direct the invoke thread to cancel the function and return a timeout exception to the caller.
地址 Armonk NY US