javaguicerestletpersistentguice-persist

Restlet implementation with Guice


Java development took a huge step forward with the introduction of Guice. My projects heavily depend on Warp-persist and its successor GuicePersist for persistency.

But there seems to be a mismatch between the use of Guice and Restlet. It looks like its only possible to @Inject session and persistence factories from the servlet level. For transaction handling i need Guice to create Restlet ServerResources which enable me to @Inject persistence stuff like @Transactional or UnitOfWork.

Regards,

Roland Beuker


Solution

  • Stackoverflow Related already pointed me to the blog "Restlet Guice extension considered ... unnecessary"

    And indeed there's already a Guice extension for Restlet; Restlet Extensions => Guice