Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 77932 invoked from network); 23 May 2008 02:56:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 May 2008 02:56:29 -0000 Received: (qmail 38455 invoked by uid 500); 23 May 2008 02:56:29 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 38403 invoked by uid 500); 23 May 2008 02:56:29 -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 38392 invoked by uid 99); 23 May 2008 02:56:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2008 19:56:29 -0700 X-ASF-Spam-Status: No, hits=2.7 required=10.0 tests=SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [64.79.199.57] (HELO server.dankulp.com) (64.79.199.57) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 May 2008 02:55:34 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id D2CE0197C0C5; Thu, 22 May 2008 22:55:52 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter.xFTTmXQIiF Received: from [192.168.1.148] (c-24-147-10-180.hsd1.ma.comcast.net [24.147.10.180]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTP id D85A9197C0A0; Thu, 22 May 2008 22:55:50 -0400 (EDT) Cc: Markus Henriks Message-Id: From: Daniel Kulp To: users@cxf.apache.org In-Reply-To: <1211463099.5956.406.camel@kjellw-desktop> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: Endpoint#stop() does not close opened port and what happen to received requests when it is called? Date: Thu, 22 May 2008 22:55:48 -0400 References: <1211463099.5956.406.camel@kjellw-desktop> X-Mailer: Apple Mail (2.919.2) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=0.3 required=3.0 tests=BAYES_00,RCVD_IN_PBL, RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,WEIRD_PORT autolearn=no version=3.2.4 We've had major problems with Jetty with shutting down the port and then retrying to restart it immediately. If we tried to cycle things quickly (like a shutdown of one service and than immediately a publish of another on the same port), then requests to the second service sometimes wouldn't get there. Caveat: I'm not sure if the latest Jetty versions have fixed that. In general, we leave it open as that was the only way to make sure we can reliably get the messages. To completely shut it down, you need to shutdown the bus. BusFactory.getDefaultBus().shutdown(true); should completely shutdown everything. To answer your other questions, when you stop a service, all that happens is that the Handler is unregistered with Jetty. Thus, requests that have already been dispatched to the handler will continue. Future requests would get a 404. Dan On May 22, 2008, at 9:31 AM, Kjell Winblad wrote: > Hi, > > I have two question regarding the closing of services. I have made an > user interface for a webservice and it shall be possible to start and > stop the service from the interface. I use the following code to > create > and publish the service: > > import javax.xml.ws.Endpoint; > import org.apache.cxf.jaxws.EndpointImpl; > > ... > > GreeterImpl serverImpl = new GreeterImpl() > Endpoint end = Endpoint.create(serverImpl); > EndpointImpl endpoint = (EndpointImpl) end; > endpoint.setWsdlLocation(wsdlfile); > end.publish("http://localhost:6002/WS"); > > The server uses HTTP as transport and works great. When I check the > opened ports on my machine I can see that CXF has opened the port I > specified in my publish address. The problem occures when I try to > stop > the service. I use the the method stop() on my endpont instance. No > exceptions are thrown and it isn't possible to send requests to the > service anymore. So, the stop method seems to work but the opened port > is still open. What is supposed to happen when stop() is called on an > Endpoint, shall the associated port close? If it shall stay open how > do > I close a port that has been opened by the Endpoint#publish() method? > > The second question is: > What happens with received but not processed requests when > Endpoint#stop() is called? Before the service is stopped I want to be > sure that response messages for all the requests that already have > been > recived to the service have been sent. So, does the Endpoint#stop() > method wait until all response messages for incoming request have been > sent before it stops the service? > > Thanks in advance, > Kjell Winblad > > --- Daniel Kulp dkulp@apache.org http://www.dankulp.com/blog