質問

Looking for the guice support in restlet I have come across this article - http://wiki.restlet.org/developers/172-restlet/257-restlet/284-restlet.html

But neither version 2.0 (stable) nor 2.1 (release candidate) contains org.restlet.ext.guice.jar

So, my question is what is its status? Where can I download it? I am using restlet 2.0

Thanks.

役に立ちましたか?

解決

I am the maintainer of the org.restlet.ext.guice project currently in the Restlet incubator. I see no obstacles to using it as it stands. I've just checked in some doc and source clarifications. Jerome Louvel has put its promotion to Restlet extension on the Restlet roadmap for release 2.3, but says he would be willing to move it earlier.

Because it is in the incubator, there is no official jar release; it consists of two source files, FinderFactory.java and RestletGuice.java. FinderFactory depends only on Restlet's Finder class. RestletGuice depends, not surprisingly, on both Restlet and Guice. It works with Guice 3.0 and has worked in the past with earlier versions of Guice.

There is also a simple example package (org.restlet.ext.guice.example) consisting of a Qualifier type and a Component that illustrates the use of FinderFactory in two different modes: (1) With the Injector explicitly creating using the RestletGuice class, and (2) with the Injector automatically created on first use of the RestletGuice.Module class as a FinderFactory. The example makes use of javax.inject interfaces as a way of emphasizing that the use of FinderFactory is independent of dependency-injection framework; it is only the use of RestletGuice that carries the Guice-specific dependency. Because some earlier versions of Guice did not support javax.inject, this example is limited to more recent Guice releases.

The scope of this extension is very narrow. It is not about using Guice to instantiate any Restlet types besides ServerResources, and it works entirely through the use of the Finder mechanism. I've had an exchange with Jerome about Restlet enhancements that would make the use of this extension more transparent, but there's nothing stopping you from using it now.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top