Re: Java Action events/asychronous notification

"Thomas Johansson" <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.tini
Message-ID <005f01c3db2f$24c5bb30$25d6d9d4@thddco>
Hi,

you could look into the Observer/Observable class/interface, they are used for just this purpose. An Observer registeres itself at an Observable, and when things change in the Observable, all Observers get notified.

What a 'change' is is of course up to you. This method is very similar to the listener approach used in the AWT and Swing graphics packages.

If you would like an example (I use this method a lot), please contact me off-list and I will send you some code.

Best Regards,
Thomas Johansson

----- Original Message ----- 
From: "Nathan Gustavson" <[email protected]>
To: "Tini (E-mail)" <tini-6tN4nzCoH/[email protected]>
Sent: Wednesday, January 14, 2004 8:01 PM
Subject: [TINI]Java Action events/asychronous notification


> Hello,
> I'm a C/C++ embedded developer who has been forcefully thrown into the world
> of Java with the advent of this Tini processor. I'm looking for advice on
> implementing asychronous methods for our Tini carrier board.
> I've been trying to write some simple drivers for the IO on our board for
> the last couple days and have been having a lot of trouble implementing and
> asychronous interface for our keypad.
> I've got the Interrupts running with ExternalInterrupt and am receiving the
> keys no problem, but can't seem to discover a good end API for the users for
> this.
> 
> In C I would just create a function pointer to a callback and call it when
> the key is pressed.
> 
> After 2 days research and hair pulling I have discoved that Java does not do
> this, I've been Googling and going through the html documentation, but all I
> have discovered is how to set up and action to occur when a pre-defined
> event(such as mouse movement) occurs. I have been unable to find any
> reference to how to actually set up the API to call a function. That is, how
> to implement an addtask type method for my own IO devices.
> 
> If anyone out there has any example code or knows any good tutorials it
> would be appreciated.
> Help!
> 
> 
> 
> 
> Thank you,
> 
> Nathan Z. Gustavson
> Embedded Engineer
> EMAC, Inc.
> 2390 EMAC Way
> Carbondale, IL 62902
> Phone (618) 529-4525 ext 320
> Fax (618) 457-0110
> Website: http://www.emacinc.com
> 
> 
> _______________________________________________
> TINI mailing list
> TINI-6tN4nzCoH/[email protected]
> To UNSUBSCRIBE, edit your profile, or see list archives:
> http://lists.dalsemi.com/mailman/listinfo/tini
> 


_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.