*/
public void receivedMessage(ByteBuffer data) {
try {
// extract the message and client id
ReceivedMessage recv = MessagePacker.unpack(data);
Message m = recv.getMessage();
short clientID = recv.getClientID();
// find the handler
ClientConnectionHandler handler = getHandler(clientID);
if (handler == null) {
logger.fine("Session " + getSession().getName() +
" unknown handler ID: " + clientID);
sendError(m.getMessageID(), clientID,
"Unknown handler ID: " + clientID);
return;
}
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Session " + getSession().getName() +
" received message " + m +
" for client ID" + clientID +
" handled by " + handler.getConnectionType());
}
// determine if security is needed
Resource resource = null;
if (handler instanceof SecureClientConnectionHandler) {
SecureClientConnectionHandler sec =
(SecureClientConnectionHandler) handler;
resource = sec.checkMessage(getWonderlandClientID(), m);
}
// get the actions associated with this message
Set<Action> actions = getActions(m.getClass());
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Session " + getSession().getName() +
" security for message " + m +
" resource: " + resource +