Continuations

View: New views
8 Messages — Rating Filter:   Alert me  

Continuations

by Patrick Lightbody-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Geert,
I'm trying to extract continuations. So far I pulled out the entire  
set of dependencies starting from EngineClassLoader. But I am sure  
I'm not quite there yet, since:

1) I have no idea how to actually hook this in :)
2) Many of the continuation classes were not part of my initial  
extraction.

Any tips for my next step?

Patrick



Parent Message unknown Re: Continuations

by Geert Bevin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Patrick,

 > 1) I have no idea how to actually hook this in :)

You should look at the service method in  
com.uwyn.rife.engine.RequestState and the processContext method in  
com.uwyn.rife.engine.ElementContext. Both these methods set up the  
required context for continuations depending on which situation the  
engine is in. The continuation feature itself (ie. restoring and  
jumping to the program counter) is handled automatically by the byte-
code modified classes as long as the correct ContinuationContext is  
registered in com.uwyn.rife.engine.ContinuationContext.

 > 2) Many of the continuation classes were not part of my initial  
extraction.

What do you mean with that?

Best regards,

Geert

--
Geert Bevin                       Uwyn bvba
"Use what you need"               Avenue de Scailmont 34
http://www.uwyn.com               7170 Manage, Belgium
gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net




Re: Re: Continuations

by Patrick Lightbody-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hmm, still not making much progress. I get this feeling that it isn't  
as easy to pull out as you made it sounds (there are lots of  
references to ElementSupport, Element, etc, which look RIFE-specific).

I want to do something real simple that demonstrates the  
continuations from a command line program. Something like:

main {
EngineClassLoader cl = ...;
Class c = cl.loadClass("com.acme.Foo");
Object o = c.newInstance()
Method m = c.getMethod("foo");
m.invoke(o);
}

Where Foo's foo() method simply does:

print "hi";
pause();
print "hey";

Can you help me put just the basics together like this?

On Sep 19, 2005, at 1:51 PM, Geert Bevin wrote:

> Hi Patrick,
>
> > 1) I have no idea how to actually hook this in :)
>
> You should look at the service method in  
> com.uwyn.rife.engine.RequestState and the processContext method in  
> com.uwyn.rife.engine.ElementContext. Both these methods set up the  
> required context for continuations depending on which situation the  
> engine is in. The continuation feature itself (ie. restoring and  
> jumping to the program counter) is handled automatically by the  
> byte-code modified classes as long as the correct  
> ContinuationContext is registered in  
> com.uwyn.rife.engine.ContinuationContext.
>
> > 2) Many of the continuation classes were not part of my initial  
> extraction.
>
> What do you mean with that?
>
> Best regards,
>
> Geert
>
> --
> Geert Bevin                       Uwyn bvba
> "Use what you need"               Avenue de Scailmont 34
> http://www.uwyn.com               7170 Manage, Belgium
> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>
> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>
>
> _______________________________________________
> Rife-devel mailing list
> Rife-devel@...
> http://www.uwyn.com/mailman/listinfo/rife-devel
>



Re: Re: Continuations

by Geert Bevin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

These references are only by name not on the functionalities, you can  
change the names.

I can't do much more to help now since I'm racing against time to get  
everything ready for Java In Action and EuroOSCON. In a couple of  
weeks I could put some efforts into this, sorry. :-/

On 21-sep-05, at 10:05, Patrick Lightbody wrote:

> Hmm, still not making much progress. I get this feeling that it  
> isn't as easy to pull out as you made it sounds (there are lots of  
> references to ElementSupport, Element, etc, which look RIFE-specific).
>
> I want to do something real simple that demonstrates the  
> continuations from a command line program. Something like:
>
> main {
> EngineClassLoader cl = ...;
> Class c = cl.loadClass("com.acme.Foo");
> Object o = c.newInstance()
> Method m = c.getMethod("foo");
> m.invoke(o);
> }
>
> Where Foo's foo() method simply does:
>
> print "hi";
> pause();
> print "hey";
>
> Can you help me put just the basics together like this?
>
> On Sep 19, 2005, at 1:51 PM, Geert Bevin wrote:
>
>
>> Hi Patrick,
>>
>> > 1) I have no idea how to actually hook this in :)
>>
>> You should look at the service method in  
>> com.uwyn.rife.engine.RequestState and the processContext method in  
>> com.uwyn.rife.engine.ElementContext. Both these methods set up the  
>> required context for continuations depending on which situation  
>> the engine is in. The continuation feature itself (ie. restoring  
>> and jumping to the program counter) is handled automatically by  
>> the byte-code modified classes as long as the correct  
>> ContinuationContext is registered in  
>> com.uwyn.rife.engine.ContinuationContext.
>>
>> > 2) Many of the continuation classes were not part of my initial  
>> extraction.
>>
>> What do you mean with that?
>>
>> Best regards,
>>
>> Geert
>>
>> --
>> Geert Bevin                       Uwyn bvba
>> "Use what you need"               Avenue de Scailmont 34
>> http://www.uwyn.com               7170 Manage, Belgium
>> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>>
>> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
>> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>>
>>
>> _______________________________________________
>> Rife-devel mailing list
>> Rife-devel@...
>> http://www.uwyn.com/mailman/listinfo/rife-devel
>>
>>
>
> _______________________________________________
> Rife-devel mailing list
> Rife-devel@...
> http://www.uwyn.com/mailman/listinfo/rife-devel
>
>

--
Geert Bevin                       Uwyn bvba
"Use what you need"               Avenue de Scailmont 34
http://www.uwyn.com               7170 Manage, Belgium
gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net




Re: Re: Continuations

by Patrick Lightbody-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you at least let me know if I'm on the right track? Should psuedo
code, for example, be only printing out the first statement? Right now
it prints out both elements, as if pause() was doing nothing. Is there
a way to know for sure that my class is being instrumented properly?

On 9/21/05, Geert Bevin <gbevin@...> wrote:

> These references are only by name not on the functionalities, you can
> change the names.
>
> I can't do much more to help now since I'm racing against time to get
> everything ready for Java In Action and EuroOSCON. In a couple of
> weeks I could put some efforts into this, sorry. :-/
>
> On 21-sep-05, at 10:05, Patrick Lightbody wrote:
>
> > Hmm, still not making much progress. I get this feeling that it
> > isn't as easy to pull out as you made it sounds (there are lots of
> > references to ElementSupport, Element, etc, which look RIFE-specific).
> >
> > I want to do something real simple that demonstrates the
> > continuations from a command line program. Something like:
> >
> > main {
> > EngineClassLoader cl = ...;
> > Class c = cl.loadClass("com.acme.Foo");
> > Object o = c.newInstance()
> > Method m = c.getMethod("foo");
> > m.invoke(o);
> > }
> >
> > Where Foo's foo() method simply does:
> >
> > print "hi";
> > pause();
> > print "hey";
> >
> > Can you help me put just the basics together like this?
> >
> > On Sep 19, 2005, at 1:51 PM, Geert Bevin wrote:
> >
> >
> >> Hi Patrick,
> >>
> >> > 1) I have no idea how to actually hook this in :)
> >>
> >> You should look at the service method in
> >> com.uwyn.rife.engine.RequestState and the processContext method in
> >> com.uwyn.rife.engine.ElementContext. Both these methods set up the
> >> required context for continuations depending on which situation
> >> the engine is in. The continuation feature itself (ie. restoring
> >> and jumping to the program counter) is handled automatically by
> >> the byte-code modified classes as long as the correct
> >> ContinuationContext is registered in
> >> com.uwyn.rife.engine.ContinuationContext.
> >>
> >> > 2) Many of the continuation classes were not part of my initial
> >> extraction.
> >>
> >> What do you mean with that?
> >>
> >> Best regards,
> >>
> >> Geert
> >>
> >> --
> >> Geert Bevin                       Uwyn bvba
> >> "Use what you need"               Avenue de Scailmont 34
> >> http://www.uwyn.com               7170 Manage, Belgium
> >> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
> >>
> >> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
> >> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
> >>
> >>
> >> _______________________________________________
> >> Rife-devel mailing list
> >> Rife-devel@...
> >> http://www.uwyn.com/mailman/listinfo/rife-devel
> >>
> >>
> >
> > _______________________________________________
> > Rife-devel mailing list
> > Rife-devel@...
> > http://www.uwyn.com/mailman/listinfo/rife-devel
> >
> >
>
> --
> Geert Bevin                       Uwyn bvba
> "Use what you need"               Avenue de Scailmont 34
> http://www.uwyn.com               7170 Manage, Belgium
> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>
> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>
>
> _______________________________________________
> Rife-devel mailing list
> Rife-devel@...
> http://www.uwyn.com/mailman/listinfo/rife-devel
>


Re: Re: Continuations

by Geert Bevin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alternatively you can take a look at the conversation that started  
here with nall:
http://servlet.uwyn.com/drone/log/bevinbot/rife/20040225

He's the guy that extracted it before, I explained quite some things  
on IRC which might help you.

On 21-sep-05, at 10:11, Geert Bevin wrote:

> These references are only by name not on the functionalities, you  
> can change the names.
>
> I can't do much more to help now since I'm racing against time to  
> get everything ready for Java In Action and EuroOSCON. In a couple  
> of weeks I could put some efforts into this, sorry. :-/
>
> On 21-sep-05, at 10:05, Patrick Lightbody wrote:
>
>
>> Hmm, still not making much progress. I get this feeling that it  
>> isn't as easy to pull out as you made it sounds (there are lots of  
>> references to ElementSupport, Element, etc, which look RIFE-
>> specific).
>>
>> I want to do something real simple that demonstrates the  
>> continuations from a command line program. Something like:
>>
>> main {
>> EngineClassLoader cl = ...;
>> Class c = cl.loadClass("com.acme.Foo");
>> Object o = c.newInstance()
>> Method m = c.getMethod("foo");
>> m.invoke(o);
>> }
>>
>> Where Foo's foo() method simply does:
>>
>> print "hi";
>> pause();
>> print "hey";
>>
>> Can you help me put just the basics together like this?
>>
>> On Sep 19, 2005, at 1:51 PM, Geert Bevin wrote:
>>
>>
>>
>>> Hi Patrick,
>>>
>>> > 1) I have no idea how to actually hook this in :)
>>>
>>> You should look at the service method in  
>>> com.uwyn.rife.engine.RequestState and the processContext method  
>>> in com.uwyn.rife.engine.ElementContext. Both these methods set up  
>>> the required context for continuations depending on which  
>>> situation the engine is in. The continuation feature itself (ie.  
>>> restoring and jumping to the program counter) is handled  
>>> automatically by the byte-code modified classes as long as the  
>>> correct ContinuationContext is registered in  
>>> com.uwyn.rife.engine.ContinuationContext.
>>>
>>> > 2) Many of the continuation classes were not part of my initial  
>>> extraction.
>>>
>>> What do you mean with that?
>>>
>>> Best regards,
>>>
>>> Geert
>>>
>>> --
>>> Geert Bevin                       Uwyn bvba
>>> "Use what you need"               Avenue de Scailmont 34
>>> http://www.uwyn.com               7170 Manage, Belgium
>>> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>>>
>>> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
>>> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>>>
>>>
>>> _______________________________________________
>>> Rife-devel mailing list
>>> Rife-devel@...
>>> http://www.uwyn.com/mailman/listinfo/rife-devel
>>>
>>>
>>>
>>
>> _______________________________________________
>> Rife-devel mailing list
>> Rife-devel@...
>> http://www.uwyn.com/mailman/listinfo/rife-devel
>>
>>
>>
>
> --
> Geert Bevin                       Uwyn bvba
> "Use what you need"               Avenue de Scailmont 34
> http://www.uwyn.com               7170 Manage, Belgium
> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>
> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>
>
> _______________________________________________
> Rife-devel mailing list
> Rife-devel@...
> http://www.uwyn.com/mailman/listinfo/rife-devel
>
>

--
Geert Bevin                       Uwyn bvba
"Use what you need"               Avenue de Scailmont 34
http://www.uwyn.com               7170 Manage, Belgium
gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net




Re: Re: Continuations

by Geert Bevin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, I meant
http://servlet.uwyn.com/drone/log/bevinbot/rife/20040224

On 21-sep-05, at 10:16, Geert Bevin wrote:

> Alternatively you can take a look at the conversation that started  
> here with nall:
> http://servlet.uwyn.com/drone/log/bevinbot/rife/20040225
>
> He's the guy that extracted it before, I explained quite some  
> things on IRC which might help you.
>
> On 21-sep-05, at 10:11, Geert Bevin wrote:
>
>
>> These references are only by name not on the functionalities, you  
>> can change the names.
>>
>> I can't do much more to help now since I'm racing against time to  
>> get everything ready for Java In Action and EuroOSCON. In a couple  
>> of weeks I could put some efforts into this, sorry. :-/
>>
>> On 21-sep-05, at 10:05, Patrick Lightbody wrote:
>>
>>
>>
>>> Hmm, still not making much progress. I get this feeling that it  
>>> isn't as easy to pull out as you made it sounds (there are lots  
>>> of references to ElementSupport, Element, etc, which look RIFE-
>>> specific).
>>>
>>> I want to do something real simple that demonstrates the  
>>> continuations from a command line program. Something like:
>>>
>>> main {
>>> EngineClassLoader cl = ...;
>>> Class c = cl.loadClass("com.acme.Foo");
>>> Object o = c.newInstance()
>>> Method m = c.getMethod("foo");
>>> m.invoke(o);
>>> }
>>>
>>> Where Foo's foo() method simply does:
>>>
>>> print "hi";
>>> pause();
>>> print "hey";
>>>
>>> Can you help me put just the basics together like this?
>>>
>>> On Sep 19, 2005, at 1:51 PM, Geert Bevin wrote:
>>>
>>>
>>>
>>>
>>>> Hi Patrick,
>>>>
>>>> > 1) I have no idea how to actually hook this in :)
>>>>
>>>> You should look at the service method in  
>>>> com.uwyn.rife.engine.RequestState and the processContext method  
>>>> in com.uwyn.rife.engine.ElementContext. Both these methods set  
>>>> up the required context for continuations depending on which  
>>>> situation the engine is in. The continuation feature itself (ie.  
>>>> restoring and jumping to the program counter) is handled  
>>>> automatically by the byte-code modified classes as long as the  
>>>> correct ContinuationContext is registered in  
>>>> com.uwyn.rife.engine.ContinuationContext.
>>>>
>>>> > 2) Many of the continuation classes were not part of my  
>>>> initial extraction.
>>>>
>>>> What do you mean with that?
>>>>
>>>> Best regards,
>>>>
>>>> Geert
>>>>
>>>> --
>>>> Geert Bevin                       Uwyn bvba
>>>> "Use what you need"               Avenue de Scailmont 34
>>>> http://www.uwyn.com               7170 Manage, Belgium
>>>> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>>>>
>>>> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F  
>>>> D6A9
>>>> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>>>>
>>>>
>>>> _______________________________________________
>>>> Rife-devel mailing list
>>>> Rife-devel@...
>>>> http://www.uwyn.com/mailman/listinfo/rife-devel
>>>>
>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Rife-devel mailing list
>>> Rife-devel@...
>>> http://www.uwyn.com/mailman/listinfo/rife-devel
>>>
>>>
>>>
>>>
>>
>> --
>> Geert Bevin                       Uwyn bvba
>> "Use what you need"               Avenue de Scailmont 34
>> http://www.uwyn.com               7170 Manage, Belgium
>> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>>
>> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
>> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>>
>>
>> _______________________________________________
>> Rife-devel mailing list
>> Rife-devel@...
>> http://www.uwyn.com/mailman/listinfo/rife-devel
>>
>>
>>
>
> --
> Geert Bevin                       Uwyn bvba
> "Use what you need"               Avenue de Scailmont 34
> http://www.uwyn.com               7170 Manage, Belgium
> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>
> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>
>
> _______________________________________________
> Rife-devel mailing list
> Rife-devel@...
> http://www.uwyn.com/mailman/listinfo/rife-devel
>
>

--
Geert Bevin                       Uwyn bvba
"Use what you need"               Avenue de Scailmont 34
http://www.uwyn.com               7170 Manage, Belgium
gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net




Re: Re: Continuations

by Geert Bevin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 21-sep-05, at 10:14, Patrick Lightbody wrote:

> Can you at least let me know if I'm on the right track? Should psuedo
> code, for example, be only printing out the first statement? Right now
> it prints out both elements, as if pause() was doing nothing. Is there
> a way to know for sure that my class is being instrumented properly?

Modifying the static fields in ContinuationDebug gives you  
information about the instrumentation process.

The code below will only work if you set the correct  
ContinuationContext for the active thread. That's what's being used  
to resume execution.

> On 9/21/05, Geert Bevin <gbevin@...> wrote:
>
>> These references are only by name not on the functionalities, you can
>> change the names.
>>
>> I can't do much more to help now since I'm racing against time to get
>> everything ready for Java In Action and EuroOSCON. In a couple of
>> weeks I could put some efforts into this, sorry. :-/
>>
>> On 21-sep-05, at 10:05, Patrick Lightbody wrote:
>>
>>
>>> Hmm, still not making much progress. I get this feeling that it
>>> isn't as easy to pull out as you made it sounds (there are lots of
>>> references to ElementSupport, Element, etc, which look RIFE-
>>> specific).
>>>
>>> I want to do something real simple that demonstrates the
>>> continuations from a command line program. Something like:
>>>
>>> main {
>>> EngineClassLoader cl = ...;
>>> Class c = cl.loadClass("com.acme.Foo");
>>> Object o = c.newInstance()
>>> Method m = c.getMethod("foo");
>>> m.invoke(o);
>>> }
>>>
>>> Where Foo's foo() method simply does:
>>>
>>> print "hi";
>>> pause();
>>> print "hey";
>>>
>>> Can you help me put just the basics together like this?

--
Geert Bevin                       Uwyn bvba
"Use what you need"               Avenue de Scailmont 34
http://www.uwyn.com               7170 Manage, Belgium
gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net



 
 
 
Google
rifers.org web