Hi Geert, At this time I'm not able to use the instrumentation agent due to some artifacts in Jadex which are not Java 1.5 compatible yet. But I will try to use the instrumentation agent for the testcases.
The UnsupportedOperationException is thrown from the pause() method and I agree that this is because the class isn't loaded from the continuation classloader at this time. My problem is, that I don't understand why - and why only after the loopback / callback. Simply call pause and later resume the continuation without a type of cycle in the method-callstack works fine. To make this clearer without going through my sample code here comes a (short) execution flow: "-" are steps in a class, "->" or "<-" indicates a switch into another class or a switch back to the caller "[...]" marks an explanation - create a runner -> start the continuable object via the runner <- the continuable object pause and execution resumes in the TestCase [pause works here] - create a NON-continuable object (POJO) - get the continuable object through the ContinuationContext with the provided continuation-ID - call a setter method on the continuable object and set the NON-continuable in the continuable -> resume the continuation via the runner - the continuable object checks if the NON-continuable isn't null - the continuable object calls a method on the NON-continuable [parameter "this" or empty] - the NON-continuable object test the parameter [when "this" was provided by the continuable object "this" is used, else the continuable is accessed through the ContinuationContext ] [CYCLE / LOOP-BACK] -> the NON-continuable object calls a method on the continuable object [different from execute, say test() for now] - continuable objects test() method try to pause() The last pause() call throws the UnsupportedOperationException, prior the cycle/loopback the pause() call works. I tested this for a long time and I found no way to get this cycle/loopback works at all. So my essential question is: Is it possible to implement such a callback / loopback / cycle with Rife-Continuations or is this a use case that isn't supported/desired (yet)? Hopeful, Claas Geert Bevin wrote: > Hi Claas, > > I haven't tried out your sample code yet, but it seems to me that the > bytecode manipulation isn't happening for that pause() method, thus > causing the UnsupportedOperationException to be thrown. This is most > probably due to the ContinuableObject class not being loaded by the > custom classloader. You'll have to verify that. > > If at all possible for you, it might be easier to drop the custom > classloader entirely and to use the Java 1.5 instrumentation agent. > More information about this here: > http://rifers.org/docs/api/com/uwyn/rife/continuations/instrument/ContinuationsAgent.html > > Hope this helps, > > Geert > > > On 08 Jul 2008, at 11:49, Claas Altschaffel wrote: > > >> Hello! >> I have a problem with the Rife-Continuations in combination with >> non-continuable objects. >> >> I try to use the continuations to replace thread pools in an open >> source >> multi agent system called Jadex. Continuations works so far, until i >> try to >> make a loopback call from a non-continuable object to a continuable >> object >> and then pause the continuation. >> >> This is the (slightly modified) callstack: >> TestClass.someMethod() [e.g. something like a executor or a test >> case] >> --> ContinuableRunner.start(ContinuableObject) >> --> ContinuableObject.execute() >> [pause continuation, set non-continuable object and resume >> continuation] >> --> NonContinuableObject.someMethod() >> --> TestClass.loopbackTest() >> -->ContinuableObject.pauseContinuationMethod() >> --> pause() [called in the pauseContinuation] >> >> After the loopback-method, the pause() call in the ContinuableObject >> throws >> an UnsupportedOperationException. >> >> Also a simplified callstack doesn't work: >> TestClass.someMethod() >> --> ContinuableRunner.start(ContinuableObject) >> --> ContinuableObject.execute() >> [pause continuation, set non-continuable object and resume >> continuation] >> --> NonContinuableObject.someMethod() >> --> ContinuableObject.loopbackTest() >> --> pause() [called in the loopbackTest() method] >> >> The second example only loops from the continuable object to the >> non-continuable object,but the pause method throws the same exception. >> >> In the attachement are two testcases and the needed classes. Hope >> this makes >> my problem a little bit clearer. The testcases should work with the >> rife svn >> tree. >> >> Is it possible to implement such callstack with Rife-Continuations? >> And if >> yes, can anybody tell me what i make wrong? >> >> Testcases: >> http://www.nabble.com/file/p18335150/testcases.tar.gz testcases.tar.gz >> -- View this message in context: >> http://www.nabble.com/Continuable-callstack-outside-a-ContinuableObject--tp18335150s9330p18335150.html >> Sent from the RIFE - users mailing list archive at Nabble.com. >> >> >> > > -- > Geert Bevin > Terracotta - http://www.terracotta.org > Uwyn "Use what you need" - http://uwyn.com > RIFE Java application framework - http://rifers.org > Music and words - http://gbevin.com > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "rife-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rife-users?hl=en -~----------~----~----~----~------~----~------~--~---
