Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B119D7775 for ; Mon, 29 Aug 2011 17:43:08 +0000 (UTC) Received: (qmail 23608 invoked by uid 500); 29 Aug 2011 17:43:08 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 23421 invoked by uid 500); 29 Aug 2011 17:43:07 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 23412 invoked by uid 99); 29 Aug 2011 17:43:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Aug 2011 17:43:07 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Aug 2011 17:43:04 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 354BFD5DDE for ; Mon, 29 Aug 2011 17:42:43 +0000 (UTC) Date: Mon, 29 Aug 2011 17:42:43 +0000 (UTC) From: "Christian Schneider (JIRA)" To: dev@camel.apache.org Message-ID: <312772789.3931.1314639763214.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <392436983.13497.1314277837027.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Issue Comment Edited] (CAMEL-4381) Simplify ServiceSupport and introduce ServiceWithStatus interface to remove tangle between util and support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CAMEL-4381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13092932#comment-13092932 ] Christian Schneider edited comment on CAMEL-4381 at 8/29/11 5:42 PM: --------------------------------------------------------------------- I have now finished an implementation. org.apache.camel.StatefulService is the interface for services that support start, stop, suspend, resume. So every class that does not need the implementation uses this interface. ServiceSupport is moved to org.apache.camel.support a deprecated stub is left in impl. ServiceSupport does not support children. For this case ChildServiceSupport is used. Now one thing I struggle with a bit is DefaultTimeOutMap and some related classes. It needs ServiceSupport so if we keep it in util then we have a dependency from util to support. On the other hand currently ChildServiceSupport uses ServiceHelper. So we have a dependency from support to util. I see two solutions: 1) Move DefaulTimeOutMap to support 2) Do not use ServiceHelper in ServiceSupport In the end it comes down to the question: Should support classes be allowed to use util classes? Then we have to go with 1) was (Author: chris@die-schneider.net): I have now finished an implementation. org.apache.camel.StateFulService is the interface for services that support start, stop, suspend, resume. So every class that does not need the implementation uses this interface. ServiceSupport is moved to org.apache.camel.support a deprecated stub is left in impl. ServiceSupport does not support children. For this case ChildServiceSupport is used. Now one thing I struggle with a bit is DefaultTimeOutMap and some related classes. It needs ServiceSupport so if we keep it in util then we have a dependency from util to support. On the other hand currently ChildServiceSupport uses ServiceHelper. So we have a dependency from support to util. I see two solutions: 1) Move DefaulTimeOutMap to support 2) Do not use ServiceHelper in ServiceSupport In the end it comes down to the question: Should support classes be allowed to use util classes? Then we have to go with 1) > Simplify ServiceSupport and introduce ServiceWithStatus interface to remove tangle between util and support > ----------------------------------------------------------------------------------------------------------- > > Key: CAMEL-4381 > URL: https://issues.apache.org/jira/browse/CAMEL-4381 > Project: Camel > Issue Type: Improvement > Components: camel-core > Affects Versions: 2.8.0 > Reporter: Christian Schneider > Assignee: Christian Schneider > Fix For: 2.9.0 > > > Currently ServiceSupport and ServiceHelper form a dependency cycle. ServiceSupport calls ServiceHelper to start and stop services and ServiceSupport operate on ServiceSupport classes. > To solve that I introduce an Interface ServiceWithSupport (open for a better naming). This interface extends Service and has all relevant methods from ServiceSupport. So ServiceHelper can operate on ServiceWithStatus and the tangle goes away. > Addtionally I split up ServiceSupport into ServiceSupport which has no children and ChildServiceSupport which has. This is because we seem to have only two classes that actually use the children functionality. The rest of the classes that extend ServiceSupport have no children. So having them all extend the old ServiceSupport introduces a lot of unneeded complexity. > The change should be fairly compatible. The only possible problem are third party components that use children. As we only had two such components in camel the chance that something breaks is fairly low. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira