Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 121BB200C04 for ; Tue, 24 Jan 2017 16:22:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 109D8160B3D; Tue, 24 Jan 2017 15:22:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5A212160B31 for ; Tue, 24 Jan 2017 16:22:50 +0100 (CET) Received: (qmail 64466 invoked by uid 500); 24 Jan 2017 15:22:49 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 64456 invoked by uid 99); 24 Jan 2017 15:22:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jan 2017 15:22:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id EE155180688 for ; Tue, 24 Jan 2017 15:22:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.22 X-Spam-Level: X-Spam-Status: No, score=-0.22 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=teiemt-gr.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id BrGxFYUFUCXH for ; Tue, 24 Jan 2017 15:22:47 +0000 (UTC) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 8A14B5FC5F for ; Tue, 24 Jan 2017 15:22:45 +0000 (UTC) Received: by mail-lf0-f41.google.com with SMTP id n124so112570616lfd.2 for ; Tue, 24 Jan 2017 07:22:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=teiemt-gr.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=qurUgTeLMpg7/IwrFjIVkJE4trfHW8UUv9NbDnhouOU=; b=tACc/IzNH6szYoRH0pJrL83dvXrkEvX0wfnAKaoUVcnT5FLmAfxbXL87u14pknXq0Y mijiH1sWvJvcDtu89u+BneJEZlheKJTVp5u+ZX//QyAJECD38/b4O11oJUsog6ISssH5 k9xXq0oy4lgL0XXOpUJNFeEwLJmNc7SSCq3WVQMamYhgzLGuumdkRyQi8v1JHVK+Z0FB tMEQ9J11ukSQIA38TShJs1ewD4rq6Ax4OFtPcgZlmcaw6BzRdK0uFhmGBxyOm15zzljX 1P2e6SAzDpWGSwLZBFpJHquDEaC4VtrMPFqiayxUlHkl6p7ykQOefmimchBTGDFuxAe+ OqRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=qurUgTeLMpg7/IwrFjIVkJE4trfHW8UUv9NbDnhouOU=; b=NACAtaax4N6C5hrEViTJiTBqDzI7cxnjys67o15z8d8/nkzS1/GnN608dpiNekTAko rynZ0b9tTcA+yvYZC/ApVoNDV2dDU4Tiqd81AV6HDEcAABCBiBAkkvm8IohxHhy2zBwC IwSVZejTtuxacImf3/l22e2Lv60Sa7TgdKEJsZriOvkycvadmQbWccPZta9FK4p2uQmB speew9vF5iG0i0XIRJ7WTzDUn2zEEfgQxfvD+rUotXl2YYZsctAEarxXlL7Fj2xtB6vs KEFsSWpX/HUObQJZU1Lv07x3hYhk7p3WhakhAAkRGchmY8McIHlTDkz0ahc1i98CL/Z2 eOkg== X-Gm-Message-State: AIkVDXLZ15BUQnv5Y+M2n95Qqz38/jdShehx58DbzCYWU5xIFT/1RduErQyFj2hvbo11lRva X-Received: by 10.223.178.243 with SMTP id g106mr35032033wrd.32.1485271363665; Tue, 24 Jan 2017 07:22:43 -0800 (PST) Received: from [195.130.94.156] (stergLap.teikav.edu.gr. [195.130.94.156]) by smtp.gmail.com with ESMTPSA id 186sm26771221wmw.24.2017.01.24.07.22.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 07:22:42 -0800 (PST) To: users@groovy.apache.org From: sterg Subject: timed interrupts for scripts in GroovyLab Message-ID: <4d3b0bea-e747-a4ef-6e71-605be445d45c@teiemt.gr> Date: Tue, 24 Jan 2017 17:22:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit archived-at: Tue, 24 Jan 2017 15:22:51 -0000 Hi all, finally I managed to have timed interrupted execution of scripts in GroovyLab, by adapting code from a Google search. The following piece of code seems to make good work: if (GlobalValues.timedInterruptScriptingOn==true) { final Map timedInterruptAnnotationParams = new HashMap<>(); timedInterruptAnnotationParams.put("value", GlobalValues.timedInterruptValue); timedInterruptAnnotationParams.put("unit", GeneralUtils.propX(GeneralUtils.classX(TimeUnit.class), TimeUnit.MILLISECONDS.toString())); ASTTransformationCustomizer timedInterruptCustomizer = new ASTTransformationCustomizer(timedInterruptAnnotationParams, TimedInterrupt.class); cf.addCompilationCustomizers(timedInterruptCustomizer); } Thanks! Best Regards Stergios