Sometimes I end up doing just that, but unless SomeResource.class is only handling a trivial set of cases, eventually SomeResource.class starts re-creating all the intelligence of Router and Route, which is not very efficient.
Following the ideas in this post, we're writing up a little something that allows Restlet 2.0 routes to be plugged via an OSGi service. Currently our OSGi-based GoGoEgo container allows something like this for mounting entire Applications, so this just takes it down to a more fine grained level. Should be available for playing with as soon as people get back from the holidays. - Rob On Sun, Dec 27, 2009 at 12:36 PM, Sopasakis Pantelis <ch...@mail.ntua.gr>wrote: > I'm not sure I understood the problem, but a reasonable solution would > be the following line: > > router.attach("/{identifier}", SomeResource.class); > > then inside your resource class you can handle these identifiers. > > On Mon, 2009-12-28 at 11:49 +0100, Jerome Louvel wrote: > > FYI, I’ve added a reference to Brian’s post on this page: > > > > > > > > “OSGi integration” > > > > http://wiki.restlet.org/developers/172-restlet/124-restlet.html > > > > > > > > Best regards, > > Jerome Louvel > > -- > > Restlet ~ Founder and Lead developer ~ http://www.restlet.org > > Noelios Technologies ~ Co-founder ~ http://www.noelios.com > > > > > > > > > > > > > > > > > > De :xavier.meh...@gmail.com [mailto:xavier.meh...@gmail.com] De la > > part de Xavier Méhaut > > Envoyé : lundi 7 décembre 2009 09:12 > > À : discuss@restlet.tigris.org > > Objet : Re: adding new router attachements dynamically? > > > > > > > > > > I'm eager to read you soon. > > regards > > Xavier > > > > 2009/12/7 Bryan Hunt <bh...@mac.com> > > > > Yes, there is a way to do this, but I can't go into the details. I > > know that's not the answer you were looking for. A colleague and I > > are working on a solution that allows you to register a representation > > as an Eclipse extension or through an OSGi service. The mechanism > > will be dynamic and fully support the hot-plug nature of OSGi. If you > > are interested in the details on my first (failed) attempt at this, > > please see my blog post (it also explains why I can't directly answer > > your question): > > > > > http://bryanhunt.wordpress.com/2009/11/23/updating-ensemble-for-restlet-2-0-license-beware/ > > > > Once we have a working solution, I'll post another blog entry. > > > > Bryan > > > > > > On Dec 6, 2009, at 2:41 PM, Xavier Méhaut wrote: > > > > > Hello, > > > In a certain manner related to osgi, is there a means in Restlets to > > add dynamically new attachements to ane exiting router, ie add new URL > > to be taken into account without having either to recopile the code, > > or (better) without having to restart the process? > > > > > > for instance, we had first : > > > myrouter.attach("/toto",...); > > > myrouter.attach("/toto",...); > > > > > > and I would like to add : > > > myrouter.attach("rere",...) > > > > > > regards > > > Xavier > > > > > > ------------------------------------------------------ > > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2427706 > > > > > > > > > > > > ------------------------------------------------------ > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2433414 > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2433467