The current behavior is that on each 'startup' of the server, it adds and removes deployment scanners to line them up with what should be there. For example, if you're in workspace 1, and have deployments in metadata, customfolder1, customfolder2, all 3 of those will be added as deployment scanners. If you then shut down the server, switch workspaces to workspace2, and start the server, it will remove those 3 folders as required and add the folders required in the current workspace.
The only time this workflow fails is if you intend to start the server from command line. In that case, all recent scanners are still present, and need to be removed.
Removing all scanners, as you suggest, would need to be done in the 'stop' command, before executing the actual stop. THis is what makes it a bit difficult to do. Are you the results I describe when switching workspaces? Or does workspace1 deployments still end up inside workspace2?
The other problem is that if the server is ever launched in workspace adn then force shutdown, the next startup from command line will still have the old deployment scanners enabled.
Let me clarify: when I switch from workspace1 to workspace2, the server adapter does not show the deployed applications from workspace1 (which makes sense), but when I start the server, I see that these applications are still deployed and started, which, when working on workspace2, does not make any sense.
So, maybe the problem is that by default, the server adapter deploys the workspace applications in the default appserver 'standalone/deployments' folder ?