Move triggering of listener outside the sync block else users of the API (WebSocket in this case) can end up in deadlock through no fault of their own.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1443121 13f79535-47bb-0310-9956-ffa450edef68
Add a utility method for generating secure masks for client data.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1443122 13f79535-47bb-0310-9956-ffa450edef68
Refactor the RemoteEndpoint implementation.
- Add support for masking client data
- Add support batching (a.k.a. buffering) messages
- Provide building blocks for Stream, Writer, etc. support

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1443135 13f79535-47bb-0310-9956-ffa450edef68