Nice. Thanks much for this, Joel.
-=Cliff>
Best way to understand something for me is to break it down, rebuild, and document. Did I mention how much I dig your music on SoA? I was grooving to it all weekend while I worked on this :>
I have a question regarding Pipes. I know it has been hashed over a bit and I've read the existing discussion, but I am still unclear about cleanly separating modules on unload.
When the module receives the notification to disconnect, its JunctionMediator grabs its pipes (STDIN & STDOUT), calls their disconnect methods and then calls removePipe() on the mediated Junction. This effectively disconnects the dedicated pipe to the shell, but leaves me with a null output on the shell's STDOUT which causes an exception when the shell tries to broadcast a message. If I simply call removePipe() it doesn't cause the exception, but it also leaves the JunctionMediator in memory. It is disconnected from any facade, so it doesn't do aything in response to the messages, but it is still there (LEAK!) and I want it to die
So what I did was create a ManagedJunctionMediator that keeps a HashMap of the modules UID and the connections. It then goes through and physically removes the output from STDOUT. This is so nasty and stinks my code up, but I can't figure out how to remove individual outputs from a Pipe. I feel like disconnect() should remove the null output on the other end on the connection...
What am I doing wrong?