             throw new InvalidDestinationError(msg);
         }
     }
-
+    
+    /**
+     * Monitor a rpc message that is being send
+    */
+    
+    private function monitorRpcMessage(message:IMessage,actualMessage:IMessage):void
+    {
+        if (NetworkMonitor.isMonitoring())
+        {
+        	if (message is ErrorMessage)
+	        {
+	        		NetworkMonitor.monitorFault(actualMessage, MessageFaultEvent.createEvent(ErrorMessage(message)));
+	        }
+	        else if (message is AcknowledgeMessage)
+	        {
+	       	    	NetworkMonitor.monitorResult(message, MessageEvent.createEvent(MessageEvent.RESULT, actualMessage));  
+	        }	        
+	        else{
+	        		NetworkMonitor.monitorInvocation(getNetmonId(), message);
+	        }
+	       
+        }
+    }    
+	
+	/**
+     * Return the id for the NetworkMonitor.
+     * @private
+     */
+    mx_internal function getNetmonId():String
+    {
+        return null;
+    }
+    
     /**
      *  Used to automatically initialize the <code>channelSet</code> property for the
      *  MessageAgent before it connects for the first time. 

import mx.messaging.events.ChannelEvent;
import mx.messaging.events.ChannelFaultEvent;
import mx.messaging.events.MessageAckEvent;
import mx.messaging.events.MessageFaultEvent;
import mx.messaging.messages.AbstractMessage;
import mx.messaging.messages.AcknowledgeMessage;

import mx.messaging.messages.ErrorMessage;
import mx.messaging.messages.IMessage;
import mx.messaging.messages.MessagePerformanceUtils;
import mx.netmon.NetworkMonitor;
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;
import mx.utils.Base64Encoder;
