Thursday 24 October 2013

How to make service sleep in webMethods

Problem 

Suspending execution for a specified period is an efficient means of making processor time available to the other threads of an application or other applications that might be running on a computer system.

Solution

Making service sleep in webMethods can be implemented in a Java Service in webMethods. The code snippet is as follows.

IDataCursor idc = pipeline.getCursor();
int inString = IDataUtil.getInt( idc, "milliseconds", 0);

try{
           //do what you want to do before sleeping
           Thread.sleep(inString); //sleep for 1000 ms
           //do what you want to do after sleeptig
}
catch(InterruptedException ie){
           //If this thread was intrrupted by nother thread
}

idc.destroy();

1 comment:

  1. Lucky 8 Casino (RTP) Charting 2021 - Mapyro
    Lucky 8 Casino, RTP: 96.25%, medium volatility. 여주 출장샵 The Lucky 8 Casino is a simple to use website with a full layout of 안동 출장마사지 slots, table games 당진 출장샵 and video  Rating: 안양 출장안마 3.7 · ‎17 오산 출장샵 votes

    ReplyDelete