Meaningless Drivel is fun!*
The moose likes Performance and the fly likes Removing self as a listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Removing self as a listener" Watch "Removing self as a listener" New topic
Author

Removing self as a listener

Kenneth Winn
Greenhorn

Joined: Apr 17, 2000
Posts: 8
What is the best way for an object to remove itself as a
listener of another object. It was added as a listener in
its ctor.
1) in the finalize method of the object?
2) create a new release() method that can be called by a third
object that 'has a' instance of the listening object?
3) other?
Thanks, Ken
Christope Roudet
Greenhorn

Joined: Oct 12, 2000
Posts: 2
You can use WeakReferences in your listener container.
see Tip 79 in on JavaWorld www.javaworld.com/javaworld/javatips/jw-javatip70_p.html
Christophe
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Removing self as a listener
 
Similar Threads
what is the return type for all the event listener methods?
callbacks
Custome events and Listener methods
getting the IP when the session is created
get parent object/component of a mouseListener