I should say that my caveat is irrelevant if you aren't using the
asynchronous connector.

--tim

On Fri, Jun 17, 2011 at 10:47 AM, Tim Peierls <[email protected]> wrote:

> The only caveat I can think of is when setting a callback. For example, you
> can call getResponse().setOnSent(callbackHandler) from within a
> ServerResource handler method, but callbackHandler.handle() could be called
> in a thread other than the one in which you call setOnSent, so you want to
> make sure that callbackHandler does not refer to fields of the
> ServerResource handling the current request. (Or if it must, make sure that
> you have proper synchronization.)
>
> --tim
>
>
> On Fri, Jun 17, 2011 at 9:26 AM, gonzajg <[email protected]> wrote:
>
>> Chris,
>> You can safely use instance variables. A new instance is created by
>> request.
>> You should be careful with class (static) variables only.
>>
>> --
>> View this message in context:
>> http://restlet-discuss.1400322.n2.nabble.com/Instance-variables-in-ServerResource-tp6484113p6487099.html
>> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2768454
>>
>
>

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

Reply via email to