Re: [Javaflow] - Recalling a contianuation throws a NPE
Hi: Stephan Michels dijo: Uhmm, yes, you know that you CP the uri of an POST request? So in this case all request parameters get lost, and you got a NullPointerException. Yes it can look weird the idea of CP this URI, but in the real life we can find similar cases. Suppose I need to send the URI to someone to view the same as me. i.e.: Desk support. In this case they will not see the same as you. BTW, I was following the the discussion between Christopher Oliver and you. It is very interesting an remember us the need to know deep inside the used programming languages. :-D Are you trying to make Groovy continuations? I also want to see them work. I need here help in this. AFAIK, you are one of the people good know the Java continuation code. I am trying to make Groovy Flow Engine inside the JavaFlow Block. Because thy are too close and I think they can share the same continuation base. I already configured the Groovy calculator sample. Not sure if it will work, but it is just a initial draft. If you want, I can post the code to the CVS. I also copied the JavaInterpreted to GroovyInterpreted and changed some little things inside, nothing important, but work needed to be done too :-D I was reviewing the continuation code to identify the insertion point once the Groovy class was compiled and loaded in memory. My idea is to write additional method in ContinuationClassLoader to load the requiered Groovy class. Also there is meet another interesting issue. Under Dynamically loading and running Groovy code inside Java in: http://groovy.codehaus.org/embedding.html While loading Groovy class we also need to know that a Groovy class can be of both types defined. See in http://groovy.codehaus.org/classes.html 1-Classes - Classes are defined in Groovy similarly to Java. 2-Scripts - Groovy support plain scripts (as the Javascript case). Not sure how it will work under both, but I think we need to support both. Maybe I am breaking my head with this without a valid reason, but this is the price for not not know the internals of JavaFlow block. :-( Are you willing to give me a hand? :-D Best Regards, Antonio Gallardo
Re: [Javaflow] - Recalling a contianuation throws a NPE
I would highly suggest dropping in on #groovy on irc.codehaus.org for any assistance on the best way to plug it into Groovy, though I strongly suspect that a number of people there would jump on the chance to put continuations in the normal groovy distro -- and at least one of the people who regularly hangs out there has (sort of) implemented continuations in java (Geert Bevin). It is quite possible that adding continuation support directly into the GroovyClassLoader would be very acceptable to them, or at a minimum, removing any problems with setting the continuation class loader for JavaFlow as a the upstream class loader would be happily cleared by the people who know the language best =) -Brian On Apr 6, 2004, at 7:12 AM, Antonio Gallardo wrote: Hi: Stephan Michels dijo: Uhmm, yes, you know that you CP the uri of an POST request? So in this case all request parameters get lost, and you got a NullPointerException. Yes it can look weird the idea of CP this URI, but in the real life we can find similar cases. Suppose I need to send the URI to someone to view the same as me. i.e.: Desk support. In this case they will not see the same as you. BTW, I was following the the discussion between Christopher Oliver and you. It is very interesting an remember us the need to know deep inside the used programming languages. :-D Are you trying to make Groovy continuations? I also want to see them work. I need here help in this. AFAIK, you are one of the people good know the Java continuation code. I am trying to make Groovy Flow Engine inside the JavaFlow Block. Because thy are too close and I think they can share the same continuation base. I already configured the Groovy calculator sample. Not sure if it will work, but it is just a initial draft. If you want, I can post the code to the CVS. I also copied the JavaInterpreted to GroovyInterpreted and changed some little things inside, nothing important, but work needed to be done too :-D I was reviewing the continuation code to identify the insertion point once the Groovy class was compiled and loaded in memory. My idea is to write additional method in ContinuationClassLoader to load the requiered Groovy class. Also there is meet another interesting issue. Under Dynamically loading and running Groovy code inside Java in: http://groovy.codehaus.org/embedding.html While loading Groovy class we also need to know that a Groovy class can be of both types defined. See in http://groovy.codehaus.org/classes.html 1-Classes - Classes are defined in Groovy similarly to Java. 2-Scripts - Groovy support plain scripts (as the Javascript case). Not sure how it will work under both, but I think we need to support both. Maybe I am breaking my head with this without a valid reason, but this is the price for not not know the internals of JavaFlow block. :-( Are you willing to give me a hand? :-D Best Regards, Antonio Gallardo
Re: [Javaflow] - Recalling a contianuation throws a NPE
Am Di, den 06.04.2004 schrieb Antonio Gallardo um 13:12: Hi: Stephan Michels dijo: Uhmm, yes, you know that you CP the uri of an POST request? So in this case all request parameters get lost, and you got a NullPointerException. Yes it can look weird the idea of CP this URI, but in the real life we can find similar cases. Suppose I need to send the URI to someone to view the same as me. i.e.: Desk support. In this case they will not see the same as you. Hmm, yes, but this problem has nothing to do with the NPE. And the javascript flow has the same problem. The problem can be solve by sending a redirect to a new continuation id. And in this new continuation you store the execution after processing the request parameter of the previuos request. BTW, I was following the the discussion between Christopher Oliver and you. It is very interesting an remember us the need to know deep inside the used programming languages. :-D Yes, I learned a lot by writing the javaflow. Are you trying to make Groovy continuations? I also want to see them work. I need here help in this. AFAIK, you are one of the people good know the Java continuation code. No, I'm not writing Groovy continuations. I will not replace one script language by an other script language. The reason to write the javaflow was to use java instead of javascript. I am trying to make Groovy Flow Engine inside the JavaFlow Block. Because thy are too close and I think they can share the same continuation base. I already configured the Groovy calculator sample. Not sure if it will work, but it is just a initial draft. If you want, I can post the code to the CVS. Hmm, why not, but then you should add another directory like org/apache/cocoon/components/flow/groovy I also copied the JavaInterpreted to GroovyInterpreted and changed some little things inside, nothing important, but work needed to be done too :-D I was reviewing the continuation code to identify the insertion point once the Groovy class was compiled and loaded in memory. My idea is to write additional method in ContinuationClassLoader to load the requiered Groovy class. I try to assemble a different concept in my head. Something I call ClassLoaderPipelines. So, you can conect different ClassLoader for example: ReloadingClassLoader - CompilingClassLoader - GroovyClassLoader - ContinuationClassLoader To make this possible you must replace findResource() instead of loadClass(), because you can't uncompile classes, change them, define them. 1-Classes - Classes are defined in Groovy similarly to Java. 2-Scripts - Groovy support plain scripts (as the Javascript case). Not sure how it will work under both, but I think we need to support both. Maybe I am breaking my head with this without a valid reason, but this is the price for not not know the internals of JavaFlow block. :-( The instrumention of the classes by the ContinuationClassLoader should be interesting. The instrumented classes should also work without that any Continuation is registered for the current Thread. Are you willing to give me a hand? :-D Yes, will help you as much as I can. Stephan.