/**
  * PUBLIC: Processes the received RCM messaged from a JMS provider for cache coordination. This
  * will use the local connection from the configured TransportManager from the session's
  * RemoteCommandManager.
  *
  * @param message
  * @param session
  */
 public static void processJMSMessage(javax.jms.Message message, AbstractSession session) {
   RemoteCommandManager rcm = (RemoteCommandManager) session.getCommandManager();
   if (rcm.isStopped()) {
     throw RemoteCommandManagerException.remoteCommandManagerIsClosed();
   }
   JMSTopicRemoteConnection connection =
       (JMSTopicRemoteConnection) rcm.getTransportManager().getConnectionToLocalHost();
   connection.onMessage(message);
 }
 /**
  * INTERNAL: caches local connection, set localConnection to null, closes the cached connection in
  * a new thread.
  */
 public void removeLocalConnection() {
   JMSTopicRemoteConnection connectionToRemove = (JMSTopicRemoteConnection) localConnection;
   synchronized (this) {
     if (connectionToRemove == localConnection) {
       localConnection = null;
     } else {
       connectionToRemove = null;
     }
   }
   // closing connection may take time - do it outside of the synchronized block
   if (connectionToRemove != null) {
     connectionToRemove.close();
   }
 }