Brendan,

The Finder class is a kind of factory mostly used (in the Restlet 
framework) for instantiating "resources" (I mean instance of Handler 
such as Resource, or ServerResource). The global scheme is that such 
Restlet is able to delegate a call to a new instance "resource".
Restlet and "resources" differ by the fact that a Restlet is a kind of a 
singleton and handle each incoming call, whereas a "resource" is 
designed to handle a single request/response.

You can have a look of the code of the Router class. It simply uses the 
Finder#createFinder method.

Best regards,
Thierry Boileau

> Thanks Thierry,
>
> That seems fine, one LAST question, can you send some sample code that  
> demonstrates the usage
> of the "Finder" Restlet?  How to use this seems unclear to me.
>
> Thanks again,
> Brendan...
>
> On 24 Jun 2009, at 13:44, Thierry Boileau wrote:
>
>   
>> Hi,
>>
>> well, instances of the Application class, are rather designed to be
>> independent. Hosted by a Component, the primary goal was to keep them
>> unaware of the other applications hosted by the component. However,  
>> that
>> does not mean one cannot communicate with another one. I think of the
>> HTTP, for example, or RIAP protocols.
>> Therefore, unless your need is very special, there should be no need  
>> to
>> attach an application to another one via a router. But two  
>> applications
>> can share code, resources, of course and manage they own URI space.
>> I hope I've answered your question.
>>
>> Best regards,
>> Thierry Boileau
>>
>>
>>     
>>> Thanks Thierry,
>>>
>>> Can you route between  "Applications" within a component or is  
>>> routing
>>> restricted to within a single "Application" as you have showed in
>>> your sample code.
>>>
>>> Thanks again for all your help,
>>> Regards,
>>> Brendan...
>>>
>>> On 24 Jun 2009, at 11:40, Thierry Boileau wrote:
>>>
>>>
>>>       
>>>> Hello Brendan,
>>>>
>>>> Filter instances can pre and post process request/response via the
>>>> "beforeHandle" and "afterHandle" methods, thus it gives you a  
>>>> complete
>>>> control.
>>>> Having said that, the "beforeHandle" method is a more a place  
>>>> where to
>>>> enrich the context of the incoming request, or even update the
>>>> request,
>>>> whereas the "afterHandle" is the place where to update the response
>>>> generated by the end point (generally a resource). It let the end-
>>>> point
>>>> generates a response according to the current request and its  
>>>> context,
>>>> not from a prepared response which seems odd (from my point of  
>>>> view).
>>>> But you're totally free, of course.
>>>>
>>>> best regards,
>>>> Thierry Boileau
>>>>
>>>>
>>>>         
>>>>> Thanks Thierry,
>>>>>
>>>>> Thats exactly what I was looking for, can I partially build the
>>>>> response as it passes from one restlet to the next, or does the
>>>>> final restlets response overwrite the proceeding ones?
>>>>>
>>>>> Regards,
>>>>> Brendan...
>>>>>
>>>>> ------------------------------------------------------
>>>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2364860
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> ------------------------------------------------------
>>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2364868
>>>>
>>>>         
>>> ------------------------------------------------------
>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2364891
>>>
>>>
>>>       
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2364913
>>     
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2364943
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2364946

Reply via email to