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 085ED200C7C for ; Mon, 5 Jun 2017 12:30:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 07477160BD4; Mon, 5 Jun 2017 10:30:47 +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 4D21A160BBF for ; Mon, 5 Jun 2017 12:30:46 +0200 (CEST) Received: (qmail 89100 invoked by uid 500); 5 Jun 2017 10:30:45 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 89088 invoked by uid 99); 5 Jun 2017 10:30:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2017 10:30:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 87466CF407 for ; Mon, 5 Jun 2017 10:30:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.73 X-Spam-Level: ** X-Spam-Status: No, score=2.73 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=movia-biz.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 2IroAvi-fx16 for ; Mon, 5 Jun 2017 10:30:43 +0000 (UTC) Received: from mail-ua0-f173.google.com (mail-ua0-f173.google.com [209.85.217.173]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D560C60CD8 for ; Mon, 5 Jun 2017 10:30:42 +0000 (UTC) Received: by mail-ua0-f173.google.com with SMTP id x47so73323629uab.0 for ; Mon, 05 Jun 2017 03:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=movia-biz.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=i564GlihxegJ0XSoA9qOzLs3Anem70mxmT2l9NwZElE=; b=YvHj/zA7Fkmxj5yMTJHMD1eNZB8rS4nEP8yFy0aMOAQRF4ek0Up4mfXwT38/nBqQks X08hTxZtdI7lkT6gw6zlZBwX+z5u2Uf3JMZACh5qwTv3pSx/zgmxOoHEzGyWyfQ+aIiQ f6mGFMPSbJAQC0TvgCKvscTS8MLSCKnxVOcm+3PrlFdrXBUZGTpoL9K61GK7RR/ojhs7 sCt/oVnWdjVcps1uNHT9WJukY9jj/imB80islAYHUAwo0UCPOWgnR9M/UaigJMdwFY4s PPn1yV1mRw5FnERhFdKIZNEQPDw/ztQ3w4tNjiHXfV8a4Yyvcc78r9CUeQHJ+ksVzpa6 lVPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=i564GlihxegJ0XSoA9qOzLs3Anem70mxmT2l9NwZElE=; b=Nck/224HFOkD5ACUX1nGnhtwbNoAEnW4giqNx26vEdL6We6ayevdwtNjlA1850SoNJ GM+eC4anOisA7dQraVTHyPQsRPIuddaWUy05Yq5KZMDwWPNcq/qKY+jJ5qWuDO5l4oC6 MBjAaW/Ey4gi7mXunSc/2BnraD2jE3CY/LJnbRP6Jo51Mfx4tTNQFzaymuzcroySf4f9 mlhEKBiuy23SIPfXAS2lMJGkdHOWUqjG06cLAqrbJ95ktbF5xI8IlO1XlyY6zbStk1YS wNTuAp/McCUaMgmVf6vWMT6ZnVlH68ngwu1w0zjgWRzTpxcJnJUaf3h/FxItn2MmfvxR mUrw== X-Gm-Message-State: AODbwcAri+oUbnFBhr/Z1Ns2cj+g/sLUXGsG6O8p8//wVtenesV3l1gZ oToHfTH5t6xSB1AGvH6PP7hYXHz+4CCl9gY= X-Received: by 10.176.75.29 with SMTP id h29mr9157906uaf.40.1496658641721; Mon, 05 Jun 2017 03:30:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.72.20 with HTTP; Mon, 5 Jun 2017 03:30:41 -0700 (PDT) In-Reply-To: References: From: Andrea Lo Pumo Date: Mon, 5 Jun 2017 12:30:41 +0200 Message-ID: Subject: Re: Jsvc start/stop and threads To: Commons Users List Content-Type: multipart/alternative; boundary="f403045e7150b0a49b055133fe4b" archived-at: Mon, 05 Jun 2017 10:30:47 -0000 --f403045e7150b0a49b055133fe4b Content-Type: text/plain; charset="UTF-8" So I need to create the thread inside start() and not in init(). Why in the documentation it is suggested to create threads in init()? "void init(String[] arguments): Here open configuration files, create a trace file, create ServerSockets, Threads" Thanks for the prompt reply. 2017-06-05 12:27 GMT+02:00 Greg Thomas : > If you're terminating your thread, you'll simply need to start a new one. > > Greg > > On 5 June 2017 at 11:24, Andrea Lo Pumo wrote: > > > I am creating a thread in init(), and starting it in start(). > > In the user guide, there is written: > > "void stop(): Inform the Thread to terminate the run(), close the > > ServerSockets". > > So in stop() I am interrupting my thread. > > In the apidocs, there is written "the container may restart the Daemon by > > calling start() after stop().". But, if my thread has finished, it cannot > > be restarted again. (Thread.start() cannot be called after the thread has > > completed execution). > > So, what should I do? > > > > Thanks. > > > --f403045e7150b0a49b055133fe4b--