Hi all,

Jetty indeed has (http://svn.codehaus.org/jetty/jetty/trunk) the ability to
use a Grizzly connector instead of its own NIO connectors but I don't think
it should be viewed as an official Jetty connector. See readme text in Jetty
SVN trunk:

"This is a Jetty Connector that uses the grizzly NIO layer from glassfish.
It is the start of an effort to integrate Jetty with Glassfish, but this
is a very early stage and nothing is working yet....

The compile this you need a maven2 repository with 
modules/grizzly/repository/com/sun/enterprise/appserv-http-engine/9.0-SNAPSH
OT/appserv-http-engine-9.0-SNAPSHOT.jar

Currently this code is a mix of apache and Suns CDDL licenses and the
copyright is variously held by Sun and Mort Bay consulting.  This license
mashup will be resolved as more of the code is written and a proper home
found for it."

The text above might be outdated, but I would suggest to ask details to the
Jetty list directly.

Also, the way the Jetty connector for Restlet works doesn't require the
costly Servlet container layer, it's using a lower level Jetty API. So
performance are very good and could be compared to those of the Grizzly
connector for Restlet.

Best regards,
Jerome


-----Message d'origine-----
De : Thierry Boileau [mailto:[EMAIL PROTECTED] 
Envoyé : vendredi 20 juin 2008 08:56
À : [email protected]
Objet : Re: Using Grizzly adapter with Restlet

Hello Bruce,

I'm not aware that the Jetty connector for Restlet can use the Grizzly 
one, thus this would lead me to use the Jetty connector alone.
But, if anyone knows...

I send the code of a sample basic HTTPS server (this code is the same 
whatever connector you're using).

Best regards,
Thierry Boileau

import java.io.File;

import org.restlet.Component;
import org.restlet.Restlet;
import org.restlet.data.MediaType;
import org.restlet.data.Protocol;
import org.restlet.data.Request;
import org.restlet.data.Response;

public class BasicHttpsServer {
    public static void main(String[] args) {
        // Creates a Restlet whose response to each request is "hello,
world".
        Restlet restlet = new Restlet() {
            @Override
            public void handle(Request request, Response response) {
                response.setEntity("hello, world", MediaType.TEXT_PLAIN);
            }
        };

        // Component declaring only one HTTPS server connector.
        Component component = new Component();
        component.getServers().add(Protocol.HTTPS, 8182);
        component.getDefaultHost().attach("/helloWorld", restlet);

        // Update component's context with keystore parameters.
        File keystoreFile = new File("d:\\temp\\certificats", "myKeystore");
        component.getContext().getParameters().add("keystorePath",
                keystoreFile.toURI().toASCIIString());
        component.getContext().getParameters().add("keystorePassword",
                "storepass");
        component.getContext().getParameters().add("keyPassword",
"keypass");

        try {
            component.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}




>> Hi Bruce,
>>
>> Currently, the Grizzly connector is not ready for production. There are a
>> couple of outstanding bugs that we need to fix. We'd like to run some
>> benchmarks as well before final 1.1 release.
>>
>> However, even if 1.1 release should be ready for production, it would
still
>> be marked as "testing" in our download page:
>> http://www.restlet.org/downloads/ 
>>
>> It's only a couple of months after, when we release 1.2 M1, that 1.1
release
>> will become the "stable" official release instead of 1.0. We try to
follow a
>> release cycle similar to Debian.
>>
>> Now, if stability matters the most, I would recommend using the Jetty
>> connector instead, which we have since Restlet 1.0.
>>
>> Regarding connectors configuration, check this page:
>> http://www.restlet.org/documentation/1.1/connectors
>>
>> Best regards,
>> Jerome
>>
>>     
>
> Hi Jerome,
>
> Thanks for the detailed response. The main reason we want to use Grizzly
> directly is because we simply want a high performance http/https connector
> without any web server capabilities. Embedding Jetty seems like a
reasonable
> approach but we are concerning about the extra processing overhead. Also
since
> Jetty can use Grizzly connector as well, would you recommend using the
Jetty
> extension with Grizzly connector instead of their default connector?
>
> P.S. Is there an existing example of setting up HTTPS using Grizzly
connector?
>
> Regards,
>
>
>
>   

Reply via email to