int posColon = m.getRecipient().indexOf(":");
if(posColon < 0) throw new RuntimeException("Invalid address!");
// get corresponding provider
String proto = m.getRecipient().substring(0, posColon);
MessagingProvider p = (MessagingProvider)this.messagingProviders.get(proto);
if(p==null) throw new RuntimeException("Unregistered protocol: "+proto);
// strip off provider in message
String recipient = m.getRecipient().substring(posColon+1);
m.setRecipient(recipient);
// finally send the message
p.sendMessage(m);
}