Set up any transport-specific derived properties in the message context.
try {
String urlString = mc.getStrProp(MessageContext.TRANS_URL);
if (urlString != null) {
URL url = new URL(urlString);
host = url.getHost();
port = new Integer(url.getPort()).toString();
}
} catch (java.net.MalformedURLException e) {
// Do nothing here?
}
if (host != null) mc.setProperty(HOST, host);
if (port != null) mc.setProperty(PORT, port);
log.debug( "Port = " + mc.getStrProp(PORT));
log.debug( "Host = " + mc.getStrProp(HOST));
// kind of ugly... fake up a "http://host:port/" url to send down the chain
// ROBJ TODO: clean this up so we use TCP transport properties all the way down
// use serviceclient properties if any, otherwise use ours
/*
String url = "http://"+serv.get(HOST)+":"+serv.get(PORT);
log.debug( "TCPTransport set URL to '" + url + "'");
mc.setProperty(MessageContext.TRANS_URL, url);
*/