You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Márcio Faria <fa...@ymail.com> on 2009/09/02 01:05:08 UTC

[Javaflow] Access to the resumed target of a Continuation

Dear Javaflow's crew,

What is the recommended way to access the Runnable 'target' from a Continuation after calling 'Continuation.continueWith(....)' ? Suppose that Continuation was loaded from a file, so I don't have the reference to the original 'target' Object.

Under these conditions, do we have to resort to a 'pContext' object, which would then be set by the resumed Runnable 'target' itself? 

Do you anticipate any problem with the above approach? Is there a better way to get a reference to the resumed Runnable?

Thanks in advance,

Marcio




      __________________________________________________________________
Get a sneak peak at messages with a handy reading pane with All new Yahoo! Mail: http://ca..promos.yahoo.com/newmail/overview2/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Javaflow] Access to the resumed target of a Continuation

Posted by Torsten Curdt <tc...@apache.org>.
> What is the recommended way to access the Runnable 'target' from a Continuation after calling 'Continuation.continueWith(....)' ? Suppose that Continuation was loaded from a file, so I don't have the reference to the original 'target' Object.

Your Runnable then needs to be Serializable and should get serialized
to disk with the continuation.
(see Stack.java)

> Under these conditions, do we have to resort to a 'pContext' object, which would then be set by the resumed Runnable 'target' itself?
>
> Do you anticipate any problem with the above approach? Is there a better way to get a reference to the resumed Runnable?

Have a look at this TestCase.

http://svn.apache.org/viewvc/commons/sandbox/javaflow/trunk/src/test/java/org/apache/commons/javaflow/suite/SerializationTestCase.java?revision=733503

Nothing you should have to worry about.

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org