[Embedlets-dev] Re: JAPL part of specification
Status: Alpha
Brought to you by:
tkosan
|
From: Ted K. <tk...@ya...> - 2003-03-28 17:24:31
|
Brill,
>Is there a list of Type ID's? Or can I use a JAPL event/action id instead?
Can you give a bit more information about the idea behind these Type IDs?
>So, I need to know if the event I've received is a polarity, direction
>or value event. Also, how would the port be read? I can receive an
>event telling the port to change its value, but how would the remote
>app request the value from the embedlet? (it looks to me as If I would
>have to receive a "get value" event, then generate my own event listing
>the value.
The architecture document shows Embedlets having direct references to JAPL
peripherals so sending or obtaining information from a JAPL peripheral should
be done by just calling some methods on it. I think that giving JAPL
peripherals the ability to receive events seems like it would become messy
fairly quickly because then the JAPL peripheral would need to accommodate a
wide number of client event schemes.
Having the JAPL clients conform to standard JAPL mechanisms is different,
however, because then the JAPL peripheral represents a single standard that all
clients must adhere to. For example, in order to receive asynchronous
information back from a JAPL peripheral I am currently leaning towards using a
simple callback by having the Embedlet (or any other JAPL client) implement the
following interface:
package org.japl;
public interface JaplEventListener
{
void receiveJaplEvent(Object japlEvent);
}//end method
This uses the standard 'message out, notify in' pattern and so far it has
worked well in the Robocode experiments I have been doing.
This is definitely an area that will need to be discussed and nailed down
before we can proceed much further though...
Ted
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
|