Beispiel #1
0
  @SuppressWarnings("deprecation")
  @Override
  protected void logRoute(org.restlet.routing.Route route) {
    if (getLogger().isLoggable(Level.FINE)) {
      if (route instanceof HostRoute) {
        VirtualHost vhost = ((HostRoute) route).getVirtualHost();

        if (getComponent().getDefaultHost() == vhost) {
          getLogger().fine("The default host was selected.");
        } else {
          getLogger()
              .fine(
                  "This virtual host was selected: \""
                      + vhost.getHostScheme()
                      + "\", \""
                      + vhost.getHostDomain()
                      + "\", \""
                      + vhost.getHostPort()
                      + "\"");
        }
      } else {
        super.logRoute(route);
      }
    }
  }
Beispiel #2
0
 /** Clears the thread local variables set by the Restlet API and engine. */
 public static void clearThreadLocalVariables() {
   Response.setCurrent(null);
   Context.setCurrent(null);
   org.restlet.routing.VirtualHost.setCurrent(null);
   org.restlet.Application.setCurrent(null);
 }