}
private Invocation getInvocation(CharSequence host)
throws Throwable
{
InvocationServer server = getServer().getInvocationServer();
Invocation invocation = server.getInvocation(_invocationKey);
if (invocation == null) {
invocation = server.createInvocation();
invocation.setSecure(_isSecure);
if (host != null) {
String hostName = host.toString().toLowerCase(Locale.ENGLISH);
invocation.setHost(hostName);
invocation.setPort(getConnection().getLocalPort());
// Default host name if the host doesn't have a canonical
// name
int p = hostName.indexOf(':');
if (p > 0)
invocation.setHostName(hostName.substring(0, p));
else
invocation.setHostName(hostName);
}
InvocationDecoder decoder = server.getInvocationDecoder();
decoder.splitQueryAndUnescape(invocation, _uri, _uriLength);
/* XXX: common to AbstractHttpRequest
if (_server.isModified()) {
_server.logModified(log);
_invocation = invocation;
if (_server instanceof Server)
_invocation.setWebApp(((Server) _server).getDefaultWebApp());
restartServer();
return null;
}
*/
invocation = server.buildInvocation(_invocationKey.clone(),
invocation);
}
invocation = invocation.getRequestInvocation(getRequestFacade());