Thanks for your quick answer,

I deal with this problem as I show you next:

public void start() throws Exception{
    if (endPoint == null){
       * endPoint = (EndpointImpl)Endpoint.publish(address, serviceWS);*
        System.out.println("Servidor arrancado y servicio
publicado...");
    } else {
        if (endPoint.getServer().isStopped()) {
            *endPoint.getServer().start();*
            System.out.println("Servidor arrancado y servicio
publicado...");
        }else{
            if (endPoint.isPublished()){
                System.out.println("El servicio ya esta publicado.");

            }
        }
    }

}



public void stopServer()  throws Exception {

*    ServerImpl server = endPoint.getServer();
    server.stop();*
    System.out.println("Servidor detenido...");
}

It seems to work, if there's anyone with any mor idea.....

I can`t use System.out(0), for instance, `cause I must insert my package in
a bigger proyect and is not posible to stop the whole aplication.

I repeat, thanks  a lot.

2012/8/8 Glen Mazza <[email protected]>

> If you're running embedded, I'm not sure there's a robust/reliable way of
> shutting off the web service provider but not the Jetty server running it;
> if you need to maintain the distinction between the two and have the server
> continue to run while the endpoint is shutdown perhaps deploying your web
> service as a WAR on Tomcat or standalone Jetty would be a better option.
>
> Our samples rely on System.exit() to close both, for example:
> http://svn.apache.org/viewvc/**cxf/trunk/distribution/src/**
> main/release/samples/wsdl_**first_https/src/main/java/**
> demo/hw_https/server/Server.**java?revision=1368316&view=**markup<http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/Server.java?revision=1368316&view=markup>
>
> Glen
>
>
> On 08/08/2012 02:42 PM, Juan José Pérez Consuegra wrote:
>
>> Does anyone tell me how to start/stop Jetty server from code. The same
>> with
>> services.
>>
>> thanks.
>>
>>
>

Reply via email to