Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 94805 invoked from network); 17 Sep 2010 15:51:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Sep 2010 15:51:14 -0000 Received: (qmail 48378 invoked by uid 500); 17 Sep 2010 15:51:13 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 48170 invoked by uid 500); 17 Sep 2010 15:51:11 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 48157 invoked by uid 99); 17 Sep 2010 15:51:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Sep 2010 15:51:10 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.85.173.253] (HELO server.dankulp.com) (64.85.173.253) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Sep 2010 15:51:04 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id B6EFC186750; Fri, 17 Sep 2010 11:50:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter-users@cxf.apache.org.M9h8fHACS4 Received: from dilbert.dankulp.com (c-24-91-72-253.hsd1.ma.comcast.net [24.91.72.253]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTPSA id B558A18674E; Fri, 17 Sep 2010 11:50:40 -0400 (EDT) From: Daniel Kulp To: users@cxf.apache.org Subject: Re: @ThreadScope equivalent in CXF? Date: Fri, 17 Sep 2010 11:49:09 -0400 User-Agent: KMail/1.13.5 (Linux/2.6.35; KDE/4.5.1; x86_64; ; ) Cc: Christian Lindell References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009171149.09664.dkulp@apache.org> X-Old-Spam-Status: No, score=-2.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.1 On Friday 17 September 2010 10:14:30 am Christian Lindell wrote: > Hi! > > Is there any equivalent of the JAX-WS RI @ThreadScope in CXF? > > Description: > https://jax-ws-commons.dev.java.net/nonav/thread-scope/ > > I need it in my service (not client) for allowing thread safe access and > reuse of connections so it's more or less the same use-case described on > that webpage. How can I achieve this? There are two options: 1) Use the spring scopes and aop-proxy - this is generally what I recommend for normal scoping things such as per-request and session scopes as Spring has them built in. Unfortunately, there isn't a "thread" scope built into spring 2.x (looks like it's added to Spring 3.x). However, there are some blogs/docs for adding it: http://springindepth.com/book/in-depth-ioc-scope.html http://blog.progs.be/?p=111 2) The cxf jaxws:endpoint/server config things have an invoker config element that can be used to specify a custom invoker. You can either subclass the JAXWSMethodInvoker that we use or provide a custom Factory to it's constructor. You could use one of our factories: http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/ as a starting point. -- Daniel Kulp dkulp@apache.org http://dankulp.com/blog