private Invoker getInvoker(HttpServletRequest req)
throws ResourceNotFoundException, MalformedURLException {
String path = req.getRequestURI().substring(
req.getContextPath().length());
InvokerBuilderFactory factory = path2ibf.get(path);
if (factory == null) {
factory = path2ibf.get(ibfDefaultName);
}
// TODO: 柔軟にするには切り出す。本来は初期化時に行えれば良い
URL url = new URL(req.getRequestURL().toString());
String host = url.getHost();
factory.setEvery(host.equals("localhost"));
Invoker invoker = factory.getInvokerBuilder().build(this, req);
return invoker;
}