Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Event Generation

 
Nidheesh Puthalath
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to generate custom events in J2ME.
I need to generate some events based upon some n/w activity(eg. a byte arrives in serial port).

thanks in advance

Nidheesh
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Um, I don't think you need to make custom events for Network activity. There are Timers, Registering Sockets to the phone to activate a Servlet when a "message" comes in. And having Connections be open listening for incoming traffic.

So what would you specifically want to have a custom event for?

Mark
 
Nidheesh Puthalath
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx for the reply
I do not think timers can help me
considering the fact that my network activity is asynchronous.

Let me state the problem clearly.

I am connected to a microcontroller device throungh serial port. Depending upon some control bytes
coming in the serial port sent by tha MC, I need to initiate certain activities( this may include further network reading, server communicatin etc). I want to implement this in a callback fashion. So i thought of making some custom events specific to contorl bytes in the serial port and triggering them as they arrives. Apparently i will have listners for each of this events, that will initiate the actual work. But i do not know how this model can be implemented.

Appreciate if you could help. Any alternative model is also apreciated

thanks in advance

Nidheesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic