001package org.xbib.elasticsearch.common.netty; 002 003import org.jboss.netty.util.ThreadNameDeterminer; 004import org.jboss.netty.util.ThreadRenamingRunnable; 005 006/** 007 */ 008public class NettyStaticSetup { 009 010 private static EsThreadNameDeterminer ES_THREAD_NAME_DETERMINER = new EsThreadNameDeterminer(); 011 012 public static class EsThreadNameDeterminer implements ThreadNameDeterminer { 013 @Override 014 public String determineThreadName(String currentThreadName, String proposedThreadName) throws Exception { 015 // we control the thread name with a context, so use both 016 return currentThreadName + "{" + proposedThreadName + "}"; 017 } 018 } 019 020 static { 021 ThreadRenamingRunnable.setThreadNameDeterminer(ES_THREAD_NAME_DETERMINER); 022 } 023 024 public static void setup() { 025 026 } 027}