You can also call the bus.shutdown() to shutdown the Jetty server.

On 8/24/11 7:43 AM, Dennis Sosnoski wrote:
When I create a JAX-RS server and run it in process with the following code:

         JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
         sf.setServiceClass(LibraryRestImpl.class);
         sf.setBindingId(JAXRSBindingFactory.JAXRS_BINDING_ID);
         sf.setAddress("http://localhost:8081/cxf-library-rest";);
         Server server = sf.create();
         synchronized (LibraryRestImpl.class) {
             try {
                 LibraryRestImpl.class.wait(60000);
             } catch (InterruptedException e) {
                 // ignore
             }
         }
         server.stop();
         server.destroy();

the Jetty threads keep running even after the service has been shutdown.
How can I terminate the Jetty server?

Thanks,

   - Dennis



--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Reply via email to