Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 55AE1D030 for ; Thu, 18 Oct 2012 03:57:06 +0000 (UTC) Received: (qmail 20067 invoked by uid 500); 18 Oct 2012 03:57:06 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 19525 invoked by uid 500); 18 Oct 2012 03:56:59 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 19489 invoked by uid 99); 18 Oct 2012 03:56:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2012 03:56:58 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.215.45 as permitted sender) Received: from [209.85.215.45] (HELO mail-la0-f45.google.com) (209.85.215.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2012 03:56:52 +0000 Received: by mail-la0-f45.google.com with SMTP id m13so6755122lah.32 for ; Wed, 17 Oct 2012 20:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=9Yu9CgOpfc3NIN9DnsQ0AIu9eGYePTqH1kFevVpm6KU=; b=lUrJLoQMIcPH0sWDp4puEFDQaI7xGHbhYvtQbU85p6jAs1bBXyOzQzuhs7kiKAEnA+ Ein9c3QjSJvB647M/nr/QC0IW9VgZ/yaZYN7I5wgHqjhyt6qb4HfoQqNCpk/7a+J1/Pr Dfvij3ryxP5//qMM+QoCGLk/HHASGSBthQc+E8knJpOnpiQ0+gWDzXLOjiEGKDbpYXDw VWclsuLKHLYm2/6Jzwa9Pl/59UwsAo7OILvujXWi/Ozv9zF9bzvX5B8IJdE+/L7kR7Y9 I5j/MoaeA+mLQi0gAa1V3v6CSM6KIhhWWeD4UY24I/FluiOArIV/KbwXc+5H68VHhWbG lERw== Received: by 10.152.47.79 with SMTP id b15mr17266613lan.57.1350532592209; Wed, 17 Oct 2012 20:56:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.42.9 with HTTP; Wed, 17 Oct 2012 20:56:11 -0700 (PDT) In-Reply-To: References: From: Claus Ibsen Date: Thu, 18 Oct 2012 05:56:11 +0200 Message-ID: Subject: Re: How to execute route on shutdown? To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Oct 15, 2012 at 11:27 PM, Henrique Viecili wrote: > Hello guys... > > I've created a service that register itself on startup using camel-timer > component and now I want to make it unregister itself on shutdown. I know I > could do it registering a Shutdown Hook in the JVM or coding my own > ShutdownStrategy but I am looking for a simple solution preferably using > Spring DSL. Does anyone have done this before? > > Thanks, > *Henrique Viecili* What is your "service". And what do you mean by unreigstering itself on shutdown? >From what should it unregister, and when you say shutdown, it is the CamelContext being stopped or the JVM itself etc.? And with Spring you can simple just do The names of the attributes, you would need to check the spring docs to make sure, as I am not sure if init-method etc is the correct name. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cibsen@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen