CORBA Objects with Timer Event
I have a program that creates CORBA objects which are subscribed for different events (from other remote CORBA objects) and log every event that 开发者_JAVA百科thay receive in a database. The problem is that I also want this objects to send request to this other remote CORBA object every minute.
How can I do this?
Maybe start an additional thread for every created CORBA object and use it to ping my objects?
Or maybe I can use POA and tell it to send a message to all my objects (but without blocking)? Or request information from POA and make my own invocation (but also without blocking)?
I would start a timer thread that waits a minute in a loop and when the time is up calls all registered objects in a loop (providing that the call needs no arguments that the thread can not provide generically).
All you have to do then is to put all the object references you want to call every minute into a list (make sure to protect the access to the list appropriately).
精彩评论