Cleanup of non-graphical Java Bean
I'm currently working on a non-graphical javabean that manages serial communications with a piece of our companies electronic hardware. One of the properties of the bean is "connected", and this property governs whether or not the bean has acquired control of the serial port.
The problem I have is that when the bean is deleted it remains connected to the serial port, blocking any other connections. I want to try to clean up properly but how can I do this? As far as I can tell non-graphical beans are given no notification that they have been removed from a page.
Note that I am reluctant to make this bean graphical. I want to reserve the possibility of using it on embedded devices that may not have access to graphical libraries such as awt or swing.
Chris.

