Rename DefaultAioChannelFinder to ReflectiveAioChannelFinder

This commit is contained in:
Trustin Lee 2012-08-29 12:13:50 +09:00
parent 1b810c4be6
commit 37f8710f2b
2 changed files with 5 additions and 5 deletions

View File

@ -41,13 +41,13 @@ public class AioEventLoopGroup extends MultithreadEventLoopGroup {
if (DetectionUtil.hasUnsafe()) {
finder = new UnsafeAioChannelFinder();
} else {
finder = new DefaultAioChannelFinder();
finder = new ReflectiveAioChannelFinder();
}
} catch (Throwable t) {
LOGGER.debug(String.format(
"Failed to instantiate the optimal %s implementation - falling back to %s.",
AioChannelFinder.class.getSimpleName(), DefaultAioChannelFinder.class.getSimpleName()), t);
finder = new DefaultAioChannelFinder();
AioChannelFinder.class.getSimpleName(), ReflectiveAioChannelFinder.class.getSimpleName()), t);
finder = new ReflectiveAioChannelFinder();
}
CHANNEL_FINDER = finder;
}

View File

@ -19,7 +19,7 @@ import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
final class DefaultAioChannelFinder implements AioChannelFinder {
final class ReflectiveAioChannelFinder implements AioChannelFinder {
private static volatile Map<Class<?>, Field> fieldCache = new HashMap<Class<?>, Field>();
@Override
@ -39,7 +39,7 @@ final class DefaultAioChannelFinder implements AioChannelFinder {
}
private static Field findField(Object command) throws Exception {
Map<Class<?>, Field> fieldCache = DefaultAioChannelFinder.fieldCache;
Map<Class<?>, Field> fieldCache = ReflectiveAioChannelFinder.fieldCache;
Class<?> commandType = command.getClass();
Field res = fieldCache.get(commandType);
if (res != null) {