Thread

Awjni-0.3.zip (1/1) (Sdk)

Awjni-0.3.zip (1/1) // Sdk

1  |  

gepr

Nov 3, 1998, 10:18pm
Hey guys,
In trying to use the AWJNI, I've come across what seems to me a limitation
in the way events are handled in the SDK. I'm not as familiar with event
handling as I should be, though, so correct me if I'm misguided.

Using the C API for the SDK, one designates a handler for an event with
aw_event_set(AW_EVENT_CHAT, foobar);
where
void foobar();

But, using the JNI, I can't actually tell the aw_event_set method in the dll
the handle to use for the procedure to call. I can only give it the jobject
from which it can get the pointer.

So, if I could edit the code that goes into the aw.dll, then I'd be all
set. But, since I can't, I have to find some way to specify to the dll
a constant pointer to call when the event happens and that pointer
referent must make the call into the Java method. Anybody have any
design thoughts on where and how I should do that?

Roland, is there anything I'm leaving out or have
screwed up? If not, is there a convenient way we could put hooks
in for this?

glen
--
glen e. p. ropella =><= Hail Eris!
the swarm corporation W:(505) 995-0818
<gepr at swarm.com> H:(505) 424-0448

roland vilett

Nov 4, 1998, 6:58pm
>Roland, is there anything I'm leaving out or have
>screwed up? If not, is there a convenient way we could put hooks
>in for this?


I'm not sure - you're asking specifically about the JNI, correct? The JNI
was not developed by COF and I have yet to try it out myself. The author of
the JNI posts here regularly, hopefully he will be able to answer your
question.

-Roland

edward sumerfield

Nov 4, 1998, 7:30pm
In fact you are looking for DrChandra (Andrew Esh I believe?).

Edward Sumerfield.

[View Quote] >
> I'm not sure - you're asking specifically about the JNI, correct? The JNI
> was not developed by COF and I have yet to try it out myself. The author of
> the JNI posts here regularly, hopefully he will be able to answer your
> question.
>
> -Roland

drchandra

Nov 5, 1998, 10:18pm
As I understand it, you are able to designate an object to pass to the C
code portion of the JNI call. The C code must make JNI specific calls to
call one of the methods of that object. My expectation is that we will have
to agree on a name or some other agreed upon designator for that method.
Then the callback catcher on the C side can be written to grab the object
being referred to in the callback, and call the designated method, always.

Since I did not write most of the code for this version of the AWJNI, I have
not yet looked at how the callbacks are implemented. What this all means is
that it is possible, but probably not yet implemented.

Time is kind of hard to come by, lately. Maybe I can give a bteer answer
tomorrow, or over the weekend. I still have to convert it to Build 7, too.

DrChandra/PK-37

--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page


[View Quote]

edward sumerfield

Nov 6, 1998, 10:09am
I am not sure if I understand the context here but may I suggest that you add a
layer on top of the callback to do the static to object routing.

From a java perspective you want a CallbackIF that any class can implement to
prove that it has the callback method in it.

You can then hide an array of CallbackIF objects with their respective instances
and when a callback occurs you look up the object based on the isntance and call
the appropriate method.

This is how I did it in AWCPP.

Edward Sumerfield.

[View Quote] > As I understand it, you are able to designate an object to pass to the C
> code portion of the JNI call. The C code must make JNI specific calls to
> call one of the methods of that object. My expectation is that we will have
> to agree on a name or some other agreed upon designator for that method.
> Then the callback catcher on the C side can be written to grab the object
> being referred to in the callback, and call the designated method, always.
>
> Since I did not write most of the code for this version of the AWJNI, I have
> not yet looked at how the callbacks are implemented. What this all means is
> that it is possible, but probably not yet implemented.
>
> Time is kind of hard to come by, lately. Maybe I can give a bteer answer
> tomorrow, or over the weekend. I still have to convert it to Build 7, too.
>
> DrChandra/PK-37
>
> --
> Andrew C. Esh mailto:andrew_esh at cnt.com
> http://www.mtn.org/~andrewes - ACE Home Page
>
[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn